Skip to content
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] Screenshot tests differences between headless and headful #11177

Closed
bvaughn opened this issue Jan 4, 2022 · 5 comments · Fixed by #11340
Closed

[BUG] Screenshot tests differences between headless and headful #11177

bvaughn opened this issue Jan 4, 2022 · 5 comments · Fixed by #11340

Comments

@bvaughn
Copy link

bvaughn commented Jan 4, 2022

Context:

  • Playwright Version: 1.17.1
  • Operating System: Mac
  • Node.js version: v14.17.0
  • Browser: Chromium
  • Extra: MacBook Pro with retina display and external Dell U3417W

Code Snippet

Code to reproduce this problem is available here:
https://github.com/bvaughn/planner

This is a planning app that renders to an HTML canvas.

Repro steps

  1. Checkout repo
  2. Run yarn install and yarn playwright:install
  3. Run yarn start
  4. Run yarn test:e2e (in another terminal) and observe success
  5. Edit playwright.config.js to change headless to false
  6. Re-run yarn test:e2e and observe failures

Describe the bug

There are subtle text rendering differences between headless and headful runs that cause tests to fail. I've experimented with increasing the expect.toMatchSnapshot.threshold value up to 0.9 but at this point, legitimate failures easily slip through. (e.g. I can change the date header formats to add a "1" and the snapshot doesn't even pick it up.)

@pavelfeldman
Copy link
Member

I can repro this. Missing step:

2.5. Run yarn start

@pavelfeldman
Copy link
Member

@bvaughn: sent you a PR with minor test fixes: bvaughn/planner#14

@bvaughn
Copy link
Author

bvaughn commented Jan 5, 2022

Oh that’s very kind. Thank you!

@dgozman
Copy link
Contributor

dgozman commented Jan 10, 2022

Let's see whether we can fix the situation with Page.setFontFamilies.

@yury-s
Copy link
Member

yury-s commented Feb 10, 2022

For reference, upstream patch: https://chromium-review.googlesource.com/c/chromium/src/+/3388550

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

Successfully merging a pull request may close this issue.

4 participants