storycap: Cannot screenshot multiple stories with addDecorator
First of all, need to say this is a great add-on. Thanks!
Issue: When looping over stories, addDecorator seems to get stuck after a single story. It will only generate the images for the one story.
As mentioned by @gcazaciuc in #3, it would be very handy not to have to decorate every story manually.
This does not work:
storiesOf('corp-site/atoms/Button', module)
.addDecorator(withScreenshot(getScreenshotOptions))
.add('with Black and Active', () => (
<Button color="black" isActive>Button</Button>
))
.add('with White and inactive, also inaccessible', () => (
<Button color="white">Button</Button>
))
.add('with Purple and inactive', () => (
<Button color="purple">Button</Button>
))
It will only take screenshots of the first story: with Black and Active.
It would be great to be able to use the addDecorator globally within the config to take screenshots of all stories that are being imported and looped over.
About this issue
- Original URL
- State: closed
- Created 7 years ago
- Reactions: 1
- Comments: 17 (9 by maintainers)
Commits related to this issue
- Fix addDecorator bug #10 — committed to reg-viz/storycap by deleted user 7 years ago
@tsuyoshiwada okay 😀 I will try to fix it
1.1.0-alpha.1 – a lot of screenshots are duplicated. I could see button for button story, checkbox, and even App story. It does not got updated. Using withScreenshot as a global decorator.
Hi @tsuyoshiwada, @camsloanftc. I’ve made the PR, that is fixing a lot of the race conditions in the capturing process. I’m using my fork in the project, that has 120+ stories (syftapp.com). All these stories are capturing by this plugin and are uploading to Argos Ci for the visual regression testing. I would be appreciated for the review. 😄
This change to the example breaks down creating screenshots.
https://github.com/tsuyoshiwada/storybook-chrome-screenshot/commit/0a86bce7ef9821697f52e9f46e522bef87dfb23e