playwright
Playwright
When to Use This Skill
Use this skill when the user:
Mentions / keywords
- Mentions “Playwright”, “@playwright/test”, “playwright.config.ts”, “trace viewer”, or “PWDEBUG”
- References
*.spec.ts/*.test.tsfiles that import@playwright/test
Context
- Is trying to add or maintain E2E/smoke coverage for a web app
- Is trying to debug flaky UI tests (selectors, timing, waits)
- Needs one-off automation (screenshots, console logs, quick flow checks)
Purpose
- Route Playwright work into the right workflow (suite vs. one-off script vs. debugging)
- Standardize patterns that prevent flaky tests (locators, assertions, waits)
- Keep artifacts in
./tmp/for predictable cleanup
Quick routing
- Writing/maintaining
@playwright/testsuites → Seereferences/e2e-with-playwright-test.md - Auth once, reuse state (
storageState) → Seereferences/auth-and-storage-state.md - CI hardening + config knobs → See
references/ci-and-config.md - Locators, assertions, POM, fixtures → See
references/patterns.md - Fixtures (worker-scoped, auto fixtures) → See
references/fixtures.md - Mocking APIs / controlling network → See
references/api-mocking.md - Visual testing (
toHaveScreenshot) → Seereferences/visual-testing.md - Link checking / dead link detection → See
references/link-checking.md - Flaky tests / trace viewer / retries → See
references/debugging.md - One-off automation (screenshots/logs/check flows) → See
references/ad-hoc-automation.md
Non-negotiables
- Prefer
getByRole/getByLabelover CSS/XPath; adddata-testidonly when needed. - Use web-first assertions (
await expect(locator).toBeVisible()) instead of boolean checks. - Never add
waitForTimeout()to “fix” flake; if you use it temporarily while debugging, remove it before calling the work “done”. - Don’t default to
networkidleeverywhere; use it intentionally (SPAs / known background activity can make it misleading). - For CLI agent runs, use minimal reporters to avoid log spam; store artifacts under
./tmp/playwright/. - Keep tests independent; avoid cross-test shared state.
Verification
- E2E suite changes: run
npx playwright test --reporter=line(or--reporter=dot) and confirm failures reproduce. - Flake fixes: run the previously failing test at least 5 times (ex:
--repeat-each 5) before calling it fixed. - CI-sensitive changes: run the suite in “CI-like” settings (ex:
CI=1 npx playwright test --reporter=line) and confirm it still behaves.
Provenance
- Consolidated from upstream installed skills:
playwright-best-practices,playwright-testing,playwright-expert,playwright-skill,webapp-testing
More from devinschumacher/skills
skill-consolidator
Create and maintain first-party custom skills by strategically consolidating overlapping third-party skills. Scans globally installed skills (prefer ~/.agents/skills, or $CODEX_HOME/skills, or ~/.codex/skills) to produce an overlap report, then guides merging into a smaller, linked set inside this repo’s `skills/` directory. Use when asked to "clean up skills", "merge skills", "remove duplicates", "consolidate overlapping skills", "organize my skills", or "create a custom skill from other skills".
17agents-reminder
Reminds the agent to refresh on AGENTS.md guidelines before proceeding with tasks. Use at the start of a session or when unsure about agent policies.
12serp-toc
Route SERP org questions to the right repo, docs, and local clone quickly. Use when Codex needs to figure out where to look first across the SERP org, including repo lookup, server or infrastructure questions, secrets or env questions, branch orientation, local path discovery, or deciding whether something belongs in the docs hub versus an owning repo.
1workflow-visualizer
Map any system or workflow as a beautiful interactive HTML diagram
1project-status-phase
Advance GitHub project board items through the next truthful status phase using board rules, repo state, linked PRs, and docs. Use when asked to move, triage, reclassify, or advance an issue/card on a project board, or to keep board status aligned with reality.
1conventional-commit
Generates git commit messages following Conventional Commits 1.0.0 specification with semantic types (feat, fix, etc.), optional scope, and breaking change annotations. Use when committing code changes or creating commit messages.
1