mirror of
https://github.com/storybookjs/storybook.git
synced 2025-04-09 00:19:13 +08:00
Add 'waitUntil' option to puppeteer of storyshots
If some elements use additional xhr requests (like async image loading).
Puppeteer might not imprint the end state of the page. Puppeteer has
built-in method to resolve this -
c857aef589/docs/api.md (pagegotourl-options)
This option is fairly general so it should be okay to use for other cases
as well.
However, 'beforeScreenshot' could be used instead, but proposed approach seems
more definite and reliable
As additional further improvement, these `goto` options might be exposed to
consumber as well
This commit is contained in:
parent
cad61533c9
commit
329507f9cd
@ -36,7 +36,7 @@ export const imageSnapshot = ({
|
||||
|
||||
expect.assertions(1);
|
||||
return page
|
||||
.goto(url)
|
||||
.goto(url, {"waitUntil" : "networkidle0"})
|
||||
.catch(e => {
|
||||
logger.error(
|
||||
`ERROR WHILE CONNECTING TO ${url}, did you start or build the storybook first ? A storybook instance should be running or a static version should be built when using image snapshot feature.`,
|
||||
|
Loading…
x
Reference in New Issue
Block a user