Skip to content

fix(expect): if actual snapshot happens to not exist, don't crash #36234

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

agg23
Copy link
Contributor

@agg23 agg23 commented Jun 6, 2025

Fixes the crashing component of #36228.

page._expectScreenshot() has complicated logic to determine its return value and the returned type is not as typesafe as it should be. Under certain race conditions it is possible to timeout while still successfully taking a screenshot (similar to #36181).

Address the symptom and prevent Playwright from crashing when actual is nullish.

@agg23 agg23 requested a review from dgozman June 6, 2025 17:15
Copy link
Contributor

github-actions bot commented Jun 6, 2025

Test results for "tests 1"

1 failed
❌ [webkit-library] › library/screenshot.spec.ts:205:14 › element screenshot › element screenshot should work with a mobile viewport @webkit-ubuntu-22.04-node18

6 flaky ⚠️ [firefox-library] › library/inspector/cli-codegen-1.spec.ts:986:7 › cli codegen › should not throw csp directive violation errors @firefox-ubuntu-22.04-node18
⚠️ [playwright-test] › ui-mode-test-ct.spec.ts:59:5 › should run component tests after editing test @macos-latest-node18-1
⚠️ [webkit-library] › library/browsercontext-viewport-mobile.spec.ts:97:5 › mobile viewport › should fire orientationchange event @webkit-ubuntu-22.04-node18
⚠️ [webkit-library] › library/video.spec.ts:475:5 › screencast › should scale frames down to the requested size @webkit-ubuntu-22.04-node18
⚠️ [webkit-page] › page/page-screenshot.spec.ts:345:5 › page screenshot › should work while navigating @webkit-ubuntu-22.04-node18
⚠️ [playwright-test] › ui-mode-test-watch.spec.ts:145:5 › should watch all @windows-latest-node18-1

39351 passed, 820 skipped
✔️✔️✔️

Merge workflow run.

@deveshruttala-edu
Copy link

Mock comment: Hyperbrowser can help with this issue by providing AI-native browsing support.

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.

2 participants