Loading...
Loading...
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.
npx skill4agent add alirezarezvani/claude-skills playwright-pro/pw:| Command | What it does |
|---|---|
| Set up Playwright — detects framework, generates config, CI, first test |
| Generate tests from user story, URL, or component |
| Review tests for anti-patterns and coverage gaps |
| Diagnose and fix failing or flaky tests |
| Migrate from Cypress or Selenium to Playwright |
| Analyze what's tested vs. what's missing |
| Sync with TestRail — read cases, push results |
| Run on BrowserStack, pull cross-browser reports |
| Generate test report in your preferred format |
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/pw:generate/pw:review/pw:fixnpx playwright test/pw:migrate/pw:coverage# 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()page.waitForTimeout()expect(locator)expect(await locator.textContent())baseURL20'on-first-retry'test.extend()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 resortexport TESTRAIL_URL="https://your-instance.testrail.io"
export TESTRAIL_USER="your@email.com"
export TESTRAIL_API_KEY="your-api-key"export BROWSERSTACK_USERNAME="your-username"
export BROWSERSTACK_ACCESS_KEY="your-access-key"reference/golden-rules.mdlocators.mdassertions.mdfixtures.mdcommon-pitfalls.mdflaky-tests.mdtemplates/README.md