Skip to content

The fastest, cheapest, most efficient open-source agent harness. Run more than 500 agents on a $10 VPS.

test(e2e): add e2e tests for web channel flow, voice mode, and chat scroll stick

Steven Enamakel3edb7819e47c
diff --git a/app/test/e2e/specs/conversations-web-channel-flow.spec.ts b/app/test/e2e/specs/conversations-web-channel-flow.spec.ts
index 9eea692d85..18a1019357 100644
--- a/app/test/e2e/specs/conversations-web-channel-flow.spec.ts
+++ b/app/test/e2e/specs/conversations-web-channel-flow.spec.ts
@@ -134,13 +134,10 @@ suiteRunner('Conversations web channel flow', () => {
// Count agent message rows by a stable test hook, never by Tailwind
// classes: a restyle would either break this assertion or — worse — make
// it pass vacuously (0 > 0 is false, but 0 === 0 silently hides a
- // transcript that stopped rendering entirely). `data-testid`/`data-sender`
- // live on the message row in ChatThreadView and survive any restyle.
+ // transcript that stopped rendering entirely). `agent-message` is the
+ // assistant-ui message root's testid and survives any restyle.
const countAgentRows = () =>
- browser.execute(
- () =>
- document.querySelectorAll('[data-testid="chat-message-row"][data-sender="agent"]').length
- );
+ browser.execute(() => document.querySelectorAll('[data-testid="agent-message"]').length);
const initialAgentCount = await countAgentRows();
// Guard against the vacuous-pass shape above: the transcript must contain
diff --git a/app/test/e2e/specs/voice-mode.spec.ts b/app/test/e2e/specs/voice-mode.spec.ts
index f9e7d7d40d..f55f89d243 100644
--- a/app/test/e2e/specs/voice-mode.spec.ts
+++ b/app/test/e2e/specs/voice-mode.spec.ts
@@ -678,17 +678,18 @@ describe.skip('Voice mode — Human tab capture & error mapping (#1610)', () =>
// Now assert that no user message bubble in the thread says "beep".
//
- // This assertion used to query `[data-sender="user"], [data-message-sender="user"]`,
- // and NEITHER attribute existed anywhere in `app/src` — the NodeList was
- // always empty, `.some()` was always false, and the guard could never
- // fail no matter what the thread contained. `data-sender` is now a real
- // attribute on the message row in ChatThreadView, so the query matches;
- // the `listMounted` check below is what keeps the assertion from
- // regressing back into a vacuous pass if that hook is ever renamed.
+ // Rows are the assistant-ui transcript's message roots, which carry
+ // `data-role` ("user" / "assistant"). The `listMounted` check below is
+ // what keeps the assertion from regressing into a vacuous pass (an empty
+ // NodeList) if those hooks are ever renamed.
const probe = await browser.execute(() => {
- const listMounted = !!document.querySelector('[data-testid="chat-message-list"]');
- const rows = Array.from(document.querySelectorAll('[data-testid="chat-message-row"]'));
- const userRows = rows.filter(el => el.getAttribute('data-sender') === 'user');
+ const listMounted = !!document.querySelector('[data-slot="aui_thread-viewport"]');
+ const rows = Array.from(
+ document.querySelectorAll(
+ '[data-slot="aui_user-message-root"], [data-slot="aui_assistant-message-root"]'
+ )
+ );
+ const userRows = rows.filter(el => el.getAttribute('data-role') === 'user');
const hasBeep = (el: Element) =>
(el as HTMLElement).textContent?.toLowerCase().includes('beep') ?? false;
return {
diff --git a/app/test/playwright/specs/chat-scroll-stick.spec.ts b/app/test/playwright/specs/chat-scroll-stick.spec.ts
index d5c51c3103..3498891622 100644
--- a/app/test/playwright/specs/chat-scroll-stick.spec.ts
+++ b/app/test/playwright/specs/chat-scroll-stick.spec.ts
@@ -23,10 +23,8 @@
*
* Everything is measured from the live scroll container, not from mock calls.
*
- * **The container has no testid on the shipped path.** `chat-messages-scroll`
- * belongs to `ChatThreadView` (the legacy composer's transcript);
- * `Conversations.tsx:2539` renders the assistant-ui panel by default, whose
- * viewport is `thread.tsx:226` — `relative flex flex-1 flex-col
+ * **The container has no testid on the shipped path.** Every chat surface
+ * renders the assistant-ui `Thread`, whose viewport (`thread.tsx`) is — `relative flex flex-1 flex-col
* overflow-x-auto overflow-y-scroll scroll-smooth`, with no testid. Rather
* than pin a Tailwind string, this walks up from the composer input and takes
* the first ancestor that actually scrolls, and throws if there is none — so a
@@ -271,8 +269,7 @@ test.describe('Chat transcript stick-to-bottom', () => {
// bottom-follow behaviour, but disables its unconditional run-start scroll.
// That lets a reader who has scrolled up keep their place while a reader at
// the bottom follows the new turn. Do not assert an exact bottom distance
- // here; `useStickToBottom`'s 80px threshold belongs to the legacy
- // `ChatThreadView`, not this viewport.
+ // here; the follow threshold is an implementation detail of this viewport.
//
// What the user actually needs is that the new turn is brought into view,
// and that is what this asserts.