-
Notifications
You must be signed in to change notification settings - Fork 609
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
Is it possible to pass custom viewports to each scenario? #577
Comments
@mwmaleks Hi -- thanks for posting! Is this something you intend to package for the storybook project? This is something I have wanted to do for a year ( but of course -- I have not had time 😄 ) To answer your question... There is currently no clean way to do this with backstop because for each config -- viewports and scenario collections are explicitly tied together. I have looked at potentially adding an exception property in the past -- (as a filter -- or just re-specifying new viewports etc.) but so far, none of the solutions have felt clean. I think maybe the best way to implement what you want to do is to create a few configs for testing your components -- Here are some examples of what I mean...
Then you simply test the right component in the right config. Also, you would probably need to create a This is obviously just an idea -- I am sure your use-case is more complicated. Does this help? Is that workable for your use case? |
@garris I have same idea, to specify viewport. But i think that the easiest way is add into scenario option "viewports" where default value 'all' but user can specify just names of viewports as array.
|
The suggestion above would be a great addition. |
Ok. The people have spoken. I guess we should do it. Prop name:
Comments please... |
I think a array is fine. |
I also think that array preferable |
Ok. Sounds good. PR is welcome. |
something like this?
#472
…On Nov 2, 2017 4:09 AM, "Garris" ***@***.***> wrote:
Ok. Sounds good. PR is welcome.
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#577 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AQUrI7kOdbrK2B1eUrxZOUAccskt7fvyks5syIm5gaJpZM4QDLWw>
.
|
@kiran-redhat I think if we are to pass an array of allowed viewports with each scenario we would want to implement a switch near here... https://github.com/garris/BackstopJS/blob/master/core/util/createBitmaps.js#L113 This would also need to happen for phantom tests. |
Has this been added? |
Yes. This was added. |
@garris: Thanks. Has the syntax changed? Haven't found in in the docs and using it in a scenario like this has no effect
Expected behaviour: Only viewports labeled phone and tablet will be tested. |
I am an idiot… found it. thanks. |
Hi, I just leave it here
|
Hi! I'm implementing screenshot testing for storybook components those some times should be captured with the only mobile or desktop viewport size. Is it possible to pass it immediatly to a scenario?
The text was updated successfully, but these errors were encountered: