playwright
11
总安装量
7
周安装量
#28706
全站排名
安装命令
npx skills add https://github.com/devinschumacher/skills --skill playwright
Agent 安装分布
gemini-cli
6
claude-code
6
cursor
6
github-copilot
5
codex
5
opencode
5
Skill 文档
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