test(ui): pause fake clock before send so working-timer e2e assertions are deterministic (#115187)

This commit is contained in:
Peter Steinberger
2026-07-28 08:49:57 -04:00
committed by GitHub
parent 0cb56ace62
commit f8283ef15b
2 changed files with 8 additions and 0 deletions
@@ -109,6 +109,10 @@ describeControlUiE2e("Control UI chat run lifecycle", () => {
await currentPage.goto(`${server?.baseUrl ?? ""}chat`);
await currentPage.getByText("saved 875.3k tokens", { exact: true }).waitFor();
await currentPage.locator(".agent-chat__input textarea").fill("keep working");
// Pause the virtual clock before sending: the working timer starts at the
// send click, and an unpaused installed clock still ticks in real time,
// letting slow CI inflate the fast-forwarded "2m 57s" to "2m 59s".
await currentPage.clock.pauseAt((await currentPage.evaluate(() => Date.now())) + 5_000);
await currentPage.getByRole("button", { name: "Send message" }).click();
await gateway.waitForRequest("chat.send");
await currentPage.locator(".chat-working-indicator").waitFor();
+4
View File
@@ -96,6 +96,10 @@ describeMantisWebUiChat("Mantis Control UI web chat proof", () => {
await page.goto(`${server.baseUrl}chat`);
await page.getByText("Mantis web UI proof is ready.").waitFor({ timeout: 10_000 });
await page.locator(".agent-chat__composer-combobox textarea").fill(prompt);
// Pause the virtual clock before sending: the working timer starts at the
// send click, and an unpaused installed clock still ticks in real time,
// letting slow CI inflate the fast-forwarded "2m 57s" to "2m 59s".
await page.clock.pauseAt((await page.evaluate(() => Date.now())) + 5_000);
await page.getByRole("button", { name: "Send message" }).click();
const sendRequest = await gateway.waitForRequest("chat.send");