Skip to content
Skillpedia
Testing29k Β· #9479

pw

What it does

This skill is a toolkit that routes browser testing requests to the right commands and templates. It is for developers and QA teams working with Playwright or other end-to-end browser tests.

When to use it

  • βœ“When you need to set up or write Playwright tests for a web app.
  • βœ“When you want to move tests from Cypress or Selenium into Playwright.
  • βœ“When you need to connect your browser tests with TestRail or BrowserStack.

Skill link

https://github.com/alirezarezvani/claude-skills/blob/main/engineering-team/playwright-pro/skills/pw/SKILL.md

Copy it and paste it into your AI (Claude, ChatGPT or Cursor), asking it to follow the instructions.

How to use

The easiest way: copy the message and paste it into your AI. It reads the skill and follows the instructions.

Ready-to-paste message

Use this skill to help me: https://github.com/alirezarezvani/claude-skills/blob/main/engineering-team/playwright-pro/skills/pw/SKILL.md Read the SKILL.md file at that link and follow its instructions for my task.
Want your AI to find skills like this on its own?Install the free Skillpedia MCP: one line, and it searches 15,000+ skills before each task.Install in 1 minute β†’

Example of what to ask your AI

β€œHelp me with Playwright testing for my web app, from setup through the first tests.”

5 new skills a week. 1 minute to read.

How it works

The skill lists its commands, such as setup, generate, review and fix. It suggests a sequence for most projects, starting with setup, then generating and reviewing tests.

Technical content (original SKILL.md)

Original text by the author, straight from GitHub.

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:pw-init Set up Playwright β€” detects framework, generates config, CI, first test
/pw:generate <spec> Generate tests from user story, URL, or component
/pw: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:pw-init          β†’ scaffolds config, CI pipeline, and a first smoke test
2. /pw:generate      β†’ generates tests from your spec or URL
3. /pw: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:pw-review before 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:coverage to 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: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

  1. getByRole() over CSS/XPath β€” resilient to markup changes
  2. Never page.waitForTimeout() β€” use web-first assertions
  3. expect(locator) auto-retries; expect(await locator.textContent()) does not
  4. Isolate every test β€” no shared state between tests
  5. baseURL in config β€” zero hardcoded URLs
  6. Retries: 2 in CI, 0 locally
  7. Traces: 'on-first-retry' β€” rich debugging without slowdown
  8. Fixtures over globals β€” test.extend() for shared state
  9. One behavior per test β€” multiple related assertions are fine
  10. 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 (optional β€” not auto-registered; see Integration Setup)
  • 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

Not auto-registered (issue #978). The TestRail and BrowserStack MCP servers are no longer declared in the plugin's .mcp.json (they failed to connect for every user β€” no bundled node_modules). Exporting the env vars below is not enough: /pw:testrail / /pw:browserstack fail with "tool not found" until you enable the server manually (cd integrations/<name>-mcp && npm install, then register it in your own user/project MCP config). See `CLAUDE.md

FAQ

What is the recommended order of steps?

Set up Playwright first, generate tests, review them before committing, and fix any failures when CI turns red.

Does it come with ready-made templates?

Yes. The skill mentions 55 templates covering patterns such as login, CRUD, checkout and search.

Does it need extra setup for TestRail or BrowserStack?

Yes. Those need their own environment settings and tool servers before they work.

Details

Original description by the author

Use for any Playwright or end-to-end browser testing work: writing tests, fixing flaky ones, migrating from Cypress or Selenium, CI setup, TestRail or BrowserStack. Routes to the matching /pw sub-skill and its 55 templates.

repo: alirezarezvani/claude-skills

Popularity

GitHub stars
29k
Ranking position
#9479
License
MIT
Updated
11/2/2026

Is this skill useful?

0

Sign in to vote.

Comments

  • …

More skills from this repository

Similar skills