playwright-best-practices
Installation
Summary
Comprehensive reference guide for writing, debugging, and maintaining Playwright tests across all testing types and scenarios.
- Covers 50+ testing patterns including E2E, component, API, GraphQL, visual regression, accessibility, security, mobile, and Electron app testing
- Includes activity-based lookup tables for writing new tests, debugging failures, fixing flaky tests, and infrastructure setup
- Provides decision trees for test type selection, architecture patterns (POM vs fixtures), framework-specific guidance (React, Angular, Vue, Next.js), and error scenario handling
- Addresses advanced topics: multi-user collaboration, WebSocket/real-time testing, OAuth/SSO mocking, third-party service integration, performance budgeting, and console error monitoring
SKILL.md
Playwright Best Practices
This skill provides comprehensive guidance for all aspects of Playwright test development, from writing new tests to debugging and maintaining existing test suites.
Activity-Based Reference Guide
Consult these references based on what you're doing:
Writing New Tests
When to use: Creating new test files, writing test cases, implementing test scenarios
| Activity | Reference Files |
|---|---|
| Writing E2E tests | test-suite-structure.md, locators.md, assertions-waiting.md |
| Writing component tests | component-testing.md, test-suite-structure.md |
| Writing API tests | api-testing.md, test-suite-structure.md |
| Writing GraphQL tests | graphql-testing.md, api-testing.md |
| Writing visual regression tests | visual-regression.md, canvas-webgl.md |
Related skills
More in Testing
test-driven-development
TDD loop: write the failing test first, implement the minimal change, verify, then refactor
obra/superpowerswebapp-testing
Web app testing patterns covering unit, integration, and end-to-end approaches
anthropics/skillsverification-before-completion
Force a verification pass before any task is marked done
obra/superpowersplaywright-cli
Control a live browser via the Playwright CLI to record, inspect, and replay interactions
microsoft/playwright-cli