Storybook: Setting knob values via URL does not work with iframe.html

Created on 7 Sep 2017  路  12Comments  路  Source: storybookjs/storybook

We are using backstopJS for css regression testing via iframe.html

And we want to cover some specific knobs combination but we can't specify knobs values without GUI

inactive

All 12 comments

Well, there are no knobs in iframe. You can try index.html in fullscreen mode (full=1)

@Hypnosphi thank you for your answer!

I guess solution that you suggest uses iframe tag. Iframe works badly in PhantomJS why not apply knobs via Iframe.html url? I can make PR if u allow

You鈥榬e welcome to give a try (please base on release/3.3 branch)

Please note that PhantomJS project has an unclear future: https://groups.google.com/forum/m/#!topic/phantomjs/9aI5d-LDuNE

Latest release is more then year and a half ago

@Hypnosphi Thank you for your advice. Phantom works nice in full screen mode, I guess there is no issue with iframes. But today I've found nice project https://loki.js.org/ and it is using iframe.html https://loki.js.org/ so I think this issue is still actual cuz I'm going to implement knobs testing there

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. We do try to do some housekeeping every once in a while so inactive issues will get closed after 90 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!

@darkartur any updates on this?

Afaik, in SB 4, setting knobs from the URL is no longer supported even from index.html.

Afaik, in SB 4, setting knobs from the URL is no longer supported even from index.html.

I'm sad to hear that

I am putting this point again on storybook knob url parameters not setting in iframe html.
Are we having any solution on this in latest version of backstopJS.

You can read the query parameters directly from current URL in your stories and use them as prop values or even as default knob values:

const params = new URLSearchParams(window.location.search)
const foo = params.get('foo')
Was this page helpful?
0 / 5 - 0 ratings

Related issues

miljan-aleksic picture miljan-aleksic  路  3Comments

tomitrescak picture tomitrescak  路  3Comments

Jonovono picture Jonovono  路  3Comments

dnlsandiego picture dnlsandiego  路  3Comments

rpersaud picture rpersaud  路  3Comments