You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Recently (as of the date of creating this issue), the PW E2E tests started failing without any noticeable change to the codebase. When looking at the reasons, the source of the failures were a couple of toHaveScreenshot assertions.
When looking at the visual diff, we notice that the changes are minimal, the contents did not change at all, only moved slightly lower.
These screenshots were updated in #9712 to make the tests pass again; however, we need to make sure that the tests are more reliable and at the same time help us to spot regressions/unintended behavior. (UPDATE: I had to disable all visual regression tests in #9718 since they started failing again.)
Acceptance criteria
We have a couple of options here:
A) Update the maxDiffPixelRatio setting in the playwright.config.ts file so it has a higher tolerance for changes; However, how can we decide which value is acceptable?
B) Avoid using toHaveScreenshot and use other assertions instead?
We could also have a combination of both, in which we make sure that the contents match our expectation, and that the visual diff is close enough (with a higher threshold for tolerated changes).
Testing instructions
See instructions for running pw tests locally in the tests/e2e-pw/README.md file.
There's some discussion here about other potential solutions. E.g. Separating visual regression into their own workflow: p1731518139549869-slack-CGGCLBN58
danielmx-dev
changed the title
Improve reliability of Playwright visual diffs
Improve reliability of Playwright visual regression testing
Nov 14, 2024
Description
Recently (as of the date of creating this issue), the PW E2E tests started failing without any noticeable change to the codebase. When looking at the reasons, the source of the failures were a couple of
toHaveScreenshot
assertions.When looking at the visual diff, we notice that the changes are minimal, the contents did not change at all, only moved slightly lower.
These screenshots were updated in #9712 to make the tests pass again; however, we need to make sure that the tests are more reliable and at the same time help us to spot regressions/unintended behavior. (UPDATE: I had to disable all visual regression tests in #9718 since they started failing again.)
Acceptance criteria
We have a couple of options here:
A) Update the
maxDiffPixelRatio
setting in theplaywright.config.ts
file so it has a higher tolerance for changes; However, how can we decide which value is acceptable?B) Avoid using
toHaveScreenshot
and use other assertions instead?We could also have a combination of both, in which we make sure that the contents match our expectation, and that the visual diff is close enough (with a higher threshold for tolerated changes).
Testing instructions
tests/e2e-pw/README.md
file.Dev notes
maxDiffPixelRatio location in the code
The text was updated successfully, but these errors were encountered: