Description
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 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.