import AxeBuilder from "@axe-core/playwright"; import { expect, test, } from "../support/browser/strict-browser-test.ts"; test("runs the isolated overlay interaction with blocking accessibility", async ({ page, }) => { // The a11y addon runs axe on its own after the story renders unless the // a11y global is manual. Its run and AxeBuilder's below share the page's axe // instance, so the second one failed with "Axe is already running" whenever // they overlapped. This test owns the accessibility check. await page.goto( "/iframe.html?id=platform-design-system--overlay-interaction&viewMode=story&globals=a11y.manual:!true", ); const trigger = page.getByRole("button", { name: "Open dialog" }); await expect(trigger).toBeVisible(); await trigger.click(); await expect( page.getByRole("dialog", { name: "Confirm platform action" }), ).toBeVisible(); const results = await new AxeBuilder({ page }).analyze(); expect(results.violations).toEqual([]); await page.keyboard.press("Escape"); await expect(trigger).toBeFocused(); });