Skip to navigation

Each entry lists what changed for you in one Doc Detective release. New features come first, then behavior and breaking changes, then notable bug fixes. Releases that only changed internals say so in one line. The newest release comes first, and the oldest entry is version 3.0.0. Major releases lead with their breaking changes and migration steps. To find your installed version, run npx doc-detective --version.

Moving to Doc Detective 5? Start with Upgrade to Doc Detective 5.

For commit-level detail, including changes to build and test tooling, see the GitHub releases for Doc Detective.

v5.9.0

New features

  • Each run compares its failures with the newest earlier run in the same outputDir. The terminal, Markdown, and HTML reports tag each failure [new] or [already failing] and list the tests that are now fixed. The results add a comparison object and a failureStatus on each context. Choose what to compare with in compareTo or --compare-to. See Compare with an earlier run.
  • Set failOn: "new" or pass --fail-on new to fail a run only when a failure is new. When every failure was already failing, the run exits 0. See Fail only on new failures.
  • An httpRequest step’s response.schema takes a JSON Schema the response body must match. Use it to check the types, formats, and patterns of values that change every run, such as IDs and timestamps. See Check types, formats, and patterns.

v5.8.0

New features

  • The checkFile action waits for a finished file and can check its text. Set path to match files relative to the spec, such as a report a command writes. Set download to match a file the browser downloaded. Downloads work in desktop Chrome and Firefox.
  • Doc Detective runs Gherkin .feature files with no config. Each scenario runs as a test, and each row of a scenario outline’s examples runs as its own test. Each step phrase maps to a Doc Detective action. You don’t write step definitions. See Gherkin input format.
  • The cucumber reporter writes cucumber.json, which Xray, Allure, and other test-management tools import. See Read the Cucumber report.
  • A runOn entry takes a matrix of values, and a test runs once for each combination of the keys its steps reference as $$matrix.<key>. List the values inline, or load them from a JSON array file or a sitemap’s <loc> entries. Use it to run one test against every page of a site or every locale. See Run once per value with matrix.
  • mockRequest answers in sequence with responses, where the last response repeats, and replays recorded responses from a HAR file with harPath. See Answer in sequence and Replay recorded responses.
  • Screenshot comparison has new controls:
    • mask lists elements whose pixels don’t count when Doc Detective compares a screenshot with its reference image, such as a clock or an ad. See Ignore parts that change.
    • threshold, from 0 to 1, sets how different a pixel’s color must be to count as changed. maxDiffPixels caps the number of changed pixels alongside maxVariation. See screenshot.
    • When any pixels differ, the step writes a diff image and a copy of the previous reference image to the run folder. See Read what changed.
  • Screenshot capture has new options. fullPage captures the whole scrollable page. animations: "disabled" stops the page’s motion for the capture. stable waits until the page stops changing. style applies CSS only for the capture, such as to hide a chat widget. See screenshot.
  • The --overwrite-screenshots flag and the overwriteScreenshots config key set every screenshot step’s overwrite for a run, so you can accept a redesign without editing each step. See Accept a redesign in one run.

v5.7.0

New features

  • The mockRequest action answers matching browser requests with a response you define, until the test ends. The request never reaches the server. Use it to show stable data in screenshots or to test how a page handles an error. Filter by URL glob and, optionally, by HTTP method. mockRequest works in Chrome. Other browsers skip the step.
  • The saveState and loadState actions save the open site’s cookies and localStorage to a JSON file and load them in a later test. You then sign in once instead of in every test. The file uses Playwright’s storageState format. saveState doesn’t replace an existing file unless you set overwrite. The file holds live session cookies and tokens, so keep it out of version control and uploaded CI artifacts. See Pages behind a sign-in.
  • The totp(secret) expression returns the current one-time code for a base32 secret, the code an authenticator app shows. A test can then sign in to an account that uses two-factor authentication. See Function operators and Sign in with a one-time code.
  • A context’s browser can set what the page sees about the user’s device: colorScheme, locale, timezone, deviceScaleFactor, reducedMotion, and clock. Chrome sets every key, and Firefox sets every key except timezone and clock. A context that asks for a key its browser can’t set reports SKIPPED. See Page emulation.

v5.6.3

Bug fixes

  • Interrupting a run, such as with Ctrl+C, while Doc Detective builds WebDriverAgent for iOS now stops the xcodebuild process. Before, the build kept running after Doc Detective exited and left its build lock behind. This covers the first-use build during a test run and doc-detective install ios. After an interrupt, Doc Detective starts no more builds and opens no more iOS sessions.

v5.6.0

New features

  • iOS tests on macOS now build WebDriverAgent on first use. If no cached build matches the current Xcode version and driver, the test builds one before it starts. The build goes into the cache. Previously, only doc-detective install ios --yes filled the cache, and otherwise Appium compiled its own copy during the session. The first-use build can take about 10 minutes, and Doc Detective warns in the terminal and the report while it runs. If the build fails, the test still runs and Appium builds WebDriverAgent during the session. To keep the build out of test runs, such as in a CI setup step, run doc-detective install ios --yes beforehand. To turn off the first-use build, set the DOC_DETECTIVE_NO_IOS_AUTOINSTALL environment variable to 1. See WebDriverAgent builds on first use.

v5.5.0

New features

  • Doc Detective resolves include directives by default before it looks for tests. A test in a shared snippet runs inside each page that includes it, in reading order. It reads AsciiDoc include::, MkDocs snippets, mdBook {{#include}}, Fern <Markdown src>, MDX snippet imports for Docusaurus, Mintlify, Starlight, and Astro, and reStructuredText .. include::. See Includes.
  • A fileTypes entry accepts includeStatements, a list of regular expressions for include syntax that Doc Detective doesn’t know. See Includes.

v5.4.0

New features

  • Doc Detective tests reStructuredText (.rst) files with no extra config. Inline statements are RST comments, such as .. test {...}, .. step {...}, and .. test end. With step detection on, links, bold text, images, and code blocks become steps, and nothing inside code, literals, or raw blocks does. rst is part of the default fileTypes list. See input formats.

v5.3.1

Bug fixes

  • The official Docker image keeps the browsers it ships with instead of downloading newer ones on each run.
  • The iOS driver installs on its own, so a failed iOS driver build no longer stops Appium and the browser drivers from installing.

v5.3.0

New features

v5.2.0

New features

  • Added the validate command, which checks spec files and inline tests without running them, as in doc-detective validate ./docs. It exits 0 when every test is valid, 1 when any test is invalid, and 2 for a usage error, a bad config, or no tests found. Pass --json for a machine-readable list of each file and its errors. Like every other output, validate output masks environment variable values. See the CLI reference.

v4.43.1

This is a patch release for the version 4 line, published after v5.0.0. To stay on version 4, pin it, as in npx doc-detective@4.

v5.0.0

Doc Detective 5 makes a failed test fail the run, separates results from logs, and checks specs strictly. Before you upgrade, read Upgrade to Doc Detective 5. It lists every breaking change and what to do about each one. To stay on version 4 for now, pin it, as in npx doc-detective@4.

To migrate from Doc Detective 4:

v4.43.0

New features

  • Config files, specs, and tests accept publicVariables, a list of environment variable names. Doc Detective 5 masks environment variable values in output, and publicVariables lists the exceptions. Version 4 doesn’t mask values, so you can add the key before you upgrade. See Upgrade to Doc Detective 5.

v4.42.1

Maintenance release; no user-facing changes.

v4.42.0

This release prepares version 4 users for Doc Detective 5 and changes how Doc Detective guards local URLs. See Upgrade to Doc Detective 5.

v4.41.6

Bug fixes

  • Hints printed after a run now link to live documentation pages. Previously, many links led to the docs home page or to pages that no longer exist.

v4.41.5

Maintenance release; no user-facing changes.

v4.41.4

This is the first version published to npm after v4.38.1. It includes the changes listed for v4.38.2 through v4.41.3, which were tagged but not published.

v4.41.3

This version was tagged but not published to npm. Its changes first shipped in v4.41.4.

v4.41.2

This version was tagged but not published to npm. Its changes first shipped in v4.41.4.

v4.41.1

This version was tagged but not published to npm. Its changes first shipped in v4.41.4.

Maintenance release; no user-facing changes.