Command Palette

Search for a command to run...

UnylyUnyly
Назад к скиллам

playwright-recording-processor

БесплатноБез исполняемых скриптовНе проверен

Transforms raw Playwright codegen recordings into production-ready E2E tests through trimming, classification, and assertion injection. Use when processing…

Jeffallanот Jeffallan★ 12 571 звезда на GitHub

Об этом скилле

Playwright Recording Processor

Recording processing specialist that converts raw Playwright codegen output into structured, maintainable E2E tests.

Core Workflow

  1. Trim — Cut the raw recording at the exact marker URL path, discarding pre-feature navigation (via scripts/trim-recording.ts saved from references/trim-recording.md or manual inline steps)
  2. Classify — Determine flow type: happy path (feature coverage) or bug reproduction (diagnostic capture)
  3. Swap fixtures — Replace raw page references with custom fixtures (e.g. authenticatedPage from e2e/fixtures.ts); update imports to load test from the project's fixture file
  4. Harden — Replace brittle selectors with role-based locators (cross-ref playwright-expert)
  5. Assert — Inject assertions appropriate to flow type: checkpoint verification (happy path) or expected-outcome assertion with diagnostic capture in finally and screenshot capture in test.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

  1. Raw recording file — the .spec.ts output from npx playwright codegen
  2. Marker URL — the path where the feature under test begins (e.g. /invoices/export)
  3. Flow type — happy path or bug reproduction
  4. Auth fixture name and import path — e.g. authenticatedPage from ./fixtures for a spec in e2e/; a spec in integration/ needs the path from there to e2e/fixtures.ts
  5. Output target — e2e/ or integration/ 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-expert patterns when hardening
  • In bug repro flows, assert the expected behavior and attach diagnostic-report in a finally block (capturing failure screenshots via test.afterEach)
  • Import test from 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 baseURL is configured; use relative paths for URLs from marker URL onwards

MUST NOT DO

  • Process untrimmed recordings (pre-fea
Полный SKILL.md на GitHub

Установить playwright-recording-processor в Claude Code и Claude Desktop

Зарегайся, чтобы установить скилл

Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.

  • Открой команду установки в одну строку
  • Сохраняй скиллы в синхронизируемую библиотеку
  • Уведомления, когда скиллы обновляются
Зарегаться бесплатноУ меня уже есть аккаунт

Разрешённые инструменты

Инструменты, которые скиллу разрешено вызывать.

Без ограничений — скилл может использовать любой инструмент.

Вложенные файлы

references/assertion-patterns.mdreferences/bug-repro-diagnostics.mdreferences/trim-recording.md

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), без исполняемых скриптов.

Похожие скиллы

Сравнить playwright-recording-processor с