diff --git a/.github/workflows/playwright-hlx.yml b/.github/workflows/playwright-hlx.yml index 139771259..02aed45df 100644 --- a/.github/workflows/playwright-hlx.yml +++ b/.github/workflows/playwright-hlx.yml @@ -7,6 +7,10 @@ on: pull_request: types: [opened, synchronize, reopened] +concurrency: + group: ${{ github.workflow }} + cancel-in-progress: false + permissions: contents: read diff --git a/.github/workflows/playwright.yml b/.github/workflows/playwright.yml index 20822b28a..5bd390dc1 100644 --- a/.github/workflows/playwright.yml +++ b/.github/workflows/playwright.yml @@ -7,6 +7,10 @@ on: pull_request: types: [opened, synchronize, reopened] +concurrency: + group: ${{ github.workflow }} + cancel-in-progress: false + permissions: contents: read diff --git a/test/e2e/utils/utils.js b/test/e2e/utils/utils.js index 42a563deb..1eec8a40d 100644 --- a/test/e2e/utils/utils.js +++ b/test/e2e/utils/utils.js @@ -18,6 +18,7 @@ */ export async function dismissAlertBanner(page) { const alert = page.getByRole('alert'); + const dismiss = () => alert.getByRole('button', { name: 'Dismiss' }).click().catch(() => {}); let visible = await alert.isVisible().catch(() => false); if (!visible) { @@ -28,6 +29,13 @@ export async function dismissAlertBanner(page) { } if (visible) { - await alert.getByRole('button', { name: 'Dismiss' }).click(); + await dismiss(); + } else { + // Some banners (e.g. the "public sandbox" org warning) depend on an async + // check that can resolve well after this initial window, then sit on top + // of later controls (e.g. the preview button) and block clicks. Keep + // watching for a late appearance for the rest of the test instead of + // giving up after a single check. + alert.waitFor({ state: 'visible' }).then(dismiss).catch(() => {}); } }