Skip to content
Source
Sign inSign up

replay-turn-streams.e2e.ts

26 lines936 Bytes

1import { expect } from "e2e";
2​
3import { test, WEB } from "./t3.ts";
4​
5test(
6 "A replayed turn streams a reply, shows its tool calls, and finishes",
7 WEB,
8 async ({ t3, app, screen }) => {
9 await t3.project("demo", { "src/math.ts": "export const sum = 1 + 1;\n" });
10 await t3.open();
11​
12 await screen.getByRole("textbox").fill("Give me a short tour");
13 await screen.getByRole("textbox").press("Enter");
14 const stop = screen.getByRole("button", "Stop generation");
15 await expect(
16 screen.getByText("The project has a single math module", { exact: false }),
17 ).toBeVisible();
18 await expect(stop).toBeVisible();
19 await app.screenshot("streaming");
20​
21 await expect(screen.getByText("This turn is a replay.", { exact: false })).toBeVisible();
22 await expect(stop).toBeHidden();
23 await expect(screen.getByText("Give me a short tour").first()).toBeVisible();
24 await app.screenshot("finished");
25 },
26);