@flakeytesting/playwright-snapshots
v0.9.0
Published
Extracts command logs and DOM snapshots from Playwright trace files for Flakey
Maintainers
Readme
@flakeytesting/playwright-snapshots
Internal helper used by @flakeytesting/playwright-reporter. Parses Playwright .zip trace files to extract DOM snapshots and command logs that the Flakey dashboard renders as a step-by-step scrubber.
Install
You don't install this package directly. It's a dependency of @flakeytesting/playwright-reporter — the reporter pulls it in automatically when Playwright produces trace attachments. Adding it to your own devDependencies is unnecessary.
If you're building tooling on top of trace files and want the same parsing logic:
pnpm add -D @flakeytesting/playwright-snapshotsHow it works
Playwright produces a trace.zip per test when trace: 'on' (or on-first-retry) is set in playwright.config.ts. This package:
- Reads the
.zipentries that hold the network log, action log, and per-step DOM snapshots. - Converts them into the
SnapshotBundleshape the Flakey dashboard expects — one entry per command step with HTML, viewport, scroll position, and command name. - Hands the bundle back to
@flakeytesting/playwright-reporter, which uploads it alongside the run.
End-to-end consumers should enable Playwright tracing and call the reporter — there's no separate API to learn here.
When you'd want it directly
- You're writing a different test reporter / dashboard and want to reuse the trace-parsing logic.
- You're debugging trace contents from the command line and want a programmatic shape.
For both, the exported parseTrace(filePath: string): Promise<SnapshotBundle> is the entry point.
Compatibility
- Playwright: any version that produces v1.30+ trace format
- Node: 20+
Links
- Documentation site
- Source + issues
- License: MIT
