Skip to content
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

Issues with storyshots #3288

Closed
michaelgeorgeattard opened this issue Mar 26, 2018 · 3 comments
Closed

Issues with storyshots #3288

michaelgeorgeattard opened this issue Mar 26, 2018 · 3 comments
Assignees
Milestone

Comments

@michaelgeorgeattard
Copy link

michaelgeorgeattard commented Mar 26, 2018

A couple of issues I found with storyshots addon (latest unstable release):

Initializing as follows to use imageSnapshot does not work:

import initStoryshots, { imageSnapshot } from "@storybook/addon-storyshots";

initStoryshots({
    suite: "Image storyshots",
    test: imageSnapshot
});

I fixed this problem as follows:

initStoryshots({
    suite: "Image storyshots",
    test: imageSnapshot({})
});

If you confirm this issue, I can create a PR to update the docs or attempt to fix the limitation.

Another problem I found is imageSnapshot timing out when trying to generate a snapshot on the playground running in the background. I found the culprit in @storybook/addon-storyshots/src/test-body-image-snapshot.js:

return page
  .goto(url, { waitUntil: 'networkidle0' })

If I remove the { waitUntil: 'networkidle0' } option things work fine. Would it be possible to use some other waitUntil parameter, or atleast allow the consumer to pass in options?

@thomasbertet
Copy link
Contributor

@michaelgeorgeattard thanks for taking the time to trying out the new release & report issues :)
I believe we could remove the networkIdle0 as default, and let the user pass in options yes. I'll do it if you don't mind.

Also, if you want contribute to the docs to improve it, please do ! I believe there is room for improvement there 👍

@danielduan
Copy link
Member

@thomasbertet is test: imageSnapshot({}) with the ({}) correct or incorrect?

I think that's the only thing left in this issue to address. We can close after.

@Hypnosphi
Copy link
Member

networkidle0 fix released as 3.4.0-rc.4

@danielduan danielduan modified the milestones: v3.4.0, v4.0.0 Apr 6, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants