Production-grade Playwright testing toolkit. Use when the user mentions Playwright tests, end-to-end testing, browser automation, fixing flaky tests, test mi...
数据来源:ClawHub。 在 ClawSkills 查看
选择你使用的 Agent
方法一:命令行安装(推荐)
推荐(无需提前安装 clawhub)
npx clawhub@latest --dir ~/.claude/skills install playwright-pro或使用 clawhub CLI(需提前安装)
clawhub --dir ~/.claude/skills install playwright-pro⚠️ 需要 Node.js 18+,没有 Node?请使用下方方法二直接下载 ZIP。 安装 Node.js →
方法二:手动下载安装(无需 Node)
下载 ZIP,解压后将文件夹放到以下路径,重启 Agent 即可:
安装路径
~/.claude/skills/playwright-pro/💡解压后将文件夹放到上方路径,重启 Agent 即可生效
--- name: "playwright-pro" description: "Production-grade Playwright testing toolkit. Use when the user mentions Playwright tests, end-to-end testing, browser automation, fixing flaky tests, test migration, CI/CD testing, or test suites. Generate tests, fix flaky failures, migrate from Cypress/Selenium, sync with TestRail, run on BrowserStack. 55 templates, 3 agents, smart reporting." ---
Production-grade Playwright testing toolkit for AI coding agents.
When installed as a Claude Code plugin, these are available as /pw: commands:
| Command | What it does | |---|---| | /pw:init | Set up Playwright — detects framework, generates config, CI, first test | | /pw:generate | Generate tests from user story, URL, or component | | /pw:review | Review tests for anti-patterns and coverage gaps | | /pw:fix | Diagnose and fix failing or flaky tests | | /pw:migrate | Migrate from Cypress or Selenium to Playwright | | /pw:coverage | Analyze what's tested vs. what's missing | | /pw:testrail | Sync with TestRail — read cases, push results | | /pw:browserstack | Run on BrowserStack, pull cross-browser reports | | /pw:report | Generate test report in your preferred format |
The recommended sequence for most projects:
1. /pw:init → scaffolds config, CI pipeline, and a first smoke test
2. /pw:generate → generates tests from your spec or URL
3. /pw:review → validates quality and flags anti-patterns ← always run after generate
4. /pw:fix <test> → diagnoses and repairs any failing/flaky tests ← run when CI turns red
Validation checkpoints:
/pw:generate — always run /pw:review before committing; it catches locator anti-patterns and missing assertions automatically./pw:fix — re-run the full suite locally (npx playwright test) to confirm the fix doesn't introduce regressions./pw:migrate — run /pw:coverage to confirm parity with the old suite before decommissioning Cypress/Selenium tests.# 1. Generate tests from a user story
/pw:generate "As a user I can log in with email and password"
# Generated: tests/auth/login.spec.ts
# → Playwright Pro creates the file using the auth template.
# 2. Review the generated tests
/pw:review tests/auth/login.spec.ts
# → Flags: one test used page.locator('input[type=password]') — suggests getByLabel('Password')
# → Fix applied automatically.
# 3. Run locally to confirm
npx playwright test tests/auth/login.spec.ts --headed
# 4. If a test is flaky in CI, diagnose it
/pw:fix tests/auth/login.spec.ts
# → Identifies missing web-first assertion; replaces waitForTimeout(2000) with expect(locator).toBeVisible()
getByRole() over CSS/XPath — resilient to markup changespage.waitForTimeout() — use web-first assertionsexpect(locator) auto-retries; expect(await locator.textContent()) does notbaseURL in config — zero hardcoded URLs2 in CI, 0 locally'on-first-retry' — rich debugging without slowdowntest.extend() for shared state1. getByRole() — buttons, links, headings, form elements
2. getByLabel() — form fields with labels
3. getByText() — non-interactive text
4. getByPlaceholder() — inputs with placeholder
5. getByTestId() — when no semantic option exists
6. page.locator() — CSS/XPath as last resort
export TESTRAIL_URL="https://your-instance.testrail.io"
export TESTRAIL_USER="[email protected]"
export TESTRAIL_API_KEY="your-api-key"
export BROWSERSTACK_USERNAME="your-username"
export BROWSERSTACK_ACCESS_KEY="your-access-key"
See reference/ directory for:
golden-rules.md — The 10 non-negotiable ruleslocators.md — Complete locator priority with cheat sheetassertions.md — Web-first assertions referencefixtures.md — Custom fixtures and storageState patternscommon-pitfalls.md — Top 10 mistakes and fixesflaky-tests.md — Diagnosis commands and quick fixesSee templates/README.md for the full template index.
安装 Playwright Pro 后,可以对 AI 说这些话来触发它
Help me get started with Playwright Pro
Explains what Playwright Pro does, walks through the setup, and runs a quick demo based on your current project
Use Playwright Pro to production-grade Playwright testing toolkit
Invokes Playwright Pro with the right parameters and returns the result directly in the conversation
What can I do with Playwright Pro in my product manager workflow?
Lists the top use cases for Playwright Pro, with example commands for each scenario
将技能文件夹放到 ~/.claude/skills/playwright-pro/ 目录(个人级,所有项目可用),或 .claude/skills/playwright-pro/(项目级)。重启 AI 客户端后,用 /playwright-pro 主动调用,或让 AI 根据上下文自动发现并使用。
Playwright Pro 支持 Claude、Cursor、OpenClaw,可与这些 AI 平台无缝集成,扩展其能力。
Playwright Pro 可免费安装使用。请查阅仓库了解许可证信息。
Production-grade Playwright testing toolkit. Use when the user mentions Playwright tests, end-to-end testing, browser automation, fixing flaky tests, test mi...
Playwright Pro 属于「Product Manager」分类,该分类的技能帮助 AI 智能体在此领域执行专业任务。
Automate my product manager tasks using Playwright Pro
Identifies repetitive steps in your workflow and sets up Playwright Pro to handle them automatically