Playwright / Quiz
Suite Lifecycle Without Hidden Work
Reason about setup project ordering, reusable authentication state, teardown, and the limits of one shared account.
- Difficulty
- Medium
- Format
- Quiz
- Points
- 150
- Estimate
- 8 min
// MISSION BRIEF
Your Mission
The suite provisions data and signs in before browser projects run. Inspect two lifecycle designs and decide which one makes ordering and diagnostics visible without coupling independent tests to mutable shared state.
// FIRST CONTACT
Battle teaser
Review this config: projects: [ { name: "setup", testMatch: /auth.setup.ts/, teardown: "cleanup" }, { name: "cleanup", testMatch: /auth.teardown.ts/ }, { name: "chromium", use: { storageState: "playwright/.auth/user.json" }, dependencies: ["setup"] } ] What ordering does it express?
- AThe storageState path automatically creates the setup and cleanup projects
- BCleanup runs before setup so the auth file starts empty
- CAll three projects always begin at the same time because dependencies are labels only
- DThe setup project completes before chromium; cleanup runs after setup and all projects depending on setup have finished
Answers, scoring, hints, and the full battle stay sealed.
// SKILL TAGS
playwright-lifecycleproject-dependenciesauth-stateplaywright