> 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.7.0

### New features

* The [`mockRequest`](/docs/actions/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`](/docs/actions/savestate) and [`loadState`](/docs/actions/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](/docs/test-docs/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](/reference/reference/expressions#function-operators) and [Sign in with a one-time code](/docs/ci/secrets#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](/docs/test-docs/platforms-and-browsers#page-emulation).

### Behavior changes

* Chrome sessions now use a different browser connection, which `mockRequest` and the `timezone` and `clock` settings need. Firefox and Safari sessions are unchanged.

### Bug fixes

* [`saveCookie`](/docs/actions/savecookie) keeps each cookie's `httpOnly` flag, so [`loadCookie`](/docs/actions/loadcookie) restores the cookie as it was saved. Cookie files are readable only by your user account, and a save never leaves a partly written file.