Skip to content

Comprehensive Playwright testing toolkit that generates, fixes, and migrates browser tests from Claude Code.

CCM score
62 of 100
version
2.14.6
GitHub stars
30.6K
View on GitHub

Own this plugin? Claim it

What it does

  • Adds /pw:generate, /pw:fix, /pw:migrate, and /pw:coverage, plus 3 agents (test-architect, test-debugger, migration-planner)
  • Covers test authoring, flaky-test diagnosis, CI setup via /pw:pw-init, and reporting across 55 parametrizable templates
  • Runs validate-test.sh on *.spec.ts files and detect-playwright.sh at session start to check test quality and project setup
  • Designed for teams moving from Cypress or Selenium; TestRail and BrowserStack integrations need manual MCP setup

Production-grade Playwright testing toolkit. 9 skills, 3 agents, 55 templates, plus optional (manually enabled) TestRail/BrowserStack integrations. Generate tests, fix flaky failures, migrate from Cypress/Selenium.

Add marketplace

/plugin marketplace add alirezarezvani/claude-skills

Run it inside Claude Code once, then install the plugin below.

Install

/plugin install pw@claude-code-skills

Run it inside Claude Code after adding the marketplace.

Files

Discovered from source

BrowserStack Integration

Run Playwright tests on BrowserStack's cloud grid for cross-browser and cross-device testing.

Prerequisites

Environment variables must be set:

  • BROWSERSTACK_USERNAME — your BrowserStack username
  • BROWSERSTACK_ACCESS_KEY — your access key

If not set, inform the user how to get them from browserstack.com/accounts/settings and stop.

The BrowserStack MCP server is not auto-registered (issue #978). pw-browserstack was removed from the plugin's .mcp.json because it failed to connect for every user (the plugin ships no node_modules). The browserstack_* MCP tools used below, and the /pw:browserstack command, will fail with "tool not found" until it is enabled manually — see the Integrations section of the plugin's CLAUDE.md (cd integrations/browserstack-mcp && npm install, then register the server in your own user/project MCP config). Setting the env vars alone is not sufficient.

Capabilities

1. Configure for BrowserStack

/pw:browserstack setup

Steps:

  1. Check current playwright.config.ts
  2. Add BrowserStack connect options:
// Add to playwright.config.ts
import { defineConfig } from '@playwright/test';

const isBS = !!process.env.BROWSERSTACK_USERNAME;

export default defineConfig({
  // ... existing config
  projects: isBS ? [
    {
      name: "chromelatestwindows-11",
      use: {
        connectOptions: {
          wsEndpoint: `wss://cdp.browserstack.com/playwright?caps=${encodeURIComponent(JSON.stringify({
            'browser': 'chrome',
            'browser_version': 'latest',
            'os': 'Windows',
            'os_version': '11',
            'browserstack.username': process.env.BROWSERSTACK_USERNAME,
            'browserstack.accessKey': process.env.BROWSERSTACK_ACCESS_KEY,
          }))}`,
        },
      },
    },
    {
      name: "firefoxlatestwindows-11",
      use: {
        connectOptions: {
          wsEndpoint: `wss://cdp.browserstack.com/playwright?caps=${encodeURIComponent(JSON.stringify({
            'browser': 'playwright-firefox',
            'browser_version': 'latest',
            'os': 'Windows',
            'os_version': '11',
            'browserstack.username': process.env.BROWSERSTACK_USERNAME,
            'browserstack.accessKey': process.env.BROWSERSTACK_ACCESS_KEY,
          }))}`,
        },
      },
    },
    {
      name: "webkitlatestos-x-ventura",
      use: {
        connectOptions: {
          wsEndpoint: `wss://cdp.browserstack.com/playwright?caps=${encodeURIComponent(JSON.stringify({
            'browser': 'playwright-webkit',
            'browser_version': 'latest',
            'os': 'OS X',
            'os_version': 'Ventura',
            'browserstack.username': process.env.BROWSERSTACK_USERNAME,
            'browserstack.accessKey': process.env.BROWSERSTACK_ACCESS_KEY,
          }))}`,
        },
      },
    },
  ] : [
    // ... local projects fallback
  ],
});
  1. Add npm script: "test:e2e:cloud": "npx playwright test --project='chrome@*' --project='firefox@*' --project='webkit@*'"

2. Run Tests on BrowserStack

/pw:browserstack run

Steps:

  1. Verify credentials are set
  2. Run tests with BrowserStack projects:
    BROWSERSTACK_USERNAME=$BROWSERSTACK_USERNAME \
    BROWSERSTACK_ACCESS_KEY=$BROWSERSTACK_ACCESS_KEY \
    npx playwright test --project='chrome@*' --project='firefox@*'
    
  3. Monitor execution
  4. Report results per browser

3. Get Build Results

/pw:browserstack results

Steps:

  1. Call browserstack_get_builds MCP tool
  2. Get latest build's sessions
  3. For each session:
    • Status (pass/fail)
    • Browser and OS
    • Duration
    • Video URL
    • Log URLs
  4. Format as summary table

4. Check Available Browsers

/pw:browserstack browsers

Steps:

  1. Call browserstack_get_browsers MCP tool
  2. Filter for Playwright-compatible browsers
  3. Display available browser/OS combinations

5. Local Testing

/pw:browserstack local

For testing localhost or staging behind firewall:

  1. Install BrowserStack Local: npm install -D browserstack-local
  2. Add local tunnel to config
  3. Provide setup instructions

MCP Tools Used

ToolWhen
browserstack_get_planCheck account limits
browserstack_get_browsersList available browsers
browserstack_get_buildsList recent builds
browserstack_get_sessionsGet sessions in a build
browserstack_get_sessionGet session details (video, logs)
browserstack_update_sessionMark pass/fail
browserstack_get_logsGet text/network logs

Output

  • Cross-browser test results table
  • Per-browser pass/fail status
  • Links to BrowserStack dashboard for video/screenshots
  • Any browser-specific failures highlighted

Readme

Playwright Pro

Production-grade Playwright testing toolkit for AI coding agents.

Generate tests, fix flaky failures, and migrate from Cypress/Selenium — all from your AI agent. Optional TestRail/BrowserStack integrations are included but must be enabled manually (see Integrations Setup).

Install

# Claude Code plugin
claude plugin install pw@claude-skills

# Or load directly
claude --plugin-dir ./engineering-team/playwright-pro

Commands

CommandWhat it does
/pw:pw-initSet up Playwright in your project — detects framework, generates config, CI, first test
/pw:generate <spec>Generate tests from a user story, URL, or component name
/pw:pw-reviewReview existing tests for anti-patterns and coverage gaps
/pw:fix <test>Diagnose and fix a failing or flaky test
/pw:migrateMigrate from Cypress or Selenium to Playwright
/pw:coverageAnalyze what's tested vs. what's missing
/pw:testrailSync with TestRail — read cases, push results, create runs (requires manual MCP setup — see Integrations Setup)
/pw:browserstackRun tests on BrowserStack, pull cross-browser reports (requires manual MCP setup — see Integrations Setup)
/pw:reportGenerate a test report in your preferred format

Quick Start

# In Claude Code:
/pw:pw-init                              # Set up Playwright
/pw:generate "user can log in"        # Generate your first test
# Tests are auto-validated by hooks — no extra steps

What's Inside

9 Skills

Slash commands that turn natural language into production-ready Playwright tests. Each skill leverages Claude Code's built-in capabilities (/batch for parallel work, Explore for codebase analysis, /debug for trace inspection).

3 Specialized Agents

  • test-architect — Plans test strategy for complex applications
  • test-debugger — Diagnoses flaky tests using a systematic taxonomy
  • migration-planner — Creates file-by-file migration plans from Cypress/Selenium

55 Test Templates

Ready-to-use, parametrizable templates covering:

CategoryCountExamples
Authentication8Login, logout, SSO, MFA, password reset, RBAC
CRUD6Create, read, update, delete, bulk ops
Checkout6Cart, payment, coupon, order history
Search5Basic search, filters, sorting, pagination
Forms6Multi-step, validation, file upload
Dashboard5Data loading, charts, export
Settings4Profile, password, notifications
Onboarding4Registration, email verify, welcome tour
Notifications3In-app, toast, notification center
API5REST CRUD, GraphQL, error handling
Accessibility3Keyboard nav, screen reader, contrast

2 MCP Integrations (optional — not auto-registered, see Integrations Setup)

  • TestRail — Read test cases, create runs, push pass/fail results
  • BrowserStack — Trigger cross-browser runs, pull session reports with video/screenshots

Smart Hooks

  • Auto-validates test quality when you write *.spec.ts files
  • Auto-detects Playwright projects on session start
  • Zero configuration required

Integrations Setup

Note (issue #978): the TestRail and BrowserStack MCP servers are not auto-registered — they were removed from the plugin's .mcp.json because they failed to connect for every user (no bundled node_modules). Setting the env vars below is not enough on its own; /pw:testrail and /pw:browserstack will 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 the Integrations section of CLAUDE.md.

TestRail (Optional)

Set environment variables:

export TESTRAIL_URL="https://your-instance.testrail.io"
export TESTRAIL_USER="your@email.com"
export TESTRAIL_API_KEY="your-api-key"

Then use /pw:testrail to sync test cases and push results.

BrowserStack (Optional)

export BROWSERSTACK_USERNAME="your-username"
export BROWSERSTACK_ACCESS_KEY="your-access-key"

Then use /pw:browserstack to run tests across browsers.

Works With

AgentHow
Claude CodeFull plugin — slash commands, MCP tools, hooks, agents
Codex CLICopy CLAUDE.md to your project root as AGENTS.md
OpenClawUse as a skill with SKILL.md entry point

Built-in Command Integration

Playwright Pro doesn't reinvent what your AI agent already does. It orchestrates built-in capabilities:

  • /pw:generate uses Claude's Explore subagent to understand your codebase before generating tests
  • /pw:migrate uses /batch for parallel file-by-file conversion on large test suites
  • /pw:fix uses /debug for trace analysis alongside Playwright-specific diagnostics
  • /pw:pw-review extends /review with Playwright anti-pattern detection

Reference

Based on battle-tested patterns from production test suites. Includes curated guidance on:

  • Locator strategies and priority hierarchy
  • Assertion patterns and auto-retry behavior
  • Fixture architecture and composition
  • Common pitfalls (top 20, ranked by frequency)
  • Flaky test diagnosis taxonomy

License

MIT

Details

Marketplace
alirezarezvani/claude-skills
Source
engineering-team/playwright-pro
Author
Alireza Rezvani
Category
Development
Keywords
playwright, testing, e2e, qa, test-automation, browserstack, testrail
Listed since
Apr 7, 2026

More from alirezarezvani/claude-skills

All 121

Similar to pw

More Testing & QA