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.
This commit is contained in:
Amruth Pillai
2026-09-29 01:29:12 +02:00
parent 9062114379
commit 82e2c92a51
2 changed files with 6 additions and 2 deletions
+5 -1
View File
@@ -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 ({
+1 -1
View File
@@ -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/);
});