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/); });