Covers E2E test architecture and patterns using Playwright — how to structure test suites, organize tests, and apply proven patterns for authentication, mocking, visual regression, accessibility auditing, and CI parallelism. Focuses on the WHY and WHEN of test patterns rather than Playwright API specifics.
When to use: Designing test suite architecture, structuring Page Object Models, planning CI sharding strategies, setting up authentication flows, organizing tests with tags and annotations, implementing visual regression workflows, mocking network requests, auditing accessibility.
| Role-based locators | getByRole, getByText, getByLabel | Preferred over CSS/XPath selectors | | Page Object Model | Classes in tests/pages/ | Encapsulate all page-specific locators and actions | | Authentication | storageState + setup projects | Authenticate once, reuse across tests |