playwright-pro
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.
- License 许可
- MIT
- 所属仓库
- kalash33/kstack
- 最近更新
- 2026-05-20
- Stars
- ★ 0
- Forks
- 0
01 前言 Front Matter
- 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.
02 资源文件 84
- 参考文档.claude-plugin/plugin.json633 B
- 参考文档.mcp.json668 B
- 参考文档agents/migration-planner.md3.5 KB
- 参考文档agents/test-architect.md3.1 KB
- 参考文档agents/test-debugger.md3.1 KB
- 参考文档CLAUDE.md3.6 KB
- 脚本hooks/detect-playwright.sh770 B
- 参考文档hooks/hooks.json464 B
- 脚本hooks/validate-test.sh1.9 KB
- 参考文档integrations/browserstack-mcp/package.json400 B
- 脚本integrations/browserstack-mcp/src/client.ts2.8 KB
- 脚本integrations/browserstack-mcp/src/index.ts6.1 KB
- 脚本integrations/browserstack-mcp/src/types.ts1.3 KB
- 参考文档integrations/browserstack-mcp/tsconfig.json284 B
- 参考文档integrations/testrail-mcp/package.json392 B
- 脚本integrations/testrail-mcp/src/client.ts3.6 KB
- 脚本integrations/testrail-mcp/src/index.ts9.9 KB
- 脚本integrations/testrail-mcp/src/types.ts2.0 KB
- 参考文档integrations/testrail-mcp/tsconfig.json284 B
- 许可证LICENSE1.0 KB
- 参考文档README.md4.4 KB
- 参考文档reference/assertions.md2.2 KB
- 参考文档reference/common-pitfalls.md3.1 KB
- 参考文档reference/fixtures.md3.1 KB
- 参考文档reference/flaky-tests.md1.5 KB
- 参考文档reference/golden-rules.md906 B
- 参考文档reference/locators.md2.1 KB
- 参考文档settings.json102 B
- 参考文档templates/accessibility/color-contrast.md5.5 KB
- 参考文档templates/accessibility/keyboard-navigation.md5.2 KB
- 参考文档templates/accessibility/screen-reader.md5.6 KB
- 参考文档templates/api/auth-headers.md4.7 KB
- 参考文档templates/api/error-responses.md5.4 KB
- 参考文档templates/api/graphql.md5.9 KB
- 参考文档templates/api/rate-limiting.md5.5 KB
- 参考文档templates/api/rest-crud.md5.0 KB
- 参考文档templates/auth/login.md4.6 KB
- 参考文档templates/auth/logout.md4.1 KB
- 参考文档templates/auth/mfa.md5.1 KB
- 参考文档templates/auth/password-reset.md5.7 KB
- 参考文档templates/auth/rbac.md4.7 KB
- 参考文档templates/auth/remember-me.md5.6 KB
- 参考文档templates/auth/session-timeout.md4.3 KB
- 参考文档templates/auth/sso.md4.5 KB
- 参考文档templates/checkout/add-to-cart.md4.1 KB
- 参考文档templates/checkout/apply-coupon.md5.0 KB
- 参考文档templates/checkout/order-confirm.md4.1 KB
- 参考文档templates/checkout/order-history.md4.6 KB
- 参考文档templates/checkout/payment.md5.4 KB
- 参考文档templates/checkout/update-quantity.md4.8 KB
- 参考文档templates/crud/bulk-operations.md5.2 KB
- 参考文档templates/crud/create.md4.7 KB
- 参考文档templates/crud/delete.md5.1 KB
- 参考文档templates/crud/read.md4.6 KB
- 参考文档templates/crud/soft-delete.md4.7 KB
- 参考文档templates/crud/update.md5.6 KB
- 参考文档templates/dashboard/chart-rendering.md4.9 KB
- 参考文档templates/dashboard/data-loading.md4.9 KB
- 参考文档templates/dashboard/date-range-filter.md5.5 KB
- 参考文档templates/dashboard/export.md5.7 KB
- 参考文档templates/dashboard/realtime-updates.md5.1 KB
- 参考文档templates/forms/autosave.md5.3 KB
- 参考文档templates/forms/conditional-fields.md5.6 KB
- 参考文档templates/forms/file-upload.md5.2 KB
- 参考文档templates/forms/multi-step.md5.5 KB
- 参考文档templates/forms/single-step.md4.8 KB
- 参考文档templates/forms/validation.md5.8 KB
- 参考文档templates/notifications/in-app.md4.8 KB
- 参考文档templates/notifications/notification-center.md4.7 KB
- 参考文档templates/notifications/toast-messages.md5.2 KB
- 参考文档templates/onboarding/email-verification.md5.0 KB
- 参考文档templates/onboarding/first-time-setup.md5.3 KB
- 参考文档templates/onboarding/registration.md5.7 KB
- 参考文档templates/onboarding/welcome-tour.md4.8 KB
- 参考文档templates/README.md4.8 KB
- 参考文档templates/search/basic-search.md4.4 KB
- 参考文档templates/search/empty-state.md4.5 KB
- 参考文档templates/search/filters.md5.1 KB
- 参考文档templates/search/pagination.md4.4 KB
- 参考文档templates/search/sorting.md5.1 KB
- 参考文档templates/settings/account-delete.md5.7 KB
- 参考文档templates/settings/notification-prefs.md5.2 KB
- 参考文档templates/settings/password-change.md6.9 KB
- 参考文档templates/settings/profile-update.md5.2 KB
03 SKILL.md 正文
Playwright Pro
Production-grade Playwright testing toolkit for AI coding agents.
Available Commands
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 <spec> |
Generate tests from user story, URL, or component |
/pw:review |
Review tests for anti-patterns and coverage gaps |
/pw:fix <test> |
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 |
Quick Start Workflow
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:
- After
/pw:generate— always run/pw:reviewbefore committing; it catches locator anti-patterns and missing assertions automatically. - After
/pw:fix— re-run the full suite locally (npx playwright test) to confirm the fix doesn't introduce regressions. - After
/pw:migrate— run/pw:coverageto confirm parity with the old suite before decommissioning Cypress/Selenium tests.
Example: Generate → Review → Fix
# 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()
Golden Rules
getByRole()over CSS/XPath — resilient to markup changes- Never
page.waitForTimeout()— use web-first assertions expect(locator)auto-retries;expect(await locator.textContent())does not- Isolate every test — no shared state between tests
baseURLin config — zero hardcoded URLs- Retries:
2in CI,0locally - Traces:
'on-first-retry'— rich debugging without slowdown - Fixtures over globals —
test.extend()for shared state - One behavior per test — multiple related assertions are fine
- Mock external services only — never mock your own app
Locator Priority
1. 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
What's Included
- 9 skills with detailed step-by-step instructions
- 3 specialized agents: test-architect, test-debugger, migration-planner
- 55 test templates: auth, CRUD, checkout, search, forms, dashboard, settings, onboarding, notifications, API, accessibility
- 2 MCP servers (TypeScript): TestRail and BrowserStack integrations
- Smart hooks: auto-validate test quality, auto-detect Playwright projects
- 6 reference docs: golden rules, locators, assertions, fixtures, pitfalls, flaky tests
- Migration guides: Cypress and Selenium mapping tables
Integration Setup
TestRail (Optional)
export TESTRAIL_URL="https://your-instance.testrail.io"
export TESTRAIL_USER="your@email.com"
export TESTRAIL_API_KEY="your-api-key"
BrowserStack (Optional)
export BROWSERSTACK_USERNAME="your-username"
export BROWSERSTACK_ACCESS_KEY="your-access-key"
Quick Reference
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 fixes
See templates/README.md for the full template index.
04 同仓库更多 Skills
zustand-store-ts
Create Zustand stores with TypeScript, subscribeWithSelector middleware, and proper state/action separation. Use when building React state management, creating global stores, or implementing reacti...
zoom-automation
Automate Zoom meeting creation, management, recordings, webinars, and participant tracking via Rube MCP (Composio). Always search tools first for current schemas.
zoho-crm-automation
Automate Zoho CRM tasks via Rube MCP (Composio): create/update records, search contacts, manage leads, and convert leads. Always search tools first for current schemas.
zod-validation-expert
Expert in Zod — TypeScript-first schema validation. Covers parsing, custom errors, refinements, type inference, and integration with React Hook Form, Next.js, and tRPC.
zeroize-audit
Detects missing zeroization of sensitive data in source code and identifies zeroization removed by compiler optimizations, with assembly-level analysis, and control-flow verification. Use for auditing C/C++/Rust code handling secrets, keys, passwords, or other sensitive data.
zendesk-automation
Automate Zendesk tasks via Rube MCP (Composio): tickets, users, organizations, replies. Always search tools first for current schemas.