@tracelane/report
v0.1.0-alpha.18
Published
Self-contained, offline HTML report builder for tracelane. Embeds the rrweb player and a gzipped event blob into a single .html file.
Maintainers
Readme
@tracelane/report
The reporter for your WebdriverIO tests — Playwright and Cypress on the roadmap. Self-contained HTML for every run — replay failures, audit successes, attach to any bug tracker. No SaaS, no dashboard, no signup.
The self-contained, offline HTML report builder for tracelane. Given a captured rrweb event stream plus test metadata, it produces a single .html file that:
- opens in any browser, fully offline (no network fetch at view time);
- embeds the
rrweb-playerUMD + CSS inline; - embeds the events as a gzipped, base64-encoded blob that is decompressed in-page with an inlined
fflategunzip; - renders console + network panels, a metadata header, and a "Copy as Markdown for AI paste" button.
Not generally intended for direct consumption — depend on a product package (@tracelane/wdio) instead. See the @tracelane/wdio README for the integration guide.
Usage
import { buildReport } from '@tracelane/report';
const html = buildReport(events, {
spec: 'login.spec.ts',
title: 'logs in with valid credentials',
status: 'failed',
error: 'expected element to be visible',
durationMs: 4210,
browserName: 'chrome',
browserVersion: '124.0',
viewport: { width: 1280, height: 720 },
// commitSha / buildUrl auto-detected from CI env when omitted
});
// write `html` to ./tracelane-reports/<spec>--<title>.htmlDesign
- Player:
[email protected](upstream).@posthog/rrweb-playerwas the natural lineage match for the@cubenest/rrweb-coresubstrate fork, but every published version pins an unpublished dependency (@posthog/[email protected], 404) and is therefore uninstallable. Upstreamrrweb-playerdescends from the same rrweb 2.x line (2.0.0-alpha.x) that the substrate's@posthog/[email protected]was forked from (2.0.0-alpha.17), so the recorded event shape replays correctly. - Decompression: the build side uses
@cubenest/rrweb-core'scompress()(fflate gzip); the view side inlines fflate's browsergunzipSyncfor a small (~8 KB) offline decompressor. - Asset inlining: the player UMD/CSS and the fflate gunzip source are read from
node_modulesat build time (fs.readFileSync) — never hand-pasted into source.
License
Apache 2.0. The inlined rrweb player and fflate remain MIT-licensed; see NOTICE.
