-
Notifications
You must be signed in to change notification settings - Fork 3.5k
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
[Feature] a toMatchScreenshot() for comparing two different screenshots #18937
Comments
@NVolcz I think we can probably do something like In your particular case, I can recommend to produce screenshots once in |
|
Would you consider implementing this in a way that would support the following usecase? test('MyButton has no side effects', async ({ page }) => {
await page.goto('/');
const before = await page.getByTestId('my-element').screenshot();
await page.getByRole('button', { name: 'MyButton' }).click();
const after = await page.getByTestId('my-element').screenshot();
// ensure my-element still looks the same
await expect(before).toMatchImage(after);
}); Specifically:
|
@ambiguous48 Yes, so far I think that |
Hello @aslushnikov, is there a chance we see that feature in 1.29? |
@NikkTod no, it's not coming to 1.29. Will be moved to 1.30 instead |
Does this feature work in version 1.32 by now? |
It will be very helpful to have this feature implemented because it opens a wide range of new options. Plus the new masking trick ... Can't wait. |
Hello @aslushnikov, Is there any lucky news about this feature? 🙏 |
We currently have
expect(screenshot).toMatchSnapshot(name[, options])
which is nice when comparing against at snapshot but it doesn't work when comparing a screenshot against a reference website which is useful for doing visual regression to see what has changed. I propose that we add atoMatchScreenshot(screenshot[, options])
that could be used for something like this:The text was updated successfully, but these errors were encountered: