Repository navigation
Name trace screenshots by their actual image format - #513
Merged
Merged
Conversation
This was referenced Oct 30, 2026
Every screenshot resource was written as .jpeg, though WebDriver and the polling recorder capture PNG, so a viewer that takes the content type from the file name served a PNG as image/jpeg. The name now follows the bytes, for the per-action screenshots and the dense filmstrip alike, and the resource, filmstrip frame, frame-snapshot override and synthetic resource all take it from one function. The reader opens whatever name an event records, so zips written before this still open. Closes #505 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
vishnuv688
force-pushed
the
ci/496-trace-size-budget
branch
from
October 30, 2026 10:12
bd95ccb to
081e976
Compare
vishnuv688
force-pushed
the
fix/505-screenshot-extension
branch
from
October 30, 2026 10:12
7a751ea to
730a86d
Compare
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 #505. Part of #494. Stacked on #509.
Every screenshot in a trace zip was stored as
resources/<page>-<timestamp>.jpeg, though WebDriver screenshots and the polling recorder are PNG, so a viewer that takes the content type from the file name served a PNG asimage/jpeg. The name now follows the image's own format:.pngfor PNG,.jpegfor JPEG.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: no per-adapter behaviour changes.
Notes for reviewers
What changed
imageExtension(base64)insharednames a base64 image's format, from the same magic-byte check asimageMime.screenshotResourceNametakes the screenshot, so the resource file, the filmstrip frame, the frame-snapshot override and the synthetic resource from Store each action screenshot once in the trace zip #508 all get the same name from one function. When two captures share a timestamp, the snapshot index and the resource writer pick the same one, so a name and its file cannot disagree on format.<sha1>.jpeg, though polling mode and CDP withcaptureFormat: 'png'produce PNG); fixed the same way.Compatibility
show-traceand in the hosted player. A test writes a zip, renames the PNG back to.jpegin both the file andtrace.traceas an old zip had it, and checks the reader still returns the image.trace, so Python traces get the right names automatically.Testing
pnpm build,pnpm test(3302 passed) andpnpm lintare green..jpeg-named PNG zips still read.Not verified yet
wdio/TraceMode.mdstill says.jpeg; it is updated with the other docs-site changes once trace.webdriver.io is live.Screenshots / recordings
Not applicable: no UI change.
🤖 Generated with Claude Code