Closed yannbf closed 3 years ago
Hi there,
Sorry for my late response.
I have just updated the addon to use playwright version 1.4.2, i have tested it with the latest storybook build, here is an example:
storybook-addon-playwright-example
Sometimes firefox takes too long to lunch if you received an error regarding timeout; comment out firefox and try, or set timeout to bigger value:
.storybook/main.js
let browser = {
chromium: await playwright["chromium"].launch(),
// firefox: await playwright["firefox"].launch(),
// webkit: await playwright["webkit"].launch(),
};
Regarding addon knobs; the way the addon works is; it will take a screenshot from the browser and display it in the storybook environment, so if the component has a prop that needs to be tested you have to set the knob and addon will pass the knob value as a QueryString to the browser and will take a screenshot, therefore addon knobs have been used in many places in add on to apply, rest or remove props from the component. hence it's necessary.
Apparently, storybook V6 introduced Controls
for replacement of addon knob, unfortunately, I don't have enough time to change the addon to use Controls
, so for now, I am stuck with addon knobs.
Please try the example and let me know if have a problem.
Thanks.
Thanks a lot @ccpu! and thanks for the explanation. When I have some free time I might try to see how things are done with knobs and see if I can convert to controls (or add support for both!).
I think the problem I faced was because I installed playwright
as well, instead of just relying on the peerdep of this addon. I tried your sample repo and it's great, however I can't set interactions because the app breaks. Here's a video showing what I mean:
https://streamable.com/y3o2kr
Sorry for that, i have fixed the problem, please try again, simply clone example or run yarn add storybook-addon-playwright
.
When I have some free time I might try to see how things are done with knobs and see if I can convert to controls (or add support for both!).
That would be great, let me know if need any explanation 👍
closing as i think the problem is solved, please open a new issue if you have experienced the same problem.
Hello! First of all, thanks for this addon, it looks incredible with a lot of potential!
I followed the docs and tried to run this addon in my Storybook 6 (with CSF components) but unfortunately didn't get it to work. I used the following versions:
The issue I had when running
yarn storybook
was this:then I downgraded to the following versions:
And managed to load storybook correctly and even have the addon panels displayed, but the functionality itself was broken:
Is there any tips to work around this issue? Is this a bug or am I just not using the addon properly?
Also, why is addon knobs necessary?
Thanks!