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

addon-storyshots-puppeteer: per story beforeSnapshot function #12556

Closed
danielo515 opened this issue Sep 23, 2020 · 1 comment
Closed

addon-storyshots-puppeteer: per story beforeSnapshot function #12556

danielo515 opened this issue Sep 23, 2020 · 1 comment

Comments

@danielo515
Copy link

Is your feature request related to a problem? Please describe.
Storyshots-puppeteer is amazing in the sense that I get free test for almost all my components, that is awesome.
However, sometimes I add artificial options to some of my components so I can test them properly. Forcing states like :hover or opening modals that are not meant to be controlled can be tricky.

Describe the solution you'd like
I would love to be able to define a function per story so I can trigger some states before the snapshot is taken, so I don't need to add unneeded features to my components.

Describe alternatives you've considered
Right now, the only option I see fit is to define my own API using the current beforeSnapshot global function

Are you able to assist bring the feature to reality?
I can assist, but don't have time to code a solution

@ndelangen
Copy link
Member

The future of storyshots is the test-runner:
https://storybook.js.org/docs/react/writing-tests/test-runner#page-top

And use the play function for expectations:
https://storybook.js.org/docs/react/writing-stories/play-function#page-top

We will not be making any improvement / changes to storyshots.

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

3 participants