diff --git a/e2e/a11y.spec.ts b/e2e/a11y.spec.ts index 090f940d2..24c98c53a 100644 --- a/e2e/a11y.spec.ts +++ b/e2e/a11y.spec.ts @@ -3,6 +3,7 @@ import type { Locator, Page, Route } from "@playwright/test"; import { expect, test } from "./setup/test"; import { STORAGE_STATE_PATH } from "./setup/global-setup"; +import { openMenu } from "./open-menu"; import { POPULATED_SUMMARIES } from "./utils/mock-dashboard-snapshot"; type AxeViolation = Awaited< @@ -902,10 +903,12 @@ test.describe("axe-core authenticated route and state matrix", () => { await expect(page.locator('[data-slot="lab-list"]')).toBeVisible({ timeout: 15_000, }); - await page - .locator('#main-content [data-slot="dropdown-menu-trigger"]') - .first() - .click(); + await openMenu( + page, + page + .locator('#main-content [data-slot="dropdown-menu-trigger"]') + .first(), + ); await page.getByRole("menuitem").first().click(); const sheet = page.locator('[data-slot="responsive-sheet-content"]'); await expect(sheet.locator('input[type="file"]')).toHaveCount(1); @@ -947,10 +950,12 @@ test.describe("axe-core authenticated route and state matrix", () => { await expect(page.locator("[data-medication-id]").first()).toBeVisible({ timeout: 15_000, }); - await page - .locator('#main-content [data-slot="dropdown-menu-trigger"]') - .first() - .click(); + await openMenu( + page, + page + .locator('#main-content [data-slot="dropdown-menu-trigger"]') + .first(), + ); await page.getByRole("menuitem").last().click(); const dialog = page.locator('[data-slot="medication-wizard-dialog"]'); blocking.push( diff --git a/e2e/measurement-flow.spec.ts b/e2e/measurement-flow.spec.ts index 8457cf0e1..39e20f7db 100644 --- a/e2e/measurement-flow.spec.ts +++ b/e2e/measurement-flow.spec.ts @@ -1,6 +1,7 @@ import { expect, test } from "./setup/test"; import { STORAGE_STATE_PATH } from "./setup/global-setup"; +import { openMenu } from "./open-menu"; /** * Add-measurement flow — exercises the dashboard's quick-entry dropdown, @@ -109,10 +110,12 @@ test.describe("add measurement flow", () => { // at the top-right of `
`. Scope the locator there so we don't // accidentally match an "Add" button on the sidebar. const main = page.locator("main"); - await main - .getByRole("button", { name: /^add$|hinzufügen|hinzufuegen/i }) - .first() - .click(); + await openMenu( + page, + main + .getByRole("button", { name: /^add$|hinzufügen|hinzufuegen/i }) + .first(), + ); // v1.5 phase-5: the menu items now have distinct labels — the // measurement entry says "Measurement" / "Messung" instead of "Add",