authSave / authLoad state file, and
only move to a cached auth module when you need it.
1. Live login (recommended default)
Wrap your login steps in a module and call it from thebefore section of each
test. It performs the login on every run, so each test starts with newly
captured authentication state.
log-in.module.yaml
checkout.test.yaml
2. Save and restore a state file (authSave / authLoad)
The authSave and authLoad steps (the editor’s Save auth state / Load
auth state) write and read the browser’s cookies, localStorage, and
IndexedDB to a JSON file you manage yourself. This is the closest analog to
Playwright’s storageState, so it is the
natural next step if you are migrating from Playwright: log in once, save the
state, and load it instead of logging in again.
checkout.test.yaml
3. Cached auth module
To avoid managing a state file, mark the login module as an auth module and enable caching. The first whole-test run logs in; later runs reuse the server-side session for the same cache key until it expires. See Cache authenticated sessions for the module setup andbefore example, and
Modules for cache fields.
Options and trade-offs
In CI
Live login works in CI with no extra setup; provide credentials as secrets (env.USERNAME, env.PASSWORD,
OTP secrets) rather than committed values. If logging in every run is too slow,
add an authSave / authLoad state file or a cached auth module; the module’s
session is stored server-side alongside the
step cache, so once one run logs in, other runs and
shards can reuse it within the TTL.
SSO, 2FA, and provisioned inboxes
For one-time codes and magic links, fetch the code in a JavaScript step and save it to the environment:Vercel deployment protection
For Vercel previews behind deployment protection, send a bypass secret in headers or query parameters. See Test Vercel protected preview environments.IP allowlist
If your test environment restricts inbound traffic by IP, allowlist Momentic’s fixed egress IP for hosted runs:34.106.239.183. On Azure-hosted deployments,
allowlist both 52.177.232.247 and 20.14.51.42.