Storyshots browser and image snapshots
See original GitHub issueIt would be great if storyshots could diff screenshots of stories as they are rendered in a browser. The idea comes from this blog post: https://voice.kadira.io/snapshot-testing-in-react-storybook-43b3b71cec4f
Jest’s snapshot testing is just one solution for snapshot testing. We will have two more solutions shipped as drivers. They are: Browser snapshots — This will get snapshots by rendering your UI on a real browser. Image snapshots — This will get snapshots as images so we can test CSS and style changes as well
Possible API:
import { browserSnapshot } from '@storybook/addon-storyshots';
initStoryshots({
configPath: 'path/to/config',
test: browserSnapshot
});
Issue Analytics
- State:
- Created 6 years ago
- Comments:6 (4 by maintainers)
Top Results From Across the Web
Storyshots browser and image snapshots · Issue #1781 - GitHub
It would be great if storyshots could diff screenshots of stories as they are rendered in a browser. The idea comes from this...
Read more >spring-media/storybook-addon-image-snapshots
Storybook plugin for taking image snapshots of your stories based on @storybook/addon-storyshots-puppeteer plugin.
Read more >Storybook Case Study: Automate image snapshots ... - Medium
This post will show how to visual-snapshot your stories with different devices' view-ports by using in-house addon-storyshots and ...
Read more >addon-storyshots-wdio - npm Package Health Analysis | Snyk
An image snapshot is simply a screenshot taken by a web browser. The browser opens a page (either using the static build of...
Read more >Automated Visual Testing - Storybook
If you perform your visual tests against multiple browsers, they can potentially catch regressions ... Most custom solutions, including jest-image-snapshot, ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

@smith-kyle @sideroad I would like to discuss about some possibilities around this if you have time. You can join Slack https://storybooks.slack.com to chat, otherwise I will write here my thoughts:
As pointed out by @shilman , there is an alternative here: https://loki.js.org/ but I don’t quite understand how to compare images on CI, it seems everything is generated locally, so the CI will fail only if an image is missing, not if it has changed and you did not update the reference image.
Anyway for the addon-storyshots:
To generate images, I’m thinking of using puppeteer. I was thinking about generating images each time you run your tests like so:
That said, do you see anything that may not work for your use-case ?
Released as
3.4.0-alpha.4