$npx -y skills add currents-dev/playwright-best-practices-skill --skill playwright-best-practicesUse when writing Playwright tests, fixing flaky tests, debugging failures, implementing Page Object Model, configuring CI/CD, optimizing performance, mocking APIs, handling authentication or OAuth, testing accessibility (axe-core), file uploads/downloads, date/time mocking, WebSo
| 1 | # Playwright Best Practices |
| 2 | |
| 3 | This skill provides comprehensive guidance for all aspects of Playwright test development, from writing new tests to debugging and maintaining existing test suites. |
| 4 | |
| 5 | ## Activity-Based Reference Guide |
| 6 | |
| 7 | Consult these references based on what you're doing: |
| 8 | |
| 9 | ### Writing New Tests |
| 10 | |
| 11 | **When to use**: Creating new test files, writing test cases, implementing test scenarios |
| 12 | |
| 13 | | Activity | Reference Files | |
| 14 | | ----------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------- | |
| 15 | | **Writing E2E tests** | [test-suite-structure.md](core/test-suite-structure.md), [locators.md](core/locators.md), [assertions-waiting.md](core/assertions-waiting.md) | |
| 16 | | **Writing component tests** | [component-testing.md](testing-patterns/component-testing.md), [test-suite-structure.md](core/test-suite-structure.md) | |
| 17 | | **Writing API tests** | [api-testing.md](testing-patterns/api-testing.md), [test-suite-structure.md](core/test-suite-structure.md) | |
| 18 | | **Writing GraphQL tests** | [graphql-testing.md](testing-patterns/graphql-testing.md), [api-testing.md](testing-patterns/api-testing.md) | |
| 19 | | **Writing visual regression tests** | [visual-regression.md](testing-patterns/visual-regression.md), [canvas-webgl.md](testing-patterns/canvas-webgl.md) | |
| 20 | | **Structuring test code with POM** | [page-object-model.md](core/page-object-model.md), [test-suite-structure.md](core/test-suite-structure.md) | |
| 21 | | **Setting up test data/fixtures** | [fixtures-hooks.md](core/fixtures-hooks.md), [test-data.md](core/test-data.md) | |
| 22 | | **Handling authentication** | [authentication.md](advanced/authentication.md), [authentication-flows.md](advanced/authentication-flows.md) | |
| 23 | | **Testing date/time features** | [clock-mocking.md](advanced/clock-mocking.md) | |
| 24 | | **Testing file upload/download** | [file-operations.md](testing-patterns/file-operations.md), [file-upload-download.md](testing-patterns/file-upload-download.md) | |
| 25 | | **Testing forms/validation** | [forms-validation.md](testing-patterns/forms-validation.md) | |
| 26 | | **Testing drag and drop** | [drag-drop.md](testing-patterns/drag-drop.md) | |
| 27 | | **Testing accessibility** | [accessibility.md](testing-patterns/accessibility.md) | |
| 28 | | **Testing security (XSS, CSRF)** | [security-testing.md](testing-patterns/security-testing.md) | |
| 29 | | **Using test annotations** | [annotations.md](core/annotations.md) | |
| 30 | | **Using test tags** | [test-tags.md](core/test-tags.md) | |
| 31 | | **Testing iframes** | [iframes.md](browser-apis/iframes.md) | |
| 32 | | ** |