web: ui-smoke — C5 after the composer section re-opens the chat

The merge put main's C5 live-stream section after the C8/C9 composer section,
but the composer section closes its throwaway session and returns to the list,
so no conversation was open for C5 to observe. The C5 section now re-opens the
operator's own session (read-only: real subscribe + history, synthetic frames
injected into the page's socket handler) and waits for its newest history page
to render before replaying, so the history load cannot replace the replayed
turn. `node test/ui-smoke.mjs` is green end to end against
ws://127.0.0.1:8080/connect.
This commit is contained in:
2026-10-19 07:36:47 +01:00
parent 672c988136
commit 27a1605127
+15
View File
@@ -3152,6 +3152,21 @@ try {
// frames replayed below are synthetic, and this log says so explicitly.
step("C5: the live stream — subscribe, replayed chat_event frames, stream state");
await ensureConnected();
// The composer section above closes its throwaway session and returns to the
// list, so no conversation is open here. Re-open the operator's own session to
// observe its live stream — read-only: the `chat_subscribe` and every history
// fetch are real, and the frames below are injected into the page's own socket
// handler rather than sent to the server.
const chatOpen = await page.evaluate(`!!document.querySelector("#chatInput")`);
if (!chatOpen) {
await page.waitForSelector(`#chatRows .chat-row[data-session="${openedId}"]`, { timeout: 15000 });
await page.click(`#chatRows .chat-row[data-session="${openedId}"]`);
await page.waitForSelector("#chatInput", { timeout: 15000 });
// The newest history page arrives asynchronously and its render replaces the
// held messages, so wait for it to land (`#chatTranscript` is rendered only
// once the thread is loaded) before replaying frames into the page.
await page.waitForSelector("#chatTranscript", { timeout: 20000 });
}
await page.evaluate(`document.querySelector("#chatJump")?.click()`);
const chatBadge = () =>