Skip to content

Trace: stop storing each action screenshot twice #495

Closed

Description

@vishnuv688

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.trace is 538 KB zipped, of which 529 KB is the 12 frame-snapshot events.
  • 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

  1. self-assigned this
    on Oct 29, 2026
  2. vishnuv688 commented on Oct 29, 2026

    @vishnuv688
    MemberAuthor

    Implemented in #508 (stacked on #507). It closes this issue when it reaches main.

  3. added a commit that references this issue on Oct 30, 2026
    e50c3b0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions