diff --git a/e2e/global.setup.ts b/e2e/global.setup.ts index 85f15a3d..26198ba4 100644 --- a/e2e/global.setup.ts +++ b/e2e/global.setup.ts @@ -2,5 +2,8 @@ import { test as setup } from '@playwright/test'; setup("remove Storybook 'what's new' popup", async ({ page }) => { await page.goto('/'); - await page.getByRole('button', { name: 'Dismiss notification' }).click(); + + if (await page.isVisible("button:has-text('Dismiss notification')")) { + await page.getByRole('button', { name: 'Dismiss notification' }).click(); + } });