playwright-recording-processor
БесплатноБез исполняемых скриптовНе проверенTransforms raw Playwright codegen recordings into production-ready E2E tests through trimming, classification, and assertion injection. Use when processing…
от Jeffallan★ 12 571 звезда на GitHubОб этом скилле
Playwright Recording Processor
Recording processing specialist that converts raw Playwright codegen output into structured, maintainable E2E tests.
Core Workflow
- Trim — Cut the raw recording at the exact marker URL path, discarding pre-feature navigation (via
scripts/trim-recording.tssaved fromreferences/trim-recording.mdor manual inline steps) - Classify — Determine flow type: happy path (feature coverage) or bug reproduction (diagnostic capture)
- Swap fixtures — Replace raw
pagereferences with custom fixtures (e.g.authenticatedPagefrome2e/fixtures.ts); update imports to loadtestfrom the project's fixture file - Harden — Replace brittle selectors with role-based locators (cross-ref
playwright-expert) - Assert — Inject assertions appropriate to flow type: checkpoint verification (happy path) or expected-outcome assertion with diagnostic capture in
finallyand screenshot capture intest.afterEach(bug repro)
Quick-Start Example
Transform raw recorded actions into an assertion-rich test using the auth fixture (assumes baseURL in playwright.config.ts):
// ❌ Raw recording (untrimmed with manual auth, hardcoded URL, no assertions)
// await page.goto('https://app.example.com/login');
// await page.getByLabel('Email').fill('[email protected]');
// await page.getByRole('button', { name: 'Sign in' }).click();
// await page.goto('https://app.example.com/invoices/export');
// await page.getByRole('button', { name: 'Download' }).click();
// ✅ Processed test (trimmed to marker URL, custom fixture, assertions added)
import { test, expect } from './fixtures';
// Source recording: recordings/raw-session-20240315.spec.ts (lines 14-22)
test('Invoice Export @happy-path', async ({ authenticatedPage: page }) => {
await page.goto('/invoices/export');
await expect(page.getByRole('heading', { name: 'Export' })).toBeVisible();
const downloadPromise = page.waitForEvent('download');
await page.getByRole('button', { name: 'Download' }).click();
const download = await downloadPromise;
expect(download.suggestedFilename()).toMatch(/\.csv$/);
});
Inputs Required
- Raw recording file — the
.spec.tsoutput fromnpx playwright codegen - Marker URL — the path where the feature under test begins (e.g.
/invoices/export) - Flow type — happy path or bug reproduction
- Auth fixture name and import path — e.g.
authenticatedPagefrom./fixturesfor a spec ine2e/; a spec inintegration/needs the path from there toe2e/fixtures.ts - Output target —
e2e/orintegration/depending on scope
If any of these are missing, ask before proceeding.
Flow Classification
Happy Path Flow
Use when:
- Testing a new feature for the first time
- Adding coverage for a release
- Tester followed a structured checklist
Output: A clean spec with the full user journey from marker URL to completion, using the existing auth fixture, with assertions added at key checkpoints.
Bug Reproduction Flow
Use when:
- A nontechnical user reported "the app broke"
- You need to capture what they actually did, in what state, on what browser
- The goal is a reproducible failing test to anchor a fix
Output: A spec that asserts the expected behavior (failing while bug is present) and captures full runtime diagnostic metadata (diagnostic-report) in a finally block (with failure screenshots captured via test.afterEach hook) so timeouts never lose diagnostics.
Reference Guide
Load detailed guidance based on context:
| Topic | Reference | Load When |
|---|---|---|
| Assertion Patterns | references/assertion-patterns.md |
Adding assertions by UI element type |
| Trim Recording | references/trim-recording.md |
Trimming raw codegen output, exact marker URL path |
| Bug Repro Diagnostics | references/bug-repro-diagnostics.md |
Diagnostic injection, console/network/state capture |
Cross-References (from playwright-expert, not duplicated)
- For locator hardening patterns, see
playwright-expert(selectors-locators.md) - For Page Object Model and fixture patterns, see
playwright-expert(page-object-model.md) - For debugging flaky processed tests, see
playwright-expert(debugging-flaky.md)
Constraints
MUST DO
- Always trim to the exact marker URL pathname before processing
- Classify every recording before adding assertions
- Use role-based selectors from
playwright-expertpatterns when hardening - In bug repro flows, assert the expected behavior and attach
diagnostic-reportin afinallyblock (capturing failure screenshots viatest.afterEach) - Import
testfrom the project's fixture file when custom fixtures are swapped in - Annotate generated tests with source recording comments:
// Source recording: recordings/<name>.spec.ts (lines X-Y) - Assume
baseURLis configured; use relative paths for URLs from marker URL onwards
MUST NOT DO
- Process untrimmed recordings (pre-fea
Установить playwright-recording-processor в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
Вложенные файлы
FAQ
Что делает скилл playwright-recording-processor?
Transforms raw Playwright codegen recordings into production-ready E2E tests through trimming, classification, and assertion injection. Use when processing codegen session recordings, trimming recorded browser sessions to a marker URL, classifying recordings as happy-path or bug-repro flows, or injecting diagnostic capture into reproduction tests. Invoke to convert a raw codegen recording into a maintainable test file or to build a bug reproduction test with console/network/state diagnostics.
Как установить скилл playwright-recording-processor?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл playwright-recording-processor запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
mcp-builder
Guide for creating high-quality MCP (Model Context Protocol) servers that enable LLMs to interact with external services through well-designed tools. Use when…
от Anthropicclaude-api
Reference for the Claude API / Anthropic SDK — model ids, pricing, params, streaming, tool use, MCP, agents, caching, token counting, model migration. TRIGGER…
от Anthropicalgorithmic-art
Creating algorithmic art using p5.js with seeded randomness and interactive parameter exploration. Use this when users request creating art using code…
от Anthropicmcp-integration
This skill should be used when the user asks to "add MCP server", "integrate MCP", "configure MCP in plugin", "use .mcp.json", "set up Model Context…
от Anthropic