This documentation is available as Markdown. For the complete index, see llms.txt. Skip to content

Auth & cached login

For the complete documentation index, see llms.txt

Signing in at the top of every scenario is slow and brittle. Cache a logged-in session once and reuse it.

storageState

Point your config at a Playwright storageState.json:

unotest.config.mjs
export default {
storageState: "unotest/.auth/state.json",
};

Scenarios then start already authenticated — no flow_signin per test.

Seeding the state

Create the state once (an agent flow, or a small setup scenario that signs in and captures cookies/localStorage). Keep the file git-ignored and refresh it when it expires.

When to still sign in

  • Tests that specifically exercise the login flow itself.
  • Tests that need a different user than the cached one — use flow_signin for those.