You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit e50c3b0
Browse filesBrowse the repository at this point in the historyBrowse files
Store each action screenshot once in the trace zip
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>
A trace zip stores each action screenshot once. The `frame-snapshot` event for an action used to carry its screenshot again as base64 inside the page it describes, beside the same screenshot under `resources/`; it now references that file through `resourceOverrides`, which a trace viewer resolves to the stored image. On a WebdriverIO cucumber example trace this takes the zip from 1.63 MB to 1.10 MB and `trace.trace` from 538 KB to 5 KB. The DevTools trace player reads such a zip as before.
Copy file name to clipboardExpand all lines: ARCHITECTURE.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -64,7 +64,7 @@ Contains:
64
64
-`writeTraceZip` / `buildTraceZip` — the zip writer and its resource model (`TraceZipResource`).
65
65
-`buildActionEvents`: commands → the ordered before/after event stream the player replays, including the `(startTime, sequence, index)` ordering key, with a row's children written inside its span under its callId.
66
66
-`buildGroupPath` — the suite/test/step hierarchy a row is nested under.
-`buildImageFrameSnapshots`+ `buildScreenshotResourceSnapshots`/ `upsertRichestSnapshot` / `buildDenseScreencast` / `thinScreencastFrames` — filmstrip and per-action frame snapshots (each a page whose image is the stored screenshot, reached through a `resourceOverrides` entry and the one recorded response it patches).
68
68
-`buildMutationsNdjson` / `reattributeDomAnchors` — the DOM mutation stream and its anchor repositioning.
-`parseTraceZip` (`trace-reader.ts` and its `trace-reader-*` siblings) — the reverse direction: a `trace.zip`, ours or a foreign one, back into the `TracePlayerData` the player renders. Imported by subpath (`@wdio/devtools-trace/trace-reader`) and kept out of the package index, so adapters that reach `trace` through `core` never inline it. It reaches no Node built-in, because the hosted player runs it in the browser (`tests/trace-reader-browser-safe.test.ts` walks its imports); the disk read is `readTraceZip` in `read-trace-zip.ts`, and source paths are hashed with the pure `portableSha1Hex` so the reader needs no `node:crypto`; resource bytes keep native `sha1Hex`, ~30x faster.
Copy file name to clipboardExpand all lines: README.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -223,7 +223,7 @@ In trace mode no DevTools UI window opens. At session end the adapter writes tra
223
223
|**Python**|`pytest --devtools-trace`, or `devtools.enable(trace=True)` in a plain script |
224
224
225
225
The trace artifact contains:
226
-
-`trace.trace` — NDJSON `context-options` + `before`/`after` action events. When test hooks are available (Mocha's `it()` / Cucumber's `Scenario()`), each test becomes a `Tracing.tracingGroup` span — an open/close `before`/`after` pair with `method: "tracingGroup"` and `params.name` set to the test title. Child actions inside the group carry `parentId` pointing back to the group's `callId`, so timeline viewers render tests as labelled spans wrapping their commands.
226
+
-`trace.trace` — NDJSON `context-options` + `before`/`after` action events. When test hooks are available (Mocha's `it()` / Cucumber's `Scenario()`), each test becomes a `Tracing.tracingGroup` span — an open/close `before`/`after` pair with `method: "tracingGroup"` and `params.name` set to the test title. Child actions inside the group carry `parentId` pointing back to the group's `callId`, so timeline viewers render tests as labelled spans wrapping their commands. For viewers that render a DOM snapshot per action, it also carries one `frame-snapshot` event per action: a page holding just that action's screenshot. The image is not stored a second time: its `src` is a placeholder `https://screenshot.wdio-devtools.invalid/` address, which the event's `resourceOverrides` maps to the screenshot's file under `resources/`.
227
227
-`trace.network` — HAR-style network entries derived from the existing capture
228
228
-`resources/page@<id>-<ts>.jpeg` — screenshot per user-facing action
229
229
-`resources/page@<id>-<ts>-elements.json` — flat interactable element list extracted by the page-injected scripts in `@wdio/devtools-core/element-scripts`
0 commit comments