playwright-pro
Production-grade Playwright testing toolkit. Generate tests, fix flaky failures, migrate from Cypress/Selenium, sync with TestRail, run on BrowserStack. 55 templates, 3 agents, smart reporting.
- License 许可
- MIT
- 最近更新
- 2026-03-08
- Stars
- ★ 2
- Forks
- 0
01 前言 Front Matter
- name
- playwright-pro
- description
- Production-grade Playwright testing toolkit. 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.json819 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 |
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
visa-doc-translate
Translate visa application documents (images) to English and create a bilingual PDF with original and translation
verification-loop
A comprehensive verification system for Claude Code sessions.
tdd-workflow
Use this skill when writing new features, fixing bugs, or refactoring code. Enforces test-driven development with 80%+ coverage including unit, integration, and E2E tests.
swiftui-patterns
SwiftUI architecture patterns, state management with @Observable, view composition, navigation, performance optimization, and modern iOS/macOS UI best practices.
swift-protocol-di-testing
Protocol-based dependency injection for testable Swift code — mock file system, network, and external APIs using focused protocols and Swift Testing.
swift-concurrency-6-2
Swift 6.2 Approachable Concurrency — single-threaded by default, @concurrent for explicit background offloading, isolated conformances for main actor types.