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
[Bug]: test runner silently drops the 'screen' key of device descriptors #42679
Control: test.use({ contextOptions: { screen: { width: 390, height: 844 } } }) produces the correct window.screen — the machinery under the runner supports it; only the option plumbing is missing.
Expected behavior
test.use({ ...devices[...] }) forwards all descriptor keys. Six of the seven are registered as TestOptions fixtures in packages/playwright/src/index.ts; screen is the only one with no fixture, no entry in the _combinedContextOptions destructure, and no if-block — and unknown use keys are silently ignored, so nothing warns.
Actual behavior
window.screen (and device-width/height media queries) reflect the viewport instead of the descriptor's screen in test-runner mode.
Additional context
Three signs this is drift rather than design: docs/src/emulation.md promises the runner simulates "screenSize"; the TestOptions.reuseContext docs (v1.62) explicitly list screen among context options that may differ between tests — referencing a test option that doesn't exist; and paramsThatAllowContextReuse in browserContext.ts already includes 'screen'. screen emulation landed in #5967 (v1.10) and the TestOptions list never picked it up.
I have a fix drafted and verified (fixture + destructure + if-chain in index.ts, the overrides-test.d.ts type, docs entry, and a runInlineTest-style regression test — red without the src change, green with it; full playwright.config.spec.ts suite passes). Per the contribution policy I'm filing this first — happy to submit the PR if this is approved for community contribution. Prepared with AI assistance (Claude); the repros and red/green runs were verified by execution.
Activity