Description
Part of #494.
Problem
Every per-action screenshot is stored twice in a trace zip. It is written once as a file under resources/, and again as base64 inside the frame-snapshot event in trace.trace: buildImageFrameSnapshots in packages/trace/src/trace-frame-snapshots.ts builds an HTML document around <img src="data:image/...;base64,..."> and writes resourceOverrides: [].
Measured on the WDIO cucumber example's trace (1.63 MB zip):
trace.traceis 538 KB zipped, of which 529 KB is the 12frame-snapshotevents.- Each event is 215 bytes of HTML around a 77 KB base64 copy of a screenshot already in
resources/. - Base64 is a third larger than the image and barely compresses (765 KB raw to 529 KB deflated).
Proposal
Reference the stored resource instead of inlining it: give the <img> a URL and map it to the resource's sha1 through resourceOverrides, which the format already defines for this.
The frame-snapshot events exist for other viewers that read the format (Playwright's trace viewer, Allure's embedded viewer); our player replays from trace.mutations. So the change must be verified in both of those viewers, not only ours.
Expected saving: about a third of a typical zip, with nothing lost.
Activity
vishnuv688 commentedon Oct 29, 2026
Implemented in #508 (stacked on #507). It closes this issue when it reaches
main.Store each action screenshot once in the trace zip