Skip to content

fix(test runner): forward the screen option from device descriptors - #42681

Draft
Pavel Feldman (pavelfeldman) wants to merge 1 commit into
microsoft:mainfrom
pavelfeldman:fix-42679
Draft

Pavel Feldman (pavelfeldman) wants to merge 1 commit into
microsoft:mainfrom
pavelfeldman:fix-42679

Conversation

@pavelfeldman

Copy link
Copy Markdown
Member

Summary

  • Register screen as a test option so test.use({ ...devices[...] }) and use: { ...devices[...] } in config forward the descriptor's screen key, matching library mode.
  • Add the TestOptions.screen type and docs entry, plus a regression test.

Fixes #42679

Breaking change, not for landing

Every config that spreads a device descriptor into use starts emulating screen on upgrade. That includes all desktop descriptors, so the default scaffolded project changes window.screen from 1280x720 to 1920x1080 and device-width media queries follow. A user-defined fixture named screen that depends on page now fails with a fixture dependency cycle, which affects @playwright-testing-library/test.

@github-actions

Copy link
Copy Markdown
Contributor

Test results for "tests 1"

4 flaky ⚠️ [chromium-library] › library/video.spec.ts:356 › screencast › should work for popups `@chromium-ubuntu-22.04-node24`
⚠️ [firefox-library] › library/browsercontext-cookies-third-party.spec.ts:257 › third party 'Partitioned;' cookies `@firefox-ubuntu-22.04-node20`
⚠️ [firefox-library] › library/browsercontext-cookies-third-party.spec.ts:470 › top level 'Partitioned;' cookie and same origin iframe `@firefox-ubuntu-22.04-node20`
⚠️ [firefox-page] › page/page-emulate-media.spec.ts:144 › should keep reduced motion and color emulation after reload `@firefox-ubuntu-22.04-node20`

51698 passed, 1247 skipped


Merge workflow run.

@github-actions

Copy link
Copy Markdown
Contributor

Test results for "MCP"

1 failed
❌ [chrome] › mcp/webmcp.spec.ts:213 › browser_webmcp_call disambiguates same-name tools in identical same-origin frames @mcp-macos-latest-chrome

8495 passed, 1436 skipped


Merge workflow run.

@github-actions

Copy link
Copy Markdown
Contributor

Hi, I'm the Playwright bot and I took a first look at the CI failures here.

🟢 CI is clear — the one failure is a pre-existing flake

The only red test, mcp/webmcp.spec.ts:213, also fails identically on main (push, sha 6750deccd13b5703ab7c6d9aca9c723a7d1e5034) — a SHA this PR can't be responsible for. The four flaky results all passed on retry. This PR only wires up a screen test option; it doesn't touch MCP.

Details

Overall: nothing here points back at the diff. The PR adds a screen fixture in packages/playwright/src/index.ts plus docs/types and one playwright-test spec — it never reaches the MCP WebMCP tool-discovery path, and the one real failure reproduces off-PR.

Pre-existing flake / infra

  • [chrome] › mcp/webmcp.spec.ts:213 › browser_webmcp_call disambiguates same-name tools in identical same-origin frames — pre-existing flake. The exact same failure lands on main at sha 6750deccd (run 34650183469, event=push), with the identical signature: the test expects Found 2 WebMCP tool(s) but gets Found 1 because only one of the two identical same-origin frames has registered its tools when the call runs. It's a registration/timing race, not something this PR changes. Chrome-only, and the WebMCP disambiguation code is untouched by the diff.

Already-retried flakes (passed on retry, not blocking)

  • [chromium-library] › library/video.spec.ts:356 › screencast › should work for popups
  • [firefox-library] › library/browsercontext-cookies-third-party.spec.ts:257 › third party 'Partitioned;' cookies
  • [firefox-library] › library/browsercontext-cookies-third-party.spec.ts:470 › top level 'Partitioned;' cookie and same origin iframe
  • [firefox-page] › page/page-emulate-media.spec.ts:144 › should keep reduced motion and color emulation after reload

None of these exercise the screen option this PR adds, and all recovered on retry.

Triaged by the Playwright bot - agent run

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: test runner silently drops the 'screen' key of device descriptors

1 participant