-
Notifications
You must be signed in to change notification settings - Fork 536
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test(e2e): add vrt for blankslate (#4809)
* test(e2e): add vrt for blankslate * test(vrt): update snapshots --------- Co-authored-by: Josh Black <joshblack@users.noreply.github.com>
- Loading branch information
Showing
74 changed files
with
92 additions
and
0 deletions.
There are no files selected for viewing
Binary file added
BIN
+28.4 KB
...nents/Blankslate.test.ts-snapshots/Blankslate-Default-dark-colorblind-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+28.1 KB
...omponents/Blankslate.test.ts-snapshots/Blankslate-Default-dark-dimmed-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+28 KB
...ts/Blankslate.test.ts-snapshots/Blankslate-Default-dark-high-contrast-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+28.6 KB
...shots/components/Blankslate.test.ts-snapshots/Blankslate-Default-dark-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+28.4 KB
...nents/Blankslate.test.ts-snapshots/Blankslate-Default-dark-tritanopia-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+28.2 KB
...ents/Blankslate.test.ts-snapshots/Blankslate-Default-light-colorblind-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+27.8 KB
...s/Blankslate.test.ts-snapshots/Blankslate-Default-light-high-contrast-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+28.3 KB
...hots/components/Blankslate.test.ts-snapshots/Blankslate-Default-light-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+28.2 KB
...ents/Blankslate.test.ts-snapshots/Blankslate-Default-light-tritanopia-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+28.8 KB
.../Blankslate.test.ts-snapshots/Blankslate-Default-primer-breakpoint-sm-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+25 KB
.../Blankslate.test.ts-snapshots/Blankslate-Default-primer-breakpoint-xs-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+16.2 KB
...onents/Blankslate.test.ts-snapshots/Blankslate-Narrow-dark-colorblind-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+16 KB
...components/Blankslate.test.ts-snapshots/Blankslate-Narrow-dark-dimmed-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+16 KB
...nts/Blankslate.test.ts-snapshots/Blankslate-Narrow-dark-high-contrast-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+16.2 KB
...pshots/components/Blankslate.test.ts-snapshots/Blankslate-Narrow-dark-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+16.2 KB
...onents/Blankslate.test.ts-snapshots/Blankslate-Narrow-dark-tritanopia-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+16.3 KB
...nents/Blankslate.test.ts-snapshots/Blankslate-Narrow-light-colorblind-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+16 KB
...ts/Blankslate.test.ts-snapshots/Blankslate-Narrow-light-high-contrast-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+16.3 KB
...shots/components/Blankslate.test.ts-snapshots/Blankslate-Narrow-light-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+16.3 KB
...nents/Blankslate.test.ts-snapshots/Blankslate-Narrow-light-tritanopia-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+15 KB
...s/Blankslate.test.ts-snapshots/Blankslate-Narrow-primer-breakpoint-sm-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+12.2 KB
...s/Blankslate.test.ts-snapshots/Blankslate-Narrow-primer-breakpoint-xs-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+15.6 KB
...ents/Blankslate.test.ts-snapshots/Blankslate-Spacious-dark-colorblind-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+15.4 KB
...mponents/Blankslate.test.ts-snapshots/Blankslate-Spacious-dark-dimmed-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+15.4 KB
...s/Blankslate.test.ts-snapshots/Blankslate-Spacious-dark-high-contrast-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+15.6 KB
...hots/components/Blankslate.test.ts-snapshots/Blankslate-Spacious-dark-linux.png
Oops, something went wrong.
Binary file added
BIN
+15.6 KB
...ents/Blankslate.test.ts-snapshots/Blankslate-Spacious-dark-tritanopia-linux.png
Oops, something went wrong.
Binary file added
BIN
+15.6 KB
...nts/Blankslate.test.ts-snapshots/Blankslate-Spacious-light-colorblind-linux.png
Oops, something went wrong.
Binary file added
BIN
+15.4 KB
.../Blankslate.test.ts-snapshots/Blankslate-Spacious-light-high-contrast-linux.png
Oops, something went wrong.
Binary file added
BIN
+15.6 KB
...ots/components/Blankslate.test.ts-snapshots/Blankslate-Spacious-light-linux.png
Oops, something went wrong.
Binary file added
BIN
+15.6 KB
...nts/Blankslate.test.ts-snapshots/Blankslate-Spacious-light-tritanopia-linux.png
Oops, something went wrong.
Binary file added
BIN
+14.5 KB
...Blankslate.test.ts-snapshots/Blankslate-Spacious-primer-breakpoint-sm-linux.png
Oops, something went wrong.
Binary file added
BIN
+12.2 KB
...Blankslate.test.ts-snapshots/Blankslate-Spacious-primer-breakpoint-xs-linux.png
Oops, something went wrong.
Binary file added
BIN
+16.1 KB
...s/Blankslate.test.ts-snapshots/Blankslate-With-Border-dark-colorblind-linux.png
Oops, something went wrong.
Binary file added
BIN
+15.9 KB
...nents/Blankslate.test.ts-snapshots/Blankslate-With-Border-dark-dimmed-linux.png
Oops, something went wrong.
Binary file added
BIN
+15.9 KB
...lankslate.test.ts-snapshots/Blankslate-With-Border-dark-high-contrast-linux.png
Oops, something went wrong.
Binary file added
BIN
+16.1 KB
...s/components/Blankslate.test.ts-snapshots/Blankslate-With-Border-dark-linux.png
Oops, something went wrong.
Binary file added
BIN
+16.1 KB
...s/Blankslate.test.ts-snapshots/Blankslate-With-Border-dark-tritanopia-linux.png
Oops, something went wrong.
Binary file added
BIN
+16.1 KB
.../Blankslate.test.ts-snapshots/Blankslate-With-Border-light-colorblind-linux.png
Oops, something went wrong.
Binary file added
BIN
+15.9 KB
...ankslate.test.ts-snapshots/Blankslate-With-Border-light-high-contrast-linux.png
Oops, something went wrong.
Binary file added
BIN
+16.1 KB
.../components/Blankslate.test.ts-snapshots/Blankslate-With-Border-light-linux.png
Oops, something went wrong.
Binary file added
BIN
+16.1 KB
.../Blankslate.test.ts-snapshots/Blankslate-With-Border-light-tritanopia-linux.png
Oops, something went wrong.
Binary file added
BIN
+14.9 KB
...nkslate.test.ts-snapshots/Blankslate-With-Border-primer-breakpoint-sm-linux.png
Oops, something went wrong.
Binary file added
BIN
+17.4 KB
...late.test.ts-snapshots/Blankslate-With-Primary-Action-dark-colorblind-linux.png
Oops, something went wrong.
Binary file added
BIN
+17.3 KB
...ankslate.test.ts-snapshots/Blankslate-With-Primary-Action-dark-dimmed-linux.png
Oops, something went wrong.
Binary file added
BIN
+17.2 KB
...e.test.ts-snapshots/Blankslate-With-Primary-Action-dark-high-contrast-linux.png
Oops, something went wrong.
Binary file added
BIN
+17.5 KB
...ents/Blankslate.test.ts-snapshots/Blankslate-With-Primary-Action-dark-linux.png
Oops, something went wrong.
Binary file added
BIN
+17.4 KB
...late.test.ts-snapshots/Blankslate-With-Primary-Action-dark-tritanopia-linux.png
Oops, something went wrong.
Binary file added
BIN
+17.5 KB
...ate.test.ts-snapshots/Blankslate-With-Primary-Action-light-colorblind-linux.png
Oops, something went wrong.
Binary file added
BIN
+17.4 KB
....test.ts-snapshots/Blankslate-With-Primary-Action-light-high-contrast-linux.png
Oops, something went wrong.
Binary file added
BIN
+17.5 KB
...nts/Blankslate.test.ts-snapshots/Blankslate-With-Primary-Action-light-linux.png
Oops, something went wrong.
Binary file added
BIN
+17.5 KB
...ate.test.ts-snapshots/Blankslate-With-Primary-Action-light-tritanopia-linux.png
Oops, something went wrong.
Binary file added
BIN
+16.3 KB
...test.ts-snapshots/Blankslate-With-Primary-Action-primer-breakpoint-sm-linux.png
Oops, something went wrong.
Binary file added
BIN
+18 KB
...te.test.ts-snapshots/Blankslate-With-Secondary-Action-dark-colorblind-linux.png
Oops, something went wrong.
Binary file added
BIN
+17.8 KB
...kslate.test.ts-snapshots/Blankslate-With-Secondary-Action-dark-dimmed-linux.png
Oops, something went wrong.
Binary file added
BIN
+17.9 KB
...test.ts-snapshots/Blankslate-With-Secondary-Action-dark-high-contrast-linux.png
Oops, something went wrong.
Binary file added
BIN
+18 KB
...ts/Blankslate.test.ts-snapshots/Blankslate-With-Secondary-Action-dark-linux.png
Oops, something went wrong.
Binary file added
BIN
+18 KB
...te.test.ts-snapshots/Blankslate-With-Secondary-Action-dark-tritanopia-linux.png
Oops, something went wrong.
Binary file added
BIN
+18 KB
...e.test.ts-snapshots/Blankslate-With-Secondary-Action-light-colorblind-linux.png
Oops, something went wrong.
Binary file added
BIN
+18 KB
...est.ts-snapshots/Blankslate-With-Secondary-Action-light-high-contrast-linux.png
Oops, something went wrong.
Binary file added
BIN
+18 KB
...s/Blankslate.test.ts-snapshots/Blankslate-With-Secondary-Action-light-linux.png
Oops, something went wrong.
Binary file added
BIN
+18 KB
...e.test.ts-snapshots/Blankslate-With-Secondary-Action-light-tritanopia-linux.png
Oops, something went wrong.
Binary file added
BIN
+16.8 KB
...st.ts-snapshots/Blankslate-With-Secondary-Action-primer-breakpoint-sm-linux.png
Oops, something went wrong.
Binary file added
BIN
+15.6 KB
...s/Blankslate.test.ts-snapshots/Blankslate-With-Visual-dark-colorblind-linux.png
Oops, something went wrong.
Binary file added
BIN
+15.4 KB
...nents/Blankslate.test.ts-snapshots/Blankslate-With-Visual-dark-dimmed-linux.png
Oops, something went wrong.
Binary file added
BIN
+15.4 KB
...lankslate.test.ts-snapshots/Blankslate-With-Visual-dark-high-contrast-linux.png
Oops, something went wrong.
Binary file added
BIN
+15.6 KB
...s/components/Blankslate.test.ts-snapshots/Blankslate-With-Visual-dark-linux.png
Oops, something went wrong.
Binary file added
BIN
+15.6 KB
...s/Blankslate.test.ts-snapshots/Blankslate-With-Visual-dark-tritanopia-linux.png
Oops, something went wrong.
Binary file added
BIN
+15.6 KB
.../Blankslate.test.ts-snapshots/Blankslate-With-Visual-light-colorblind-linux.png
Oops, something went wrong.
Binary file added
BIN
+15.4 KB
...ankslate.test.ts-snapshots/Blankslate-With-Visual-light-high-contrast-linux.png
Oops, something went wrong.
Binary file added
BIN
+15.6 KB
.../components/Blankslate.test.ts-snapshots/Blankslate-With-Visual-light-linux.png
Oops, something went wrong.
Binary file added
BIN
+15.6 KB
.../Blankslate.test.ts-snapshots/Blankslate-With-Visual-light-tritanopia-linux.png
Oops, something went wrong.
Binary file added
BIN
+14.5 KB
...nkslate.test.ts-snapshots/Blankslate-With-Visual-primer-breakpoint-sm-linux.png
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,92 @@ | ||
import {test, expect} from '@playwright/test' | ||
import {visit} from '../test-helpers/storybook' | ||
import {themes} from '../test-helpers/themes' | ||
import {viewports} from '../test-helpers/viewports' | ||
|
||
const stories: Array<{title: string; id: string; viewports?: Array<keyof typeof viewports>}> = [ | ||
{ | ||
title: 'Default', | ||
id: 'drafts-components-blankslate--default', | ||
viewports: ['primer.breakpoint.xs', 'primer.breakpoint.sm'], | ||
}, | ||
{ | ||
title: 'Narrow', | ||
id: 'drafts-components-blankslate-features--narrow', | ||
viewports: ['primer.breakpoint.xs', 'primer.breakpoint.sm'], | ||
}, | ||
{ | ||
title: 'Spacious', | ||
id: 'drafts-components-blankslate-features--spacious', | ||
viewports: ['primer.breakpoint.xs', 'primer.breakpoint.sm'], | ||
}, | ||
{ | ||
title: 'With Border', | ||
id: 'drafts-components-blankslate-features--with-border', | ||
viewports: ['primer.breakpoint.sm'], | ||
}, | ||
{ | ||
title: 'With Primary Action', | ||
id: 'drafts-components-blankslate-features--with-primary-action', | ||
viewports: ['primer.breakpoint.sm'], | ||
}, | ||
{ | ||
title: 'With Secondary Action', | ||
id: 'drafts-components-blankslate-features--with-secondary-action', | ||
viewports: ['primer.breakpoint.sm'], | ||
}, | ||
{ | ||
title: 'With Visual', | ||
id: 'drafts-components-blankslate-features--with-visual', | ||
viewports: ['primer.breakpoint.sm'], | ||
}, | ||
] | ||
|
||
test.describe('Blankslate', () => { | ||
for (const story of stories) { | ||
test.describe(story.title, () => { | ||
for (const theme of themes) { | ||
test.describe(theme, () => { | ||
test('default @vrt', async ({page}) => { | ||
await visit(page, { | ||
id: story.id, | ||
globals: { | ||
colorScheme: theme, | ||
}, | ||
}) | ||
|
||
// Default state | ||
expect(await page.screenshot()).toMatchSnapshot(`Blankslate.${story.title}.${theme}.png`) | ||
}) | ||
|
||
test('axe @aat', async ({page}) => { | ||
await visit(page, { | ||
id: story.id, | ||
globals: { | ||
colorScheme: theme, | ||
}, | ||
}) | ||
await expect(page).toHaveNoViolations() | ||
}) | ||
}) | ||
} | ||
|
||
if (story.viewports) { | ||
for (const name of story.viewports) { | ||
test(`${name} @vrt`, async ({page}) => { | ||
await visit(page, { | ||
id: story.id, | ||
globals: {}, | ||
}) | ||
const width = viewports[name] | ||
|
||
await page.setViewportSize({ | ||
width, | ||
height: 667, | ||
}) | ||
expect(await page.screenshot()).toMatchSnapshot(`Blankslate.${story.title}.${name}.png`) | ||
}) | ||
} | ||
} | ||
}) | ||
} | ||
}) |