pw — плагин для Claude Code: тесты Playwright и миграция
Набор слэш-команд, агентов и шаблонов для тестов на Playwright: генерация из описания, починка флаки, переезд с Cypress или Selenium.
/plugin marketplace add alirezarezvani/claude-skills
/plugin install pw@claude-code-skills
/plugin marketplace add anthropics/claude-plugins-community
/plugin install playwright-pro@claude-communityЧто делает pw
Плагин pw ставит в Claude девять скиллов, которые превращают обычную фразу в готовый тест Playwright. /pw:generate принимает пользовательскую историю, URL или имя компонента и собирает спеку, а /pw:pw-init разбирает проект, находит фреймворк и раскладывает конфиг с CI и первым тестом. Для разбора уже написанного есть /pw:pw-review и /pw:coverage.
Внутри три субагента: test-architect планирует стратегию для сложных приложений, test-debugger ищет причину нестабильности по таксономии флаки, migration-planner расписывает переезд с Cypress или Selenium по файлам. Плюс 55 шаблонов — авторизация, CRUD, оформление заказа, поиск, формы, дашборды, API, доступность. Хуки сами проверяют качество, когда вы пишете *.spec.ts, и находят Playwright-проекты при старте сессии.
Интеграции с TestRail и BrowserStack в комплект входят, но не регистрируются автоматически: их убрали из .mcp.json, потому что серверы не подключались ни у кого без своих node_modules. Одних переменных окружения мало — /pw:testrail и /pw:browserstack ответят «tool not found», пока вы не зайдёте в integrations/<name>-mcp, не выполните npm install и не пропишете сервер в своём MCP-конфиге. Это стоит держать в голове до того, как обещать команде синк с TestRail.
Какие задачи решает
- сгенерировать e2e-тест из пользовательской истории
- разобрать проект и поднять в нём Playwright с CI
- найти причину нестабильного теста и починить его
- проверить существующие спеки на антипаттерны и пробелы в покрытии
- перевести тесты с Cypress или Selenium на Playwright
Примеры запросов агенту
- /pw:pw-init
- /pw:generate "пользователь может войти в аккаунт"
- /pw:fix checkout.spec.ts
Как установить pw
Через маркетплейс плагинов
/plugin marketplace add alirezarezvani/claude-skills/plugin install pw@claude-code-skills/plugin marketplace add anthropics/claude-plugins-community/plugin install playwright-pro@claude-communityПо шагам, с командами для каждой платформы: Плагины Claude Code: маркетплейсы, установка и как собрать свой
Вопросы о pw
Как установить pw в Claude?
Через маркетплейс: сначала /plugin marketplace add alirezarezvani/claude-skills, затем /plugin install pw@claude-code-skills. После этого команды /pw:* доступны в сессии.
Что делает pw?
Генерирует тесты Playwright из описания, чинит падающие и флаки-тесты, проверяет покрытие и помогает переехать с Cypress или Selenium. Внутри девять скиллов, три субагента и 55 шаблонов.
Почему /pw:testrail не находит инструмент?
MCP-серверы TestRail и BrowserStack не регистрируются автоматически. Нужно зайти в integrations/<name>-mcp, выполнить npm install и добавить сервер в свой MCP-конфиг — переменных окружения самих по себе не хватит.
Исходный текст
playwright-pro · MIT
# 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](#integrations-setup)). ## Install ```bash # Claude Code plugin claude plugin install pw@claude-skills # Or load directly claude --plugin-dir ./engineering-team/playwright-pro ``` ## Commands | Command | What it does | |---|---| | `/pw:pw-init` | Set 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-review` | Review existing tests for anti-patterns and coverage gaps | | `/pw:fix <test>` | Diagnose and fix a failing or flaky test | | `/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, create runs *(requires manual MCP setup — see [Integrations Setup](#integrations-setup))* | | `/pw:browserstack` | Run tests on BrowserStack, pull cross-browser reports *(requires manual MCP setup — see [Integrations Setup](#integrations-setup))* | | `/pw:report` | Generate a test report in your preferred format | ## Quick Start ```bash # 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: | Category | Count | Examples | |---|---|---| | Authentication | 8 | Login, logout, SSO, MFA, password reset, RBAC | | CRUD | 6 | Create, read, update, delete, bulk ops | | Checkout | 6 | Cart, payment, coupon, order history | | Search | 5 | Basic search, filters, sorting, pagination | | Forms | 6 | Multi-step, validation, file upload | | Dashboard | 5 | Data loading, charts, export | | Settings | 4 | Profile, password, notifications | | Onboarding | 4 | Registration, email verify, welcome tour | | Notifications | 3 | In-app, toast, notification center | | API | 5 | REST CRUD, GraphQL, error handling | | Accessibility | 3 | Keyboard nav, screen reader, contrast | ### 2 MCP Integrations (optional — not auto-registered, see [Integrations Setup](#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: ```bash export TESTRAIL_URL="https://your-instance.testrail.io" export TESTRAIL_USER="[email protected]" export TESTRAIL_API_KEY="your-api-key" ``` Then use `/pw:testrail` to sync test cases and push results. ### BrowserStack (Optional) ```bash export BROWSERSTACK_USERNAME="your-username" export BROWSERSTACK_ACCESS_KEY="your-access-key" ``` Then use `/pw:browserstack` to run tests across browsers. ## Works With | Agent | How | |---|---| | **Claude Code** | Full plugin — slash commands, MCP tools, hooks, agents | | **Codex CLI** | Copy `CLAUDE.md` to your project root as `AGENTS.md` | | **OpenClaw** | Use 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
© Alireza Rezvani · MIT · alirezarezvani/claude-skills