From 82e2c92a51aabb1226812db2ac516f5edf02d6ae Mon Sep 17 00:00:00 2001 From: Amruth Pillai Date: Tue, 29 Sep 2026 01:29:12 +0200 Subject: [PATCH] test(e2e): wait for the assistant to settle and for focus to return Enter in the composer is ignored until the previous reply has finished, so the helper presses again until the message goes; the palette's focus return is polled rather than read once. --- tests/e2e/specs/assistant.spec.ts | 6 +++++- tests/e2e/specs/keyboard.spec.ts | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/tests/e2e/specs/assistant.spec.ts b/tests/e2e/specs/assistant.spec.ts index 92d26cc7f..39a231f18 100644 --- a/tests/e2e/specs/assistant.spec.ts +++ b/tests/e2e/specs/assistant.spec.ts @@ -37,7 +37,11 @@ async function send(page: Page, text: string) { await expect(page.getByRole("button", { name: "Send" }).last()).toBeVisible({ timeout: 20_000 }); const composer = page.getByLabel("Message the assistant"); await composer.fill(text); - await composer.press("Enter"); + // Enter is ignored until the previous reply has fully settled; the text stays, so press again. + await expect(async () => { + if ((await composer.inputValue()) !== "") await composer.press("Enter"); + await expect(composer).toHaveValue("", { timeout: 1_000 }); + }).toPass({ timeout: 20_000 }); } test("proposes edits that change nothing until accepted, asks before assuming, and stops", async ({ diff --git a/tests/e2e/specs/keyboard.spec.ts b/tests/e2e/specs/keyboard.spec.ts index 9a56c1bed..8d9d7caf9 100644 --- a/tests/e2e/specs/keyboard.spec.ts +++ b/tests/e2e/specs/keyboard.spec.ts @@ -45,5 +45,5 @@ test("sheets, panels and dialogs return focus to what opened them", async ({ aut await page.keyboard.press("Enter"); await expect(page.getByRole("dialog")).toBeVisible(); await page.keyboard.press("Escape"); - expect(await focusedName(page)).toMatch(/Search or run/); + await expect.poll(() => focusedName(page)).toMatch(/Search or run/); });