diff --git a/e2e/documents-ai.spec.ts b/e2e/documents-ai.spec.ts index 306218554..a5d269721 100644 --- a/e2e/documents-ai.spec.ts +++ b/e2e/documents-ai.spec.ts @@ -369,7 +369,12 @@ test.describe("document vault — AI assist + content search", () => { const marker = page .locator('[data-slot="document-card"]', { hasText: "Radiology note" }) .locator('[data-slot="document-searchable"]'); - await expect(marker).toHaveAttribute("data-source", "ai-read"); + // The card marker appears after the list query invalidates and refetches + // the new provenance; on a loaded runner that round-trip can outlast the + // default 5s expect timeout, so wait explicitly for it to resolve. + await expect(marker).toHaveAttribute("data-source", "ai-read", { + timeout: 20_000, + }); }); // ── (f) Text-mode refuses a non-image before any OCR/upload ────────────── diff --git a/e2e/medications-wizard-helpers.ts b/e2e/medications-wizard-helpers.ts index 6e75ac063..c2c236e17 100644 --- a/e2e/medications-wizard-helpers.ts +++ b/e2e/medications-wizard-helpers.ts @@ -221,11 +221,15 @@ export async function expectStep( // stepper landed, so it is hidden on the desktop e2e viewport. Assert the // viewport-independent root data-attributes the dialog always carries. const root = page.locator('[data-slot="medication-wizard-dialog"]'); + // Each step advance waits on per-step form validation; on a loaded CI runner + // that settle can exceed the default 5s expect timeout (the dialog sits at + // the prior step when the assertion first samples). Give the step-transition + // assertion room so a slow runner doesn't read a mid-transition frame. await expect(root).toHaveAttribute( "data-display-step", String(displayIndex), { - timeout: 5_000, + timeout: 20_000, }, ); if (totalSteps != null) {