Pipeline Stages

Parse

Extract structured data from Playwright trace.zip files.

The .parse() stage reads a Playwright trace archive and extracts all the data needed for video generation.

Basic usage

import { Recast } from 'playwright-recast'

const pipeline = Recast
  .from('./test-results/trace.zip')
  .parse()

You can also point to a directory containing trace files:

const pipeline = Recast
  .from('./test-results/')
  .parse()

What gets extracted

The parser reads the trace.zip and produces a structured representation containing:

DataSourceUsed by
ActionsUser interactions (click, fill, type, navigation)Speed processing, click effects, auto-zoom
ScreenshotsFrame-by-frame page capturesVideo frames
Network eventsAPI calls, resource loadingSpeed classification (network wait)
Cursor positionsMouse coordinates at each actionCursor overlay, click effects, auto-zoom
BDD step titlesplaywright-bdd Gherkin step namesSubtitle generation via .subtitlesFromTrace()

CLI equivalent

# Parse is implicit in CLI mode — it always runs
npx playwright-recast -i ./test-results/trace.zip -o demo.mp4

Tips

  • The trace file must be generated with Playwright's tracing enabled (--trace on or via playwright.config.ts).
  • .parse() should always be the first stage after .from(). Other stages depend on the parsed trace data.
  • Parsing is fast — the trace is read once and the structured data is passed through the pipeline.

On this page