From 882b9dad5bc29d3ba65ae8997ca8213044046834 Mon Sep 17 00:00:00 2001 From: Yichen Jiang Date: Mon, 19 Oct 2026 22:53:14 +0800 Subject: [PATCH] test(web): wait for the Host to accept each queued prompt before the next The composer stays editable while a prompt is sending, so waiting for an editable composer no longer waits for the round trip. Consecutive sends in the queue layout and queued image scenarios now wait until the composer clears, which happens only after the Host accepted the previous prompt. --- apps/web/tests/queue-actions.e2e.ts | 3 ++- apps/web/tests/queue-image.e2e.ts | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/apps/web/tests/queue-actions.e2e.ts b/apps/web/tests/queue-actions.e2e.ts index fb2b79c57d..cc5a25e100 100644 --- a/apps/web/tests/queue-actions.e2e.ts +++ b/apps/web/tests/queue-actions.e2e.ts @@ -363,10 +363,11 @@ describe('web e2e: queue row actions', () => { await page.locator('[data-testid="todo-panel"]').waitFor({ timeout: 10_000 }) for (const text of ['Layout queue first', 'Layout queue second']) { - // A just-submitted composer is read-only for the prompt round-trip. await page.locator('[data-composer-input][contenteditable="true"]').first().waitFor({ timeout: 10_000 }) await input.fill(text) await input.press('Enter') + // The composer keeps a sent message, still editable, until the Host accepts it. + await expect.poll(() => input.textContent(), { timeout: 10_000 }).toBe('') } const queueHeader = page.getByRole('button', { name: '2 queued messages' }) await expect.poll(() => queueHeader.getAttribute('aria-expanded'), { timeout: 10_000 }) diff --git a/apps/web/tests/queue-image.e2e.ts b/apps/web/tests/queue-image.e2e.ts index 075662ea2c..1dcac21ad6 100644 --- a/apps/web/tests/queue-image.e2e.ts +++ b/apps/web/tests/queue-image.e2e.ts @@ -96,7 +96,8 @@ describe('web e2e: queued image submission', () => { await input.press('Enter') await expect.poll(() => existsSync(readyFile), { timeout: 15_000 }).toBe(true) - // A just-submitted composer is read-only for the prompt round-trip. + // The composer keeps the sent prompt, still editable, until the Host accepts it. + await expect.poll(() => input.textContent(), { timeout: 10_000 }).toBe('') await page.locator('[data-composer-input][contenteditable="true"]').first().waitFor({ timeout: 10_000 }) await pasteImage(page, await readFile(PNG)) await page.getByRole('img', { name: 'queued.png' }).waitFor({ timeout: 10_000 })