Skip to content

ever-co/ever-works / .agents/skills/playwright-best-practices

playwright-best-practices

Verified

Use 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, WebSockets, geolocation, permissions, multi-tab/popup flows, mobile/responsive layouts, touch gestures, GraphQL, error handling, offline mode, multi-user collaboration, third-party services (payments, email verification), console error monitoring, global setup/teardown, test annotations (skip, fixme, slow), test tags (@smoke, @fast, @critical, filtering with --grep), project dependencies, security testing (XSS, CSRF, auth), performance budgets (Web Vitals, Lighthouse), iframes, component testing, canvas/WebGL, service workers/PWA, test coverage, i18n/localization, Electron apps, or browser extension testing. Covers E2E, component, API, visual, accessibility, security, Electron, and extension testing.

FileKindSize
LICENSE.mdmarkdown1.0 KB
README.mdmarkdown9.9 KB
SKILL.mdskill md25.7 KB
advanced/authentication-flows.mdmarkdown10.4 KB
advanced/authentication.mdmarkdown29.4 KB
advanced/clock-mocking.mdmarkdown9.4 KB
advanced/mobile-testing.mdmarkdown10.3 KB
advanced/multi-context.mdmarkdown8.2 KB
advanced/multi-user.mdmarkdown10.9 KB
advanced/network-advanced.mdmarkdown10.1 KB
advanced/third-party.mdmarkdown11.1 KB
architecture/pom-vs-fixtures.mdmarkdown11.4 KB
architecture/test-architecture.mdmarkdown14.3 KB
architecture/when-to-mock.mdmarkdown11.9 KB
browser-apis/browser-apis.mdmarkdown10.1 KB
browser-apis/iframes.mdmarkdown11.1 KB
browser-apis/service-workers.mdmarkdown13.1 KB
browser-apis/websockets.mdmarkdown9.9 KB
core/annotations.mdmarkdown10.4 KB
core/assertions-waiting.mdmarkdown9.1 KB
core/configuration.mdmarkdown13.7 KB
core/fixtures-hooks.mdmarkdown11.2 KB
core/global-setup.mdmarkdown12.4 KB
core/locators.mdmarkdown6.4 KB
core/page-object-model.mdmarkdown7.7 KB
core/projects-dependencies.mdmarkdown8.1 KB
core/test-data.mdmarkdown11.3 KB
core/test-suite-structure.mdmarkdown9.1 KB
core/test-tags.mdmarkdown6.7 KB
debugging/console-errors.mdmarkdown9.3 KB
debugging/debugging.mdmarkdown14.7 KB
debugging/error-testing.mdmarkdown9.2 KB
debugging/flaky-tests.mdmarkdown14.5 KB
frameworks/angular.mdmarkdown18.9 KB
frameworks/nextjs.mdmarkdown13.4 KB
frameworks/react.mdmarkdown17.5 KB
frameworks/vue.mdmarkdown17.3 KB
infrastructure-ci-cd/ci-cd.mdmarkdown10.4 KB
infrastructure-ci-cd/docker.mdmarkdown7.0 KB
infrastructure-ci-cd/github-actions.mdmarkdown15.1 KB
infrastructure-ci-cd/gitlab.mdmarkdown10.9 KB
infrastructure-ci-cd/other-providers.mdmarkdown14.2 KB
infrastructure-ci-cd/parallel-sharding.mdmarkdown11.6 KB
infrastructure-ci-cd/performance.mdmarkdown11.3 KB
infrastructure-ci-cd/reporting.mdmarkdown11.4 KB
infrastructure-ci-cd/test-coverage.mdmarkdown12.0 KB
testing-patterns/accessibility.mdmarkdown8.7 KB
testing-patterns/api-testing.mdmarkdown23.5 KB
testing-patterns/browser-extensions.mdmarkdown13.0 KB
testing-patterns/canvas-webgl.mdmarkdown12.3 KB
testing-patterns/component-testing.mdmarkdown11.0 KB
testing-patterns/drag-drop.mdmarkdown17.4 KB
testing-patterns/electron.mdmarkdown12.8 KB
testing-patterns/file-operations.mdmarkdown10.0 KB
testing-patterns/file-upload-download.mdmarkdown16.5 KB
testing-patterns/forms-validation.mdmarkdown21.3 KB
testing-patterns/graphql-testing.mdmarkdown8.6 KB
testing-patterns/i18n.mdmarkdown12.3 KB
testing-patterns/performance-testing.mdmarkdown11.5 KB
testing-patterns/security-testing.mdmarkdown11.5 KB
testing-patterns/visual-regression.mdmarkdown18.4 KB
```

░█▀█░█░░░█▀█░█░█░█░█░█▀▄░▀█▀░█▀▀░█░█░▀█▀░░░█▀▄░█▀▀░█▀▀░▀█▀░░░█▀█░█▀▄░█▀█░█▀▀░▀█▀░▀█▀░█▀▀░█▀▀░█▀▀░
░█▀▀░█░░░█▀█░░█░░█▄█░█▀▄░░█░░█░█░█▀█░░█░░░░█▀▄░█▀▀░▀▀█░░█░░░░█▀▀░█▀▄░█▀█░█░░░░█░░░█░░█░░░█▀▀░▀▀█░
░▀░░░▀▀▀░▀░▀░░▀░░▀░▀░▀░▀░▀▀▀░▀▀▀░▀░▀░░▀░░░░▀▀░░▀▀▀░▀▀▀░░▀░░░░▀░░░▀░▀░▀░▀░▀▀▀░░▀░░▀▀▀░▀▀▀░▀▀▀░▀▀▀░
```

<img src="https://currents.dev/favicon-96x96.png" width="24" height="24" align="left" />by [currents.dev](https://currents.dev?utm_source=ai-skill) - The all-in-one Dashboard for Playwright Testing.

# Playwright Best Practices Skill

A skill that gives the AI specialized guidance for writing, debugging, and maintaining **Playwright** tests in **TypeScript**. Use it in any repo where you work with Playwright so the assistant follows best practices for E2E, component, API, visual regression, accessibility, security, i18n, Electron, and browser extension testing.

## Installation

```bash
npx skills add https://github.com/currents-dev/playwright-best-practices-skill
```

The skill is activity-based: the AI is directed to the right reference depending on what you're doing, so you get focused advice without loading everything at once.

## When the Skill Is Used

The skill triggers when the AI infers you need help with things like:

- Writing new E2E, component, API, visual regression, or accessibility tests
- Testing mobile/responsive layouts, touch gestures, or device emulation
- Implementing file uploads/downloads, date/time mocking, or WebSocket testing
- Handling OAuth popups, geolocation, permissions, or multi-tab flows
- Testing iframes, canvas/WebGL, service workers, or PWA features
- Testing Electron desktop apps or browser extensions
- Internationalization (i18n), locales, RTL layouts, or date/number formats
- Testing error states, offline mode, or network failure scenarios
- Security testing (XSS, CSRF, authentication, authorization)
- Performance testing with Web Vitals or Lighthouse
- Reviewing or refactoring Playwright test code
- Fixing flaky tests or debugging failures
- Setting up CI/CD, test coverage, or global setup/teardown
- Configuring projects, dependencies, parallel runs, or sharding

You don't have to mention "skill" or "Playwright best practices"; describe your task (e.g. "fix this flaky login test" or "add accessibility tests") and the AI will use the skill when it's relevant.

## What's Inside

**57 reference documents** organized into 8 categories:

### Core (`core/`)

| Topic                | Reference                  | Use for                                           |
| -------------------- | -------------------------- | ------------------------------------------------- |
| Test structure       | `test-suite-structure.md`  | Structure, config, E2E/component/API/visual tests |
| Locators             | `locators.md`              | Selectors, robustness, avoiding brittle locators  |
| Assertions & waiting | `assertions-waiting.md`    | Expect APIs, auto-waiting, polling                |
| Page Object Model    | `page-object-model.md`     | POM structure and patterns                        |
| Fixtures & hooks     | `fixtures-hooks.md`        | Setup, teardown, auth, custom fixtures            |
| Test data            | `test-data.md`             | Factories, Faker, data-driven testing             |
| Annotations          | `annotations.md`           | skip, fixme, slow, test steps                     |
| Configuration        | `configuration.md`         | playwright.config.ts options                      |
| Global setup         | `global-setup.md`          | globalSetup/Teardown, DB migrations               |
| Projects             | `projects-dependencies.md` | Project config, dependencies, filtering           |

### Debugging (`debugging/`)

| Topic          | Reference           | Use for                                     |
| -------------- | ------------------- | ------------------------------------------- |
| Debugging      | `debugging.md`      | Trace viewer, inspector, common issues      |
| Flaky tests    | `flaky-tests.md`    | Detection, diagnosis, fixing, quarantine    |
| Error testing  | `error-testing.md`  | Error boundaries, offline, network failures |
| Console errors | `console-errors.md` | Capturing and failing on JS errors          |

### Testing Patterns (`testing-patterns/`)

| Topic                | Reference                 | Use for                                        |
| -------------------- | ------------------------- | ---------------------------------------------- |
| Accessibility        | `accessibility.md`        | Axe-core, keyboard nav, ARIA, focus management |
| API testing          | `api-testing.md`          | REST API testing, request context              |
| Component testing    | `component-testing.md`    | CT setup, mounting, props, mocking             |
| Visual regression    | `visual-regression.md`    | Screenshot comparison, thresholds              |
| File operations      | `file-operations.md`      | Upload, download basics                        |
| File upload/download | `file-upload-download.md` | Progress, cancellation, retry patterns         |
| Forms validation     | `forms-validation.md`     | Form testing, validation states                |
| Drag and drop        | `drag-drop.md`            | Drag-and-drop interactions                     |
| GraphQL testing      | `graphql-testing.md`      | GraphQL queries, mutations, mocking            |
| Canvas/WebGL         | `canvas-webgl.md`         | Canvas testing, charts, WebGL, games           |
| i18n                 | `i18n.md`                 | Locales, RTL, date/number formats              |
| Electron             | `electron.md`             | Desktop apps, IPC, main/renderer process       |
| Browser extensions   | `browser-extensions.md`   | Popup, background, content scripts, APIs       |
| Security testing     | `security-testing.md`     | XSS, CSRF, auth security, authorization        |
| Performance testing  | `performance-testing.md`  | Web Vitals, budgets, Lighthouse                |

### Advanced (`advanced/`)

| Topic            | Reference                 | Use for                                     |
| ---------------- | ------------------------- | ------------------------------------------- |
| Authentication   | `authentication.md`       | Login flows, session storage, cookies       |
| Auth flows       | `authentication-flows.md` | MFA, password reset, complex auth           |
| Mobile testing   | `mobile-testing.md`       | Device emulation, touch gestures, viewports |
| Clock mocking    | `clock-mocking.md`        | Date/time mocking, timezones, timers        |
| Multi-context    | `multi-context.md`        | Popups, new tabs, OAuth flows               |
| Multi-user       | `multi-user.md`           | Collaboration, RBAC, concurrent actions     |
| Network advanced | `network-advanced.md`     | GraphQL, HAR, request modification          |
| Third-party      | `third-party.md`          | OAuth, payments, email/SMS mocking          |

### Browser APIs (`browser-apis/`)

| Topic           | Reference            | Use for                                     |
| --------------- | -------------------- | ------------------------------------------- |
| Browser APIs    | `browser-apis.md`    | Geolocation, permissions, clipboard, camera |
| WebSockets      | `websockets.md`      | Real-time testing, SSE, reconnection        |
| iFrames         | `iframes.md`         | Cross-origin, nested, dynamic iframes       |
| Service workers | `service-workers.md` | PWA, caching, offline, push notifications   |

### Architecture (`architecture/`)

| Topic             | Reference              | Use for                         |
| ----------------- | ---------------------- | ------------------------------- |
| POM vs fixtures   | `pom-vs-fixtures.md`   | Choosing between patterns       |
| Test architecture | `test-architecture.md` | Test type selection, structure  |
| When to mock      | `when-to-mock.md`      | Mock vs real services decisions |

### Frameworks (`frameworks/`)

| Topic   | Reference    | Use for                         |
| ------- | ------------ | ------------------------------- |
| React   | `react.md`   | React-specific testing patterns |
| Angular | `angular.md` | Angular-specific testing        |
| Vue     | `vue.md`     | Vue/Nuxt testing patterns       |
| Next.js | `nextjs.md`  | Next.js SSR/SSG testing         |

### Infrastructure & CI/CD (`infrastructure-ci-cd/`)

| Topic             | Reference              | Use for                              |
| ----------------- | ---------------------- | ------------------------------------ |
| CI/CD             | `ci-cd.md`             | Pipelines, general CI setup          |
| GitHub Actions    | `github-actions.md`    | GitHub-specific workflows            |
| GitLab CI         | `gitlab.md`            | GitLab-specific pipelines            |
| Other providers   | `other-providers.md`   | CircleCI, Azure DevOps, Jenkins      |
| Docker            | `docker.md`            | Container setup, Playwright images   |
| Parallel/sharding | `parallel-sharding.md` | Sharding, parallel execution         |
| Performance       | `performance.md`       | Parallel runs, optimization          |
| Reporting         | `reporting.md`         | Test reporters, artifacts            |
| Test coverage     | `test-coverage.md`     | V8 coverage, reports, thresholds, CI |

The skill's `SKILL.md` maps your current activity to these references so the right content is used in context.

## License

MIT
rea-analysis-optimizationmorluto/reaOptimize REA providers and shared analysis workflows for agent context, latency, CPU, and memory while preserving correctness and Evidence. Use for analysis bottlenecks and cache or query design; CI/test-suite optimization belongs to rea-ci-tests-audit.Stars: 471kUpdated Claude CodeCodexVerifiedInstall
rea-ci-tests-auditmorluto/reaAudit REA CI and test suites for correctness, fixture drift, false passes, and measured performance; use for suite or workflow investigations and efficiency changes, rather than ordinary feature testing or a single test failure.Stars: 471kUpdated Claude CodeCodexVerifiedInstall
rea-tool-designmorluto/reaAudit, investigate, design, or change REA investigation tools, CLI/MCP contracts, provider capabilities, and Evidence semantics.Stars: 471kUpdated Claude CodeCodexVerifiedInstall
ponytail-auditDietrichGebert/ponytailQuality audit of the whole repo: bugs, security, real load, missing tests, speed, and what to delete. Most important first.Stars: 194kUpdated Claude CodeCodexVerifiedInstall