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]Visual Regression Test screenshots differ from each pipeline run #22620

Closed
1 task
badigerpramod opened this issue Apr 25, 2023 · 6 comments
Closed
1 task

Comments

@badigerpramod
Copy link

System info

  • Playwright Version: [v1.32.3]
  • Operating System: [ubuntu-20.04]
  • Browser: [Chromium]
  • Other info:

Source code

  • I provided exact source code that allows reproducing the issue locally.

VRT Failure1

implementing based on https://www.npmjs.com/package/@web/test-runner-visual-regression

@badigerpramod
Copy link
Author

Previously had version 1.22.1 version of playwright, everything worked very well, tried updating 1.31.1 and 1.32.3 versions then started getting different results for different runs

@aslushnikov
Copy link
Collaborator

This is known issue; browsers do not have deterministic rendering. You can try experimental comparator that was designed
to fight some of these:

#13873 (comment)

If you do try it, then please let us know how it goes. Thanks!

@badigerpramod
Copy link
Author

The problem with our approach is that, we are comparing the images very strictly without any threshold and other observations are,

our test works without any issues from 1.22.0 1.23.0 1.24.0 then issue started coming from 1.25.0 to 1.33.0, there always disturbance in the corners of the component like above screenshots, that too only in Chromium, do we need to set any property or adjust the chromium here?

@aslushnikov
Copy link
Collaborator

@badigerpramod someone reported some success with a bunch of extra flags, however in my experiments they didn't help much.

In general, Chromium does not guarantee consistent rendering for the same inputs, so you should be prepared that some pixels might be different.

@badigerpramod
Copy link
Author

badigerpramod commented Apr 30, 2023

@aslushnikov i found solution for the problem, somehow chrome was too fast to run the tests this is where screenshots were wrongly taken/compared, by adding 100ms or required delay before each test solved the issue for me

beforeEach(async () => {
      await new Promise((resolve) => setTimeout(resolve, 100));
});

Now I am getting same results every run!

Thank you

@sijakret
Copy link

@badigerpramod someone reported some success with a bunch of extra flags, however in my experiments they didn't help much.

In general, Chromium does not guarantee consistent rendering for the same inputs, so you should be prepared that some pixels might be different.

@aslushnikov do you have any references for this?
I understand that there might be differences when using different environments (like different os, different rendering hardware, different drivers, etc..).
However, somehow I have doubts that rendering on an identical environment (same os, hardware, driver, etc..) is not deterministic. That would also make it kind of hard for chrome itself to be tested.

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

No branches or pull requests

3 participants