Skip to content

Commit

Permalink
DSW-2365: Enable pause before screenshot on specific VRT tests
Browse files Browse the repository at this point in the history
  • Loading branch information
fernandofranca committed Sep 12, 2024
1 parent 7a75d17 commit 37c064e
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 4 deletions.
5 changes: 4 additions & 1 deletion nextjs-app-v13/test/visual/nextjs.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ describe('NextJS Aperture App', () => {
{ url: '/components/icon.html', name: 'Icon' },
{ url: '/components/icon-button.html', name: 'Icon Button' },
{ url: '/components/link.html', name: 'Link' },
{ url: '/components/lottie-player.html', name: 'Lottie Player' },
{ url: '/components/lottie-player.html', name: 'Lottie Player', pauseBeforeScreenshot: true },
{ url: '/components/modal.html', name: 'Modal' },
{ url: '/components/notification.html', name: 'Notification' },
{ url: '/components/spinner.html', name: 'Spinner' },
Expand All @@ -30,6 +30,9 @@ describe('NextJS Aperture App', () => {
it(`should navigate to the ${page.name} page.`, async () => {
await browser.url(`${page.url}?PERCY=true`);
await waitForPageTitleToBe(page.name);
// Some components might require extra time to mount and load its dependencies.
// Delaying the screenshot helps to avoid false negatives in diffs.
if (page.pauseBeforeScreenshot) await browser.pause(5000);
await percyScreenshot(page.name);
});
});
Expand Down
5 changes: 4 additions & 1 deletion nextjs-app-v14/test/visual/nextjs.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ describe('NextJS Aperture App', () => {
{ url: '/components/icon', name: 'Icon' },
{ url: '/components/icon-button', name: 'Icon Button' },
{ url: '/components/link', name: 'Link' },
{ url: '/components/lottie-player', name: 'Lottie Player' },
{ url: '/components/lottie-player', name: 'Lottie Player', pauseBeforeScreenshot: true },
{ url: '/components/modal', name: 'Modal' },
{ url: '/components/notification', name: 'Notification' },
{ url: '/components/spinner', name: 'Spinner' },
Expand All @@ -30,6 +30,9 @@ describe('NextJS Aperture App', () => {
it(`should navigate to the ${page.name} page.`, async () => {
await browser.url(`${page.url}?PERCY=true`);
await waitForPageTitleToBe(page.name);
// Some components might require extra time to mount and load its dependencies.
// Delaying the screenshot helps to avoid false negatives in diffs.
if (page.pauseBeforeScreenshot) await browser.pause(5000);
await percyScreenshot(page.name);
});
});
Expand Down
5 changes: 4 additions & 1 deletion nuxt-app/test/visual/nuxt.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ describe('Nuxt Aperture App', () => {
{ url: '/components/icon.html', name: 'Icon' },
{ url: '/components/icon-button.html', name: 'Icon Button' },
{ url: '/components/link.html', name: 'Link' },
{ url: '/components/lottie-player.html', name: 'Lottie Player' },
{ url: '/components/lottie-player.html', name: 'Lottie Player', pauseBeforeScreenshot: true },
{ url: '/components/modal.html', name: 'Modal' },
{ url: '/components/notification.html', name: 'Notification' },
{ url: '/components/spinner.html', name: 'Spinner' },
Expand All @@ -30,6 +30,9 @@ describe('Nuxt Aperture App', () => {
it(`should navigate to the ${page.name} page.`, async () => {
await browser.url(`${page.url}?PERCY=true`);
await waitForPageTitleToBe(page.name);
// Some components might require extra time to mount and load its dependencies.
// Delaying the screenshot helps to avoid false negatives in diffs.
if (page.pauseBeforeScreenshot) await browser.pause(5000);
await percyScreenshot(page.name);
});
});
Expand Down
5 changes: 4 additions & 1 deletion vanilla-app/test/visual/vanilla.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ describe('Vanilla Aperture App', () => {
{ url: '/components/icon.html', name: 'Icon' },
{ url: '/components/icon-button.html', name: 'Icon Button' },
{ url: '/components/link.html', name: 'Link' },
{ url: '/components/lottie-player.html', name: 'Lottie Player' },
{ url: '/components/lottie-player.html', name: 'Lottie Player', pauseBeforeScreenshot: true },
{ url: '/components/modal.html', name: 'Modal' },
{ url: '/components/notification.html', name: 'Notification' },
{ url: '/components/spinner.html', name: 'Spinner' },
Expand All @@ -30,6 +30,9 @@ describe('Vanilla Aperture App', () => {
it(`should navigate to the ${page.name} page.`, async () => {
await browser.url(`${page.url}?PERCY=true`);
await waitForPageTitleToBe(page.name);
// Some components might require extra time to mount and load its dependencies.
// Delaying the screenshot helps to avoid false negatives in diffs.
if (page.pauseBeforeScreenshot) await browser.pause(5000);
await percyScreenshot(page.name);
});
});
Expand Down

0 comments on commit 37c064e

Please sign in to comment.