jest-puppeteer
jest-puppeteer copied to clipboard
Visual regression? `expect(page).toMatchScreenshot()`?
🚀 Feature Proposal
I't be great to have a toMatchSnapshot()
like API for visual regression tests.
Motivation
There are cases where visual regression is very useful.
Example
await expect(page).toMatchScreenshot();
Pitch
It belongs to jest-puppeteer because it's a Jest-like API to take advantage of a Puppeteer feature.
Yeah it would be great, but we have to couple it to a services. Storing screenshots in the repository is not always a good solution. Also flakiness could be very problematic. It is better to rely on a third party service like Argos.
I think it would make sense to just let it store the screenshots locally, then they can be uploaded/downloaded by the consumer the way they prefer.
If it is like that, it is just screenshot and it is already possible using Puppeteer isn't it?
You can take screenshots but there is no logic in place do perform the comparison
Yeah but to compare we have to access previous screenshots 😅
Yeah I'm just proposing to leave the screenshots in the filesystem/git, and let the user do whatever they want with them.
One could have a workflow like the following:
- download screenshots from S3
- put screenshots in right folder
- run tests
- update screenshots
- upload screenshots to S3
Use this guys!
https://github.com/americanexpress/jest-image-snapshot