Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 2 additions & 3 deletions e2e/components/SelectPanel.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,6 @@ test.describe('SelectPanel', () => {
if (scenario.story.visual !== false) {
test(`${name} @vrt ${theme}`, async ({page}) => {
await visit(page, {id: scenario.story.id, globals})
await page.emulateMedia({reducedMotion: 'reduce'})

// Open select panel
const isPanelOpen = await page.locator('[role="listbox"]').isVisible()
Expand Down Expand Up @@ -95,7 +94,7 @@ test.describe('SelectPanel', () => {
}

// windows high contrast mode: light
await page.emulateMedia({forcedColors: 'active', colorScheme: 'light', reducedMotion: 'reduce'})
await page.emulateMedia({forcedColors: 'active', colorScheme: 'light'})
await page.getByRole('listbox').waitFor({state: 'visible'})
await expect(page.locator('body')).toHaveCSS('background-color', 'rgb(255, 255, 255)')

Expand All @@ -104,7 +103,7 @@ test.describe('SelectPanel', () => {
)

// windows high contrast mode: dark
await page.emulateMedia({forcedColors: 'active', colorScheme: 'dark', reducedMotion: 'reduce'})
await page.emulateMedia({forcedColors: 'active', colorScheme: 'dark'})
await page.getByRole('listbox').waitFor({state: 'visible'})
await expect(page.locator('body')).toHaveCSS('background-color', 'rgb(0, 0, 0)')

Expand Down
1 change: 0 additions & 1 deletion e2e/components/TooltipV2.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,6 @@ test.describe('TooltipV2', () => {

// Default state
await page.keyboard.press('Tab')
await page.emulateMedia({reducedMotion: 'reduce'})
await expect(page).toHaveScreenshot(`TooltipV2.${story.title}.${theme}.png`)
})
})
Expand Down
3 changes: 3 additions & 0 deletions e2e/test-helpers/storybook.ts
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,9 @@ async function visit(page: Page, options: Options) {
await page.goto(url.toString())
await page.waitForSelector('body.sb-show-main:not(.sb-show-preparing-story)')
await page.waitForSelector('#storybook-root > *', {state: 'attached'})
await page.evaluate(async () => {
await document.fonts.ready
})

await waitForImages(page)
}
Expand Down
3 changes: 3 additions & 0 deletions playwright.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@ export default defineConfig({
forbidOnly: !!process.env.CI,
retries: process.env.CI ? 2 : 0,
use: {
contextOptions: {
reducedMotion: 'reduce',
},
Comment thread
joshblack marked this conversation as resolved.
screenshot: 'only-on-failure',
viewport: {
// Large breakpoint
Expand Down
Loading