intuit / proof

A tapable integration testing library for your Storybook stories
https://intuit.github.io/proof/
MIT License
86 stars 30 forks source link

Jest Image Snapshot Integration #41

Closed hainessss closed 3 years ago

hainessss commented 4 years ago

Is there a way to integrate jest? Trying to use jest-image-snapshot for visual regression testing.

adierkens commented 4 years ago

You couldn't really use both jest and proof together, but you could emulate the behavior of jest-image-snapshot through a plugin.

You may have to wait for the webdriverio v5 upgrade https://github.com/intuit/proof/pull/36 as that includes the api for saving a screen-shot, but that would easily integrate w/ the underlying library that jest-image-snapshot uses: https://github.com/mapbox/pixelmatch

That would make a really nice alternative to the applitools plugin that currently exists.

hainessss commented 4 years ago

Gotchya. Awesome, thanks for the direction, I will dive deeper.

hipstersmoothie commented 4 years ago

Yeah I Think this would really be a cool plugin to include

hainessss commented 3 years ago

Hey Everyone, I finally got around time to work on this. Just in time for hacktoberfest! Pretty close to having POC. Though, I am stuck on sizing the browser in the local configuration. How can you control the size of the browser opened? I tried browser.setWindowSize in webdriverio but it has no effect on the size of the image snapshot that gets taken. Any ideas? @adierkens @hipstersmoothie

hainessss commented 3 years ago

I fixed it by resizing the image before passing to the comparing function.

hipstersmoothie commented 3 years ago

Excited to see this land!