Files
dev/scripts/scenarios/replay-turn-streams.e2e.ts

27 lines
948 B
TypeScript

import { expect } from "e2e";
import { test, WEB } from "./hanzo.ts";
test(
"A replayed turn streams a reply, shows its tool calls, and finishes",
WEB,
async ({ hanzo, app, screen }) => {
await hanzo.project("demo", { "src/math.ts": "export const sum = 1 + 1;\n" });
await hanzo.open();
await screen.getByRole("textbox").fill("Give me a short tour");
await screen.getByRole("textbox").press("Enter");
const stop = screen.getByRole("button", "Stop generation");
await expect(
screen.getByText("The project has a single math module", { exact: false }),
).toBeVisible();
await expect(stop).toBeVisible();
await app.screenshot("streaming");
await expect(screen.getByText("This turn is a replay.", { exact: false })).toBeVisible();
await expect(stop).toBeHidden();
await expect(screen.getByText("Give me a short tour").first()).toBeVisible();
await app.screenshot("finished");
},
);