-
Notifications
You must be signed in to change notification settings - Fork 3.8k
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
[BUG] screenshots broken on Firefox in version 1.30.0 #20434
Comments
Things work for me locally, is there anything I can reproduce? (publicly available page?). The error
With the trace, we'll be able to render the page and attempt taking the screenshot in Firefox. |
Hi @pavelfeldman. Thanks for investigating. If you go to https://github.com/jnizet/decouvertes-nature/tree/bug/playwright and checkout that bug/playwright branch, I've set up the project so that it runs only the test that does a screenshot. I've removed the expected snapshot files for both chromium and firefox. When running the test, the chromium test fails as expected (since the expected snapshot isn't there), but the chromium screenshot is properly generated under Under On the other hand, under Here are the two trace files: To reproduce locally, from the root directory:
This will build the app and serve the app, start firebase emulators, and then run the test on chromium and firefox. |
As additional information, I'm seeing the same issue with Firefox and WebKit (but not Chromium) with v1.30 |
This patch has 2 fixes: - screenshot code was accidentally using main page context to fetch page layout metrics instead of a utility context - Avoid usage of `self.eval` inside utility context since it escapes Firefox sandbox. This turns out to be an upstream bug: https://bugzilla.mozilla.org/show_bug.cgi?id=1814898 Fixes microsoft#20434
…20615) This patch has 2 fixes: - screenshot code was accidentally using main page context to fetch page layout metrics instead of a utility context - Avoid usage of `self.eval` inside utility context since it escapes Firefox sandbox. This turns out to be an upstream bug: https://bugzilla.mozilla.org/show_bug.cgi?id=1814898 Fixes #20434
I seem to be running into this same error on 1.31.2, Chromium. But it only occurs when I do multiple screenshots in a single test. The following reproduces it consistently for me: await page.goto(`file://` + path.join(root, `test/data/html/test-document1.html`));
await expect(page).toHaveScreenshot();
await expect(page).toHaveScreenshot();
await expect(page).toHaveScreenshot();
await expect(page).toHaveScreenshot();
await expect(page).toHaveScreenshot();
|
@djahandarie could you please file separately with a repro steps? |
I was actually attempting to do exactly that, but discovered that it seems to only occur when I have my extension loaded so it's hard to build a minimal test case. I will try to debug it myself, and failing that I'll just share the full repo I guess... Thanks for the response! |
I figured it out! This error was occurring when the screenshot was hanging. Apparently when you are screenshotting a background page, chromium is very very slow, and sometimes hangs indefinitely. The extension I was loading was opening a "welcome to this extension" tab on install, which caused the test page to end up in the background. Using I think two things would have helped:
|
@djahandarie this does look like a bug on our side. Any chance you can file it separately with a repro? |
Context:
Code Snippet
Describe the bug
A screenshot test that passed with the previous version of Playwright now fails on Firefox since version 1.30.0. Regenerating the screenshot doesn't even work (see the error message above).
Opening the trace file shows this error:
The text was updated successfully, but these errors were encountered: