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

Visual regression? expect(page).toMatchScreenshot()? #252

Open
FezVrasta opened this issue Jun 12, 2019 · 7 comments
Open

Visual regression? expect(page).toMatchScreenshot()? #252

FezVrasta opened this issue Jun 12, 2019 · 7 comments

Comments

@FezVrasta
Copy link

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

@gregberge
Copy link
Member

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.

@FezVrasta
Copy link
Author

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.

@gregberge
Copy link
Member

If it is like that, it is just screenshot and it is already possible using Puppeteer isn't it?

@FezVrasta
Copy link
Author

You can take screenshots but there is no logic in place do perform the comparison

@gregberge
Copy link
Member

Yeah but to compare we have to access previous screenshots 😅

@FezVrasta
Copy link
Author

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:

  1. download screenshots from S3
  2. put screenshots in right folder
  3. run tests
  4. update screenshots
  5. upload screenshots to S3

@rodoabad
Copy link

Use this guys!

https://github.com/americanexpress/jest-image-snapshot

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants