Setup
- Extract your login steps into a Module. The last step should verify the authenticated state (e.g. a Page check for the dashboard URL).
- In the module config, enable Caching globally
(
defaultCacheAllInvocations) and Treat as auth module (autoAuth). - Set a Default cache key (
defaultCacheKey, e.g.admin-user). Parallel tests sharing the key reuse the same cached session. - Set a Default expiry (
defaultCacheTtl, in milliseconds) shorter than your session lifetime. - Remove any Save auth state / Load auth state (
authSave/authLoad) steps. A cached auth module handles this automatically - see Save and restore a state file.
log-in.module.yaml
before section:
checkout.test.yaml
How it works
Momentic captures cookies,localStorage, and IndexedDB when the module
finishes. On subsequent runs within the expiry window, it restores that state
and skips the module’s steps.