Skip to content

Commit

Permalink
Merge branch 'master' into addon-stories-scroll-to-selection
Browse files Browse the repository at this point in the history
  • Loading branch information
igor-dv authored Feb 19, 2018
2 parents afeca2e + 7e026e3 commit ac33fbd
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion integration/examples.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,18 +23,21 @@ const examples = [
{
name: 'cra-kitchen-sink',
storybookUrl: pathToCraKitchenSink,
storySelector: '#root *',
},
{
name: 'vue-kitchen-sink',
storybookUrl: pathToVueKitchenSink,
storySelector: '#root *',
},
{
name: 'angular-cli',
storybookUrl: pathToAngularKitchenSink,
storySelector: 'storybook-dynamic-app-root *',
},
];

examples.forEach(({ name, storybookUrl }) => {
examples.forEach(({ name, storybookUrl, storySelector }) => {
let browser = puppeteer.launch();
let page;

Expand All @@ -50,6 +53,8 @@ examples.forEach(({ name, storybookUrl }) => {

it(`Take screenshots for '${name}'`, async () => {
await page.goto(`file://${storybookUrl}`);
const iframe = page.mainFrame().childFrames()[0];
await iframe.waitFor(storySelector);
const screenshot = await page.screenshot({ fullPage: true });
expect(screenshot).toMatchImageSnapshot({
failureThreshold: 0.04, // 4% threshold,
Expand Down

0 comments on commit ac33fbd

Please sign in to comment.