> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.doc-detective.com/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.doc-detective.com/_mcp/server.

## v5.8.0

### New features

* The [`checkFile`](/docs/actions/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](/docs/test-docs/input-formats/gherkin).
* The `cucumber` reporter writes `cucumber.json`, which Xray, Allure, and other test-management tools import. See [Read the Cucumber report](/docs/ci/reporters-and-artifacts#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`](/docs/test-docs/platforms-and-browsers#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](/docs/actions/mockrequest#answer-in-sequence) and [Replay recorded responses](/docs/actions/mockrequest#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](/docs/test-docs/screenshot-visual-regression#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`](/docs/actions/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](/docs/test-docs/screenshot-visual-regression#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`](/docs/actions/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](/docs/test-docs/screenshot-visual-regression#accept-a-redesign-in-one-run).

### Behavior changes

* Screenshot comparison ignores small color differences, such as anti-aliasing, because `threshold` defaults to `0.1`. Before, any color change counted. Measured variation can only go down, so no existing reference image starts warning or gets overwritten. To keep the earlier counts, set `threshold: 0`.
* Every browser screenshot waits up to 2 seconds for the page's web fonts to load. Text then shows in its final font.
* Desktop Chrome and Firefox contexts save downloads to a `downloads` folder for the context in the run folder, without a prompt. See [`checkFile`](/docs/actions/checkfile).

### Bug fixes

* Detection and input formats:
  * An inline `test` statement's `before` and `after` files now run. Before, they validated but did nothing.
  * A DITA `<?doc-detective test ...?>` statement whose YAML starts on the line after the keyword now parses. Before, Doc Detective dropped it, and its steps ran in a test with a generated ID.
  * An inline statement that isn't valid YAML, such as `<!-- test testId: a description: b -->`, now produces a warning that names the fix, and `validate` reports it. Before, Doc Detective dropped it without a message.
  * DITA `<uicontrol>` typing steps find the field by its label. Before, every detected DITA typing step failed or typed into the wrong element.
  * A custom file type's `extensions` can be a single string, such as `"js"`, and `"cjs"` no longer matches `.js` files. A markup definition's `actions` can also be a single string.
  * A `runShell` file type's `$1` placeholder, the file's path, works with Windows paths. Before, the run exited `2` with `Bad escaped character in JSON`, or the command got a broken path.
* Browsers, windows, and tabs:
  * A Chrome context whose page never left the blank start page retries on a fresh session again. v5.7.0 had stopped this retry for Chrome.
  * A `mockRequest` with a glob URL no longer strips the headers from responses it doesn't answer.
  * A tab that a page opens, such as with `target="_blank"`, belongs to the window that opened it, so selectors such as `{"window": 0, "tab": 1}` find it.
  * An app window selector of `{ "index": n }` works like a bare index on Windows and macOS.
  * A string `elementClass` in a screenshot annotation or crop matches as one class name.
* Recording and code:
  * Chrome tab recordings keep the viewport's size while Chrome shows its sharing bar. When the screen is too small to make room for the bar, Doc Detective warns.
  * An automatic recording in a context with no browser, app, or device session reports `SKIPPED` instead of failing the context.
  * `runCode` with `directory` saves its output to the right path. Before, the output went to a doubled folder, and on Windows the step failed.
  * On Windows, a background process with `tty` passes quoted arguments to `cmd.exe` intact.