From 478589f077bcbc9cdbec5846d5b23f75e9184634 Mon Sep 17 00:00:00 2001 From: antianqi <75944423+antianqi@users.noreply.github.com> Date: Tue, 10 Nov 2026 21:09:42 +0800 Subject: [PATCH] test(webui): give the first-screen wait the budget this file already sets The file documents a 30s first-screen budget in FIRST_SCREEN_TIMEOUT_MS and uses it in six places. The two waits on #webui-root were left on Playwright's 5s default, and those two are the waits that decide whether the client booted at all: an empty #webui-root is what a client that has not rendered looks like, and "hidden" is what an empty div reports. This file's own header carries the measurement. On the macOS CI run of the whole webui group this case measured 26.7s with the shell still not up when the default deadline expired, against 12.0s for the same case on ubuntu. The same case is what fails the macOS and windows jobs of the main CI run, with the report that the locator resolved to an empty #webui-root fourteen times and a 5000ms timeout. Waiting to the budget the file already sets is what the six sibling waits do, and it stays bounded: the case still fails when the client does not boot. An injected wait on an element that never appears fails in 3s with the same element-not-found report, so the budget gives a slow client the room the product's own 30s wire deadline allows without hiding a real failure. The whole file passes with the change (4 passed). Co-Authored-By: Claude Opus 4.8 (1M context) --- packages/webui/test/integration/agent-transcript.test.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/webui/test/integration/agent-transcript.test.ts b/packages/webui/test/integration/agent-transcript.test.ts index 2469a187..e411b2fd 100644 --- a/packages/webui/test/integration/agent-transcript.test.ts +++ b/packages/webui/test/integration/agent-transcript.test.ts @@ -546,7 +546,7 @@ it.each(["transcript", "cross-client", "external-active-mutation", "external-act await page.context().grantPermissions(["clipboard-read", "clipboard-write"], { origin: new URL(url).origin, }); - await browserExpect(page.locator("#webui-root")).toBeVisible(); + await browserExpect(page.locator("#webui-root")).toBeVisible({ timeout: FIRST_SCREEN_TIMEOUT_MS }); // The event channel opens as the client boots, so this wait is bounded by // the boot budget the file already documents — not by the default 5s, which // a loaded runner can pass without the client having started at all. @@ -859,7 +859,7 @@ it.each(["transcript", "cross-client", "external-active-mutation", "external-act // message is part of that condition: it can only be on screen once the // reloaded client has resumed the session and rendered what it read back. await browserExpect(composer).toBeVisible({ timeout: FIRST_SCREEN_TIMEOUT_MS }); - await browserExpect(page.locator("#webui-root")).toBeVisible(); + await browserExpect(page.locator("#webui-root")).toBeVisible({ timeout: FIRST_SCREEN_TIMEOUT_MS }); await browserExpect(page.getByText("Please reason, then answer.")).toBeVisible(); try { await browserExpect.poll(() => requests.filter((request) => request.operation === "resumeSession").length)