Repository navigation
Description
Version
1.62.1
Steps to reproduce
- Clone https://github.com/bdcarr/playwright-trace-clamps-screencast
npm installnpm run test
The same spec runs under two projects, one with trace: 'off' and one with trace: 'on'.
It records an entirely magenta page with:
await page.screencast.start({ path, size: { width: 1260, height: 710 } });
with a viewport of 1680x946.
- Open the two videos under test-results/:
- ...-trace-off/video.webm -> magenta fills the whole 1260x710 frame
- ...-trace-on/video.webm -> magenta occupies only the top-left 798x450; the rest is grey
Since the page is a solid colour, any grey area is padding.
Expected behavior
With size passed to screencast.start(), the page should be scaled to fill the 1260x710 video
frame, regardless of whether tracing is enabled. This is what happens with trace: 'off', and what
context-level recordVideo: { size } does in both cases.
Actual behavior
With tracing enabled, the video is produced at the requested 1260x710 frame size, but the page is
captured at 800x450 and placed in the top-left corner, with the remaining ~60% of the frame filled
with grey.
Additional context
800x450 is the 1680x946 viewport scaled to fit inside 800x600 — the hardcoded kScreencastOptions
used for trace screenshots. It appears the trace screencast and page.screencast share one
underlying capture, the smaller (trace) size wins, and size then only sets the output frame rather
than scaling the capture into it.
| path | trace: 'off' |
trace: 'on' |
|---|---|---|
page.screencast.start({ size: 1260x710 }) |
1260x710, fills frame | 1260x710 frame, page only 798x450, rest grey |
page.screencast.start() (no size) |
800x450, fills frame | 800x450, fills frame |
recordVideo: { size: 1260x710 } |
1260x710, fills frame | 1260x710, fills frame |
So recordVideo is unaffected; only page.screencast is clamped.
There is no workaround while tracing is on, since the trace screencast size is not configurable —
the only way to get a full-resolution screencast is to disable tracing.
Environment
System:
OS: macOS 26.5.2
CPU: (12) arm64 Apple M2 Pro
Memory: 112.50 MB / 32.00 GB
Binaries:
Node: 24.17.0 - /Users/brycecarr/.local/state/fnm_multishells/34850_1771991381004/bin/node
npm: 11.13.0 - /Users/brycecarr/.local/state/fnm_multishells/34850_1771991381004/bin/npm
pnpm: 10.8.1 - /Users/brycecarr/Library/pnpm/pnpm
IDEs:
VSCode: 1.133.0 - /usr/local/bin/code
Claude Code: 2.1.215 - /Users/brycecarr/.local/bin/claude
Codex: 0.145.0 - /opt/homebrew/bin/codex
Languages:
Bash: 5.3.15 - /opt/homebrew/bin/bash
Activity
bdcarr commentedon Oct 9, 2026
Yury Semikhatsky (@yury-s) hello, I see the fix was reverted. Should this issue be reopened?