Loading...
Loading...
E2E test architecture and patterns with Playwright. Use when designing test suites, structuring Page Object Models, planning CI sharding strategies, setting up authentication flows, or organizing tests with tags and annotations. Use for test architecture, accessibility auditing with axe-core, network mocking strategies, visual regression workflows, HAR replay, and storageState authentication patterns. For Playwright API details, browser automation, or web scraping, use the playwright skill instead.
npx skill4agent add oakoss/agent-skills e2e-testingplaywright| Pattern | API/Tool | Key Points |
|---|---|---|
| Role-based locators | | Preferred over CSS/XPath selectors |
| Page Object Model | Classes in | Encapsulate all page-specific locators and actions |
| Authentication | | Authenticate once, reuse across tests |
| Visual regression | | Mask dynamic content to prevent flakes |
| Accessibility audit | | |
| Trace debugging | | Full DOM snapshots, network logs, and timeline |
| Network mocking | | Stable tests without third-party dependencies |
| HAR replay | | High-fidelity mocks from recorded traffic |
| Image blocking | | Speed up tests by skipping images |
| CI sharding | | Split suite across parallel CI machines |
| Blob reports | | Merge sharded results into a single report |
| Test tags | | Filter tests by category with |
| Test steps | | Group actions in trace viewer and reports |
| Changed tests only | | Run only test files changed since base branch |
| Native a11y checks | | Lightweight alternative to full axe-core scans |
| Git info in reports | | Link test reports to commits for CI debugging |
| Web-first assertions | | Auto-wait instead of |
| Mistake | Correct Pattern |
|---|---|
Using | Use web-first assertions like |
| Writing raw locators directly in test files | Encapsulate all selectors in Page Object Model classes |
| Testing third-party APIs (Stripe, Auth0) directly | Mock external services with |
| Debugging CI failures with screenshots instead of traces | Configure |
| Sharing state between tests via global variables | Use a fresh |
| Running all tests in a single CI job | Use Playwright sharding ( |
| Using CSS/XPath selectors for element location | Use role-based locators that survive refactors and enforce accessibility |
| Logging in via UI in every test | Use |
Using | Use |
Committing | Add |
ExploreTaskPlanFor Playwright API details, browser automation, scraping, stealth mode, screenshots/PDFs, Docker deployment, or troubleshooting Playwright errors, use theskill.playwright