-
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] Chromium and webkit headless/head rendering differences #12683
Comments
Do you see the screenshots that don't include Looks like another issue caused by different anti-aliasing behavior is different between headed and headless modes. Unfortunately there is no good way to make the browsers produce identical images in both modes. We are adding additional settings to |
Hi @yury-s, Yes, we have a test that uses SVGs and the screenshots doesn't match between headful and headless. In fact, the screenshots above are of an SVG, it's not a canvas object. Short HTML code behind the screenshots: Okay! So the only way to avoid this issue is to play with tolerance, as I understand it is a browser issue. Thank you so much for your support. Greetings. |
@manuman94 the |
Summary: browsers do render differently in headless and headed modes, so comparing headless screenshots with headful Rendering issues include:
Our options:
|
@aslushnikov @dgozman the 15 pixels are the difference between headed and headless mode |
|
@aslushnikov The problem with our case is that headed vs headless renders the image with one pixel difference of dimensions. I'm not sure I understand how |
I am working with a defect where a component shouldn't display a scrollbar, when I run with headed mode on Chromium or Firefox it shows it and I can throw the error with Having a option to enable scrollbars on headless mode would make total sense as we're testing Visual here. @aslushnikov it seems you already have an prepared option for that in |
what is the status on this? Noticing these issues when creating baseline images from headless / headed and vice versa. Normally I'm able to get away with an insane .0001 maxpixeldifference!! When running cross headed / headless not even .01 get's them to pass |
I'm noticing maxDiffPixels: 5, is not working.... On ci there is a 1 pixel difference of the snapshot say 1x1 vs 1x2 and it fails. Tried 1000 pixels still fails Expected an image 60px by 125px, received 60px by 124px...... |
@aslushnikov This appears for both page.screenshot and element.screenshot. For example, in jest-image-snapshot package https://www.npmjs.com/package/jest-image-snapshot @playwright/test 1.27.1 Please find a solution to fix this problem as soon as possible. Due to this problem, I can not completely switch to playwright without using jest |
I think this is an inappropriate comment considering that the software is provided to you free of charge and without warranty |
I agree with you, I don't mean to offend the playwright team. My mistake. I really love this product and enjoy using it. I just found a few requests about this problem, so I asked to try to solve it. |
Would the new Chrome headless mode (not yet officially supported in Playwright) solve this issue? As I understand it, the performance drops quite a bit, but for me, if the rendering becomes identical to the headful browser, and if it increases the usability of visual testing (developing in headful mode and running in CI in headless mode), then I would prefer the new headless mode of Chrome. |
aslushnikov +1 to "shall we introduce an option to enable scrollbars in headless mode?" But perhaps more importantly, the new headless mode that @eveltman-twinfield mentioned above sounds even better. A relevant quote from that article: "This created a confusing situation where any automated browser test might pass in headful mode but fail in Headless mode, or vice versa — a major pain point for automation engineers." |
What's needed to try out the new EDIT: |
Since b21c81d there is a new env var option |
Hi, are there any updates on this bug. I am currently running into this issue between headless and headed modes. I am currently experiencing this issue. |
Hello, im running in this issue with the width difference in headless creation & headless test. So taking snapshots with a headless environment on the same machine and testing against those snapshots on the same machine produces :
I tested to define the viewport without success. I guess I will crop the resulting snapshots, so the test might work. |
|
would this solve anything about cross architecture differences? Because in the past even CPU differences for the same architecture would cause slight differences and it would fail. So if i author on say Mac and then run on Linux in CI would this new chrome feature resolve those issues? Has anyone tried it? |
System:
Binaries:
Languages:
Playwright env.:
The bug
Hi there! We are testing a kind of "analytics" web where some charts and diagrams are shown using amCharts library. The first approach is being made with snapshot testing.
The issue comes with head/headless option, as we develop with headless option set to
false
and the CI environment uses headless executions.When the snapshots are made with headless option enabled and then we launch the tests in headful mode the tests in Chromium and Webkit are failing, the images are not equal. This doesn't happen with Firefox, that makes identically component screenshots.
Evidences
We made a simple project that enters an amChart example and makes a snapshot of a pie chart component. The test consist on comparing a snapshot made with headless option set to
true
and then repeat the test in headful mode (and vice versa).https://github.com/manuman94/playwright-head-vs-headless-rendering
Further, I tried to compare the images using pixelmatch library (which Playwright is using too I believe) and get the image difference. Here you can see the both images and the difference image:
Headless:
HeadFul:
Difference:
Previous issues
There was an issue opened on Jan 4th 2021 (#11177) regarding this issue, but as for today is closed and a pull request was created to solve the font family problems.
There is another closed issue (#5371) but it seems that it was reporting a completely different problem.
Side notes
Thank you so much, greetings.
The text was updated successfully, but these errors were encountered: