-
Notifications
You must be signed in to change notification settings - Fork 3.7k
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] Issues with VRT tests #23559
Comments
Update for If I run the steps described in this scenario but simplify the demo code to focus only on the font by removing the CSS for the blur, the images and the footer section, then the diff clearly highlights that the font on Chromium Ubuntu renders differently from Chromium Windows. On Windows the font seems bolder. Diff Screenshot from Chromium Windows Screenshot from Chromium Ubuntu |
Hey @edumserrano, These are all indeed well-known issues:
Overall, I'll close this issue in favor of other VRT-related bugs we already have on the tracker. |
Thank you for the reply @aslushnikov . I did see some of those, like the webkit headless/head issue for instance, but since:
I didn't know for sure if these things were duplicates or not. Apologies for creating more "noise". At least I created a demo repo and left all these details here, perhaps it helps others 🤞 |
@aslushnikov Do your comments also apply to the issue regarding Specifically with the fact that the headless mode seems to run with |
@edumserrano no worries for the noise! We're here to help navigate the project.
I don't think I've looked into this one particularly, but this falls in the |
System info
Source code
Link to the GitHub repository with the repro
edumserrano/playwright-bug-vrt-diff
Bug report
The issue I have is that some scenarios with screenshot comparison don't seem to work as expected, or at least as I'd expect. Perhaps some of these issues aren't qualified to be bugs.
I've found issues with unexpected differences in screenshot tests:
Please see the details below.
Issues trying to get consistent VRT
Scenario 1: Hardware acceleration and headless mode
npm run test
.npm run start
.npm run test
attests/example.spec.ts-snapshots/basic-test-1-chromium-win32.png
with how the app running vianpm run start
looks like in regards to the blur effect.Screenshot from npm run test
Screenshot from npm run start
When running the tests with
npm run test
it seems the chromium browser running inheadless
mode does not have hardware acceleration enabled, therefore the image produced is not as expected.You can compare the image produced from the test with how the app looks like when running via
npm run start
. I believe this is related with hardware acceleration because when running the app vianpm run start
if you enable/disable hardware accelearation in the browser settings, the blur applied looks different.Another way to view this is related with hardware acceleration is that if you add:
to the chromium project settings in the playwright.config.ts file, then the blur of screenshot from debug will look equal to when running without debug.
Scenario 2: Chromium screenshot in Windows vs Chromium screenshot in Ubuntu
// ignoreDefaultArgs: ["--hide-scrollbars"]
in the playwright.config.ts file.npm run test
and generate the screenshot in Windows.basic-test-1-chromium-win32.png
at/tests/example.spec.ts-snapshots
and rename it tobasic-test-1-chromium-linux.png
.docker run -it --rm --ipc=host --workdir=/app -v ${PWD}:/app mcr.microsoft.com/playwright:v1.34.3-jammy npx playwright test
.npx playwright show-report tests/test-results/reporters/html
and look at the differences in the screenshots.The screenshot generated from Ubuntu will have some slight differences regarding the font (looks bolder in windows?). Furthermore, the page scrollbar on Windows is a bit wider than the one in Ubuntu.
Diff
Screenshot from Windows
Screenshot from Ubuntu
Scenario 3: Differences when running the test in/out of debug mode
This one might not be a bug but it still feels like a bit of an issue.
// ignoreDefaultArgs: ["--hide-scrollbars"]
in the playwright.config.ts file.npm run test
.npx playwright show-report tests/test-results/reporters/html
and look at the differences in the screenshots.The debug will fail because there are differences in the screenshots:
npm run start
).Where do you study or work?
). This again might just be related with the blur difference.Diff
Screenshot from running via "npm run test"
Screenshot from running in debug via VS Code playwright extension
Related
Perhaps related with the effort on #8161
The text was updated successfully, but these errors were encountered: