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

Add Puppeteer snapshot testing #586

Merged
merged 2 commits into from
Jun 29, 2018
Merged

Add Puppeteer snapshot testing #586

merged 2 commits into from
Jun 29, 2018

Conversation

captbaritone
Copy link
Owner

@captbaritone captbaritone commented May 25, 2018

As an example, here's a fake bug I introduced locally to test the snapshots:

screen shot 2018-05-26 at 12 27 16 am

Pretty subtle! Using single colons instead of double colons in this CSS selector is invalid. This causes the default skin to show through only when loading a custom skin, since the custom skin's dynamically generated CSS is not correct. (Default skin CSS is pre-generated).

Error message

Note with iTerm, I can cmd+click on the image path to open the image diff in Preview.

screen shot 2018-05-26 at 12 29 57 am

Diff image generated by jest-image-snapshot

On the left is the checked in version, on the right is the version generated in my test. In the middle is an image which highlights the change.

baseline-integration-test-js-should-render-the-topaz-skin-1-diff

If you open the image full size, you can see that the slider is slightly different.

Before

screen shot 2018-05-26 at 12 47 05 am

After

screen shot 2018-05-26 at 12 46 33 am

Note: Tests are failing due to Yarn outage https://status.yarnpkg.com/

cc @aaronabramov and @SimenB

@SimenB
Copy link

SimenB commented May 26, 2018

This looks good! Mind opening up an issue about the preset silently not working when in projects?

@captbaritone
Copy link
Owner Author

Will do!

@captbaritone
Copy link
Owner Author

jestjs/jest#6292

@captbaritone
Copy link
Owner Author

So, this is failing on Travis. Hard to tell why. Need sone way to get access to the diff png.

@captbaritone
Copy link
Owner Author

Haven't yet figured out how to get this working on Travis. In the mean time I've disabled it on Travis.

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

Successfully merging this pull request may close these issues.

2 participants