-
-
Notifications
You must be signed in to change notification settings - Fork 9.4k
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: allow viewport per kind or story #9605
Comments
Hi everyone! Seems like there hasn't been much going on in this issue lately. If there are still questions, comments, or bugs, please feel free to continue the discussion. Unfortunately, we don't have time to get to every issue. We are always open to contributions so please send us a pull request if you would like to help. Inactive issues will be closed after 30 days. Thanks! |
Hey there, it's me again! I am going close this issue to help our maintainers focus on the current development roadmap instead. If the issue mentioned is still a concern, please open a new ticket and mention this old one. Cheers and thanks for using Storybook! |
I solved this by using the beforeScreenshot function like this:
|
This will be a very handful feature to have, honestly. |
@danielo515 I have a testfile (storyshots.test.js) with following content:
I defined different stories for each resolution to test. |
Thanks for the detailed answer @lihue, I am using a similar (but simpler) approach by providing parameters to the stories. |
Describe the solution you'd like
Enable specifying a viewport per kind or story so that when imageSnapshot() is used you can size the images to something that makes sense for your component. For small components like a checkbox you might only want a 100x100 viewport, but for a list or a page you might want 900x900 so that way the diff comparisons are more accurate. This can be done in the story parameters like:
parameters: { storyshots: { viewport: { height: 100, width: 100, ...otherViewportSettings } } }
Describe alternatives you've considered
I have tried to do this in the customizePage function; however, that function doesn't get passed anything useful to identify the kind or story. And it would be ideal to store it in the story and not in the global test or settings.
Are you able to assist bring the feature to reality?
Possibly, I went through the code a little and not sure I understand everything that is happening.
The text was updated successfully, but these errors were encountered: