Repository navigation
Store each action screenshot once in the trace zip - #508
Merged
Merged
Conversation
This was referenced Oct 29, 2026
vishnuv688
added a commit
that referenced
this pull request
Oct 30, 2026
This branch's first CI run measured every example with #508's dedupe in place: WDIO 966,841 bytes, Selenium 158,349, Nightwatch 260,322 and Python 688,296. Each budget is that total plus 25%, so the saving cannot be undone without failing the job. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This was referenced Oct 30, 2026
Every per-action frame-snapshot carried its screenshot again as base64, beside the same image under resources/. On the WDIO cucumber example that was 529 KB of trace.trace's 538 KB. The snapshot's <img> now points at a URL that a resource override maps to the stored file, which takes that zip from 1.63 MB to 1.10 MB. The frame-snapshots exist for other viewers of the format. Playwright's viewer applies an override only to a resource recorded before the snapshot, so each image type gets one synthetic resource-snapshot at _monotonicTime -1. The URL is on a .invalid host, so a viewer without override support fetches nothing. Our own player replays from the mutation stream and never read these events. Closes #495 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
vishnuv688
force-pushed
the
perf/495-frame-snapshot-dedupe
branch
from
October 30, 2026 10:12
c5b36b2 to
e50c3b0
Compare
vishnuv688
added a commit
that referenced
this pull request
Oct 30, 2026
This branch's first CI run measured every example with #508's dedupe in place: WDIO 966,841 bytes, Selenium 158,349, Nightwatch 260,322 and Python 688,296. Each budget is that total plus 25%, so the saving cannot be undone without failing the job. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2 of 18 tasks
vishnuv688
added a commit
that referenced
this pull request
Nov 10, 2026
The fixtures only covered the format written before #508, where every frame-snapshot inlined its screenshot as base64. The writer the next npm release ships stores each screenshot once under resources/ and, since #533, stores the page's stylesheets and fonts behind a page-resources.ndjson index, so a reader change breaking either would pass the suite while breaking every trace from that release. One short smoke run per adapter from run 42769524119 is reduced into a fixture. The manifest now records the inline screenshot count, the entries frame-snapshots name as their screenshots and the stored page resources, all from raw entries, so the test checks that each named screenshot and each stylesheet and font resolves to the bytes it was stored with. The older manifests are regenerated with the new fields; their zips are unchanged. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
hoanle0126
pushed a commit
to hoanle0126/devtools
that referenced
this pull request
Nov 10, 2026
The upload step ran only on failure, so a green run left no trace zips, and new trace-format reader fixtures are taken from a green run's zips: after webdriverio#508 and webdriverio#533 changed the format there was no artifact to build them from. The artifact is now kept for 7 days on every run. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What & why
Closes #495. Part of #494. Stacked on #507.
Every per-action
frame-snapshotevent carried its screenshot again as base64, inside an HTML page wrapped around an<img>, while the same screenshot was already stored underresources/. On the WDIO cucumber example trace that was 529 KB oftrace.trace's 538 KB zipped. The snapshot's<img>now points at a URL that the snapshot'sresourceOverridesmaps to the stored file, so each screenshot is stored once.Type of change
Packages touched
shared(types and contracts)core(framework-agnostic capture/reporting)elements(published element/snapshot API —@wdio/elements)service(WebdriverIO adapter)nightwatch-devtools(Nightwatch adapter)selenium-devtools(Selenium adapter)selenium-devtools-py(Selenium Python adapter)backend(server)app(UI)script(page-injected runtime)trace(Trace mode)Capability matrix
packages/conformance/src/features.tsupdated, and tables regenerated withpnpm docs:capabilities, if this adds or changes user-facing behaviourNot needed: traces open and replay as before; only their size changes.
Notes for reviewers
Measured
trace.tracezippedRebuilt from the same capture with the old and new code; the old-code rebuild was byte-identical to the original zip.
Design notes
<img>points athttps://screenshot.wdio-devtools.invalid/action.<png|jpeg>. One function now names the screenshot file for the writer, the filmstrip and the override, so they cannot drift apart.snapshotRenderer.tsresourceByUrl: the loop stops at a resource with_monotonicTime >= snapshot.timestamp, and the override is applied onlyif (result && GET)). So each image type gets one syntheticresource-snapshotat_monotonicTime: -1..invalidhost never resolves (RFC 6761), so a viewer without override support fetches nothing.core: this is trace-format writing, which lives intrace; no adapter changes.Testing
pnpm build,pnpm test(3290 passed) andpnpm lintare green; no workspace import leaks in the adapter or backend bundles.data:or base64 in frame-snapshot events; every override and resource response names a file that exists in a real exported zip; our reader round-trips commands, filmstrip and a11y text unchanged and lists no synthetic request in the Network tab.Not verified yet
npx playwright show-trace) and in Allure 2.35+, stepping through actions to confirm each shows its own screenshot. This needs a browser.action.pngrequest once per image type. Our Network tab does not.Screenshots / recordings
Not applicable: no UI change in our player. Screenshots from Playwright's viewer and Allure belong here once the check above is done.
🤖 Generated with Claude Code