Skip to content

Commit d4a8882

Browse files
committed
test(ui): pause fake clock before send so working-timer e2e assertions are deterministic
1 parent 10c6c0c commit d4a8882

2 files changed

Lines changed: 8 additions & 0 deletions

File tree

‎ui/src/e2e/chat-run-lifecycle.e2e.test.ts‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,10 @@ describeControlUiE2e("Control UI chat run lifecycle", () => {
109109
await currentPage.goto(`${server?.baseUrl ?? ""}chat`);
110110
await currentPage.getByText("saved 875.3k tokens", { exact: true }).waitFor();
111111
await currentPage.locator(".agent-chat__input textarea").fill("keep working");
112+
// Pause the virtual clock before sending: the working timer starts at the
113+
// send click, and an unpaused installed clock still ticks in real time,
114+
// letting slow CI inflate the fast-forwarded "2m 57s" to "2m 59s".
115+
await currentPage.clock.pauseAt((await currentPage.evaluate(() => Date.now())) + 5_000);
112116
await currentPage.getByRole("button", { name: "Send message" }).click();
113117
await gateway.waitForRequest("chat.send");
114118
await currentPage.locator(".chat-working-indicator").waitFor();

‎ui/src/e2e/mantis-chat-proof.e2e.test.ts‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,10 @@ describeMantisWebUiChat("Mantis Control UI web chat proof", () => {
9696
await page.goto(`${server.baseUrl}chat`);
9797
await page.getByText("Mantis web UI proof is ready.").waitFor({ timeout: 10_000 });
9898
await page.locator(".agent-chat__composer-combobox textarea").fill(prompt);
99+
// Pause the virtual clock before sending: the working timer starts at the
100+
// send click, and an unpaused installed clock still ticks in real time,
101+
// letting slow CI inflate the fast-forwarded "2m 57s" to "2m 59s".
102+
await page.clock.pauseAt((await page.evaluate(() => Date.now())) + 5_000);
99103
await page.getByRole("button", { name: "Send message" }).click();
100104

101105
const sendRequest = await gateway.waitForRequest("chat.send");

0 commit comments

Comments
 (0)