Playwright Recording Processor
Unsigned, install at your own risk
UnverifiedThis skill has no cryptographic signature attached. We can't verify the contents match what the publisher intended.
Install this skill
No account required. Pick your tool, then copy.
Run in your terminal. It detects your AI tool.
npx @skills-hub-ai/cli install jeffallan-skills-playwright-recording-processorWhat this does: 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.
Manual setup by platform
Claude Code
~/.claude/skills/jeffallan-skills-playwright-recording-processor/SKILL.md
Instructions
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-feature navigation noise pollutes tests)
- Add multi-step feature verification assertions to bug repro tests (only assert the single reported failure point)
- Generate tests without assertion injection (both happy-path and bug-repro tests require assertions)
- Duplicate locator/POM patterns already covered by
playwright-expert - Use
waitForTimeout()in generated tests (replace with auto-waiting web assertions or waitForURL)
Output File Placement
e2e/: Full journeys crossing multiple pages or system boundariesintegration/: Scoped to feature area; bug repros usually land hererecordings/: Archive only — raw files are never run directly
Checklist Before Handing Off
- Trimmed to exact marker URL path — no auth or pre-feature navigation
- Auth fixture swapped in and imported from project fixture file
- All locators are semantic (role, label, text) not positional
- Assertions added: checkpoint assertions (happy path) or expected-behavior assertion (bug repro)
- Diagnostic collection attached in
finallyblock underdiagnostic-report(bug repro) and failure screenshots captured viatest.afterEach - Any
waitForTimeout()calls removed and replaced with auto-waiting assertions - Source recording comment added at top of test
- Tagged correctly (
@happy-pathor@bug-repro) - Placed in correct output directory
- Raw recording archived untouched in
recordings/
Documentation
Security
Reviews (0)
Related skills
Browse all →More from Jeffallan Skills
View source →More Build skills
Browse category →Frequently asked questions about playwright-recording-processor
What does the playwright-recording-processor skill do?
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. It's a reusable SKILL.md instruction set that loads into your AI coding assistant on demand, no prompt engineering, no copy-pasting every session.
How do I install the playwright-recording-processor skill?
Run `npx @skills-hub-ai/cli install jeffallan-skills-playwright-recording-processor` from your terminal. The CLI writes the SKILL.md to the correct location for your AI tool (e.g. ~/.claude/skills/jeffallan-skills-playwright-recording-processor/ for Claude Code or ~/.cursor/skills/ for Cursor with --target cursor) and adds it to your project's .skills.json lockfile.
Which AI tools does playwright-recording-processor work with?
playwright-recording-processor runs in Claude Code. It follows the open Agent Skills standard (SKILL.md), so the same skill works in every supported tool without modification.
Is the playwright-recording-processor skill free?
Yes. Every skill on skills-hub.ai is free and open-source. There are no premium tiers, paywalls, or usage limits. You only pay for whatever AI assistant you're already using.
How do I use playwright-recording-processor after installing it?
In Claude Code, type `/jeffallan-skills-playwright-recording-processor` (or whatever slash command the skill registers) and the AI follows the skill's instructions immediately. You can also reference it by name in natural language, your AI loads the skill into context when relevant.
Can I share the playwright-recording-processor skill with my team?
Yes. Commit your project's .skills.json lockfile and teammates run `npx @skills-hub-ai/cli install` (no args) to install every skill at the exact version you pinned. Organization-scoped installs work via skills-hub.ai organizations.