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]: The method toMatchSnapshot() is not tolerating a Threshold of 20% #34062

Open
prabsaho opened this issue Dec 18, 2024 · 1 comment
Open

Comments

@prabsaho
Copy link

Version

1.49.1

Steps to reproduce

Pre requisite : The expected screenshot is already saved by playwright in the respective folder for comparison
1.Write a code for screenshot comparison of a particular locator in webpage.
e.g. expect (await page.locator("[class='map-goal']")).screenshot('actual-map-screenshot.png')).toMatchSnapshot('expected-map-screenshot',{threshold :0.2})

Expected behavior

It should allow a threshold upto 0.2

Actual behavior

it's failing at Threshold of 0.02

Image

Error is : Expected an image 616px by 375px, received 615px by 374px. 4497 pixels (ratio 0.02 of all image pixels) are different.

Additional context

No response

Environment

Both Mac & Windows latest
@pavelfeldman
Copy link
Member

Please follow the issue template and provide something I can reproduce locally via running the test. Include resources, scripts and command line.

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

2 participants