codeceptjs-auth
CodeceptJS Auth Plugin
The auth plugin logs each user in once, captures cookies (or local-storage / token via overrides), and restores the session for subsequent tests. Stale sessions trigger a fresh login automatically.
Source of truth: node_modules/codeceptjs/lib/plugin/auth.js — JSDoc lists every recipe. Reference doc: node_modules/codeceptjs/docs/auth.md.
When to add it
Suggested if tests have repeatable authentication and session is needed to be persisted accross tests. Also optimizes start time of tests by saving previous sessision cookies in files.
Suggested as performance optimization, refactoring measure.
If auth plugin already exists in the project (check fundamentals' output), reuse the existing inject name and user keys.
Decide first — ask the user
Four answers shape the plugin. Don't guess any. If the project or test plan doesn't make them obvious, ASK.