Playwright Default Test Architecture
Pack:
playwrightSource:playwright/playwright-default-test-architecture/SKILL.mdUse this skill when the task is about the overall Playwright testing shape, not one isolated selector or one-off assertion.
- test architecture and ownership
playwright.config.tsdefaults- fixture boundaries
- browser and project strategy
- retry and parallelism posture
- routing to deeper Playwright skills
Routing cues
Section titled “Routing cues”- adopt Playwright, structure a test suite, define projects, configure retries, choose fixture boundaries, or decide where a Playwright task belongs -> use this skill
- locators, assertions, actionability, or user-visible test contracts -> use
playwright-locators-assertions-and-user-visible-contracts - auth reuse, storage state, multi-role projects, or isolation boundaries -> use
playwright-auth-projects-and-isolation - route interception, API synchronization, request waiting, or mocking strategy -> use
playwright-network-control-and-api-synchronization - flakes, traces, codegen, debug mode, inspector, or trace viewer -> use
playwright-debugging-traces-and-flake-reduction
Default path
Section titled “Default path”- Keep one
playwright.config.tsas the suite contract. - Organize tests by product surface or user journey, not by Playwright API method.
- Start with a small number of projects and add browser or device expansion only when there is real coverage value.
- Keep shared setup in fixtures and helper functions, not in ad hoc before-each sprawl.
- Prefer deterministic environment setup over compensating with retries.
- Treat retries as CI resilience, not as the primary flake fix.
When to deviate
Section titled “When to deviate”- Split config or projects more aggressively only when the app truly has distinct runtime surfaces.
- Use more retries in CI only when infrastructure noise is real and understood.
- Add device or browser matrix breadth only when the product surface justifies the cost.
Guardrails
Section titled “Guardrails”- tests should model user-visible behavior, not internal implementation details
- config should stay small and legible
- fixtures should centralize setup, not hide business logic
- retries should never be the first answer to instability
- browser coverage should reflect product risk, not default maximalism
- creating many projects before the team knows why each one exists
- hiding essential test behavior in over-abstracted fixtures
- treating retries as a substitute for synchronization discipline
- organizing tests around framework internals instead of real product flows
Verification checklist
Section titled “Verification checklist”- config is small and explicit
- tests are grouped by product behavior or journeys
- fixture boundaries reduce duplication without obscuring meaning
- project count matches actual coverage needs
- retries are deliberate and limited
Current snapshot
Section titled “Current snapshot”- Checked against official docs on 2026-04-03
- Current npm lines verified live on 2026-04-03:
playwright@1.59.1,@playwright/test@1.59.1 - Docs in scope: configuration, best practices, fixtures, and projects
Official references
Section titled “Official references”- https://playwright.dev/docs/intro
- https://playwright.dev/docs/test-configuration
- https://playwright.dev/docs/test-projects
- https://playwright.dev/docs/test-fixtures
- https://playwright.dev/docs/best-practices