mirror of
https://github.com/storybookjs/storybook.git
synced 2025-04-02 05:03:44 +08:00
Merge pull request #4045 from storybooks/storyshots-puppeteer-images-do-not-match
Storyshots puppeteer images do not match
This commit is contained in:
commit
b7054f3a0d
@ -59,20 +59,21 @@ export const imageSnapshot = (customConfig = {}) => {
|
||||
|
||||
expect.assertions(1);
|
||||
|
||||
let image;
|
||||
try {
|
||||
await customizePage(page);
|
||||
await page.goto(url, getGotoOptions({ context, url }));
|
||||
await beforeScreenshot(page, { context, url });
|
||||
const image = await page.screenshot(getScreenshotOptions({ context, url }));
|
||||
|
||||
expect(image).toMatchImageSnapshot(getMatchOptions({ context, url }));
|
||||
image = await page.screenshot(getScreenshotOptions({ context, url }));
|
||||
} 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.`,
|
||||
`Error when 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.`,
|
||||
e
|
||||
);
|
||||
throw e;
|
||||
}
|
||||
|
||||
expect(image).toMatchImageSnapshot(getMatchOptions({ context, url }));
|
||||
};
|
||||
|
||||
testFn.afterAll = () => browser.close();
|
||||
|
Loading…
x
Reference in New Issue
Block a user