From e48f9859c8cc55198b1d97a1258003090d438015 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc-Andr=C3=A9=20Bombeck?= Date: Wed, 8 Jul 2026 22:50:00 +0200 Subject: [PATCH] test(e2e): widen step-transition and provenance assertion timeouts MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The wizard step-advance and the AI-read card marker are gated on async settles (per-step validation; list invalidate→refetch); on a loaded CI runner those exceed the default 5s expect timeout, so the assertion samples a mid-transition frame. Widen just those two assertions to 20s — orthogonal to test.slow() (which extends the test, not the expect, timeout). --- e2e/documents-ai.spec.ts | 7 ++++++- e2e/medications-wizard-helpers.ts | 6 +++++- 2 files changed, 11 insertions(+), 2 deletions(-) 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) {