From 9d6d85cb520e959e8bc19a36c853c95ab1fb98ef Mon Sep 17 00:00:00 2001 From: Claude Date: Sun, 4 Oct 2026 04:34:57 +0000 Subject: [PATCH] test(web): look for the focus question in the conversation, not the sidebar The main conversation's sidebar row now shows the pending intake question, so a page-wide text match finds it twice (strict mode) or never reaches zero. The specs mean the card in the open conversation, so they look there. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01MRtGG9ARfqqhma3t85Ro2u --- apps/web/e2e/message-hover-actions.spec.ts | 8 ++++-- apps/web/e2e/new-bot-ux.spec.ts | 28 +++++++++++++++----- apps/web/e2e/onboarding-conversation.spec.ts | 4 ++- 3 files changed, 30 insertions(+), 10 deletions(-) diff --git a/apps/web/e2e/message-hover-actions.spec.ts b/apps/web/e2e/message-hover-actions.spec.ts index 7ebbbf6..ab6d797 100644 --- a/apps/web/e2e/message-hover-actions.spec.ts +++ b/apps/web/e2e/message-hover-actions.spec.ts @@ -75,7 +75,9 @@ test("message hover shows beside-bubble actions; reply links to parent", async ( // Empty start: no Fresh-start greeting. Answer the focus card, then ask something long: a bot // row's rail sits at the row's end, so the measured reply must wrap and fill its row. - await expect(page.getByText("What do you want me on first?", { exact: true })).toBeVisible({ + await expect( + page.getByTestId("transcript").getByText("What do you want me on first?", { exact: true }), + ).toBeVisible({ timeout: 20_000, }); await page.getByTestId("focus-choice-day").click(); @@ -396,7 +398,9 @@ test.describe("touch message actions", () => { expect( await page.evaluate(() => matchMedia("(hover: hover) and (pointer: fine)").matches), ).toBe(false); - await expect(page.getByText("What do you want me on first?", { exact: true })).toBeVisible({ + await expect( + page.getByTestId("transcript").getByText("What do you want me on first?", { exact: true }), + ).toBeVisible({ timeout: 20_000, }); await page.getByTestId("focus-choice-day").click(); diff --git a/apps/web/e2e/new-bot-ux.spec.ts b/apps/web/e2e/new-bot-ux.spec.ts index 68bc135..35645fb 100644 --- a/apps/web/e2e/new-bot-ux.spec.ts +++ b/apps/web/e2e/new-bot-ux.spec.ts @@ -42,7 +42,9 @@ test("create opens form, then empty chat; picker lists bots; sidebar collapses", await page.waitForURL(/\/app\/[^/]+$/); await expect(page.getByRole("combobox", { name: "Message" })).toBeVisible(); await expect(page.getByTestId("side-panel")).toHaveAttribute("data-panel", "closed"); - await expect(page.getByText("What do you want me on first?", { exact: true })).toHaveCount(0); + await expect( + page.getByTestId("transcript").getByText("What do you want me on first?", { exact: true }), + ).toHaveCount(0); await expect( page.getByTestId("transcript").getByText("Start the conversation — New Bot is on stage above."), ).toBeVisible(); @@ -117,20 +119,30 @@ test("later bot waits before showing the focus card; sending cancels it", async await signup(page, `focus-delay-${stamp}@rakazo.test`, "password12", "Focus Delay"); await completeOnboarding(page, undefined, { mainConversation: true }); // The main bot shows the focus card immediately in the main conversation. - await expect(page.getByText("What do you want me on first?", { exact: true })).toBeVisible(); + await expect( + page.getByTestId("transcript").getByText("What do you want me on first?", { exact: true }), + ).toBeVisible(); await page.clock.install(); await createBotFromPicker(page); await expect(page.getByRole("combobox", { name: "Message" })).toBeVisible(); - await expect(page.getByText("What do you want me on first?", { exact: true })).toHaveCount(0); + await expect( + page.getByTestId("transcript").getByText("What do you want me on first?", { exact: true }), + ).toHaveCount(0); await page.clock.fastForward(9_000); - await expect(page.getByText("What do you want me on first?", { exact: true })).toHaveCount(0); + await expect( + page.getByTestId("transcript").getByText("What do you want me on first?", { exact: true }), + ).toHaveCount(0); await page.clock.fastForward(1_500); - await expect(page.getByText("What do you want me on first?", { exact: true })).toBeVisible(); + await expect( + page.getByTestId("transcript").getByText("What do you want me on first?", { exact: true }), + ).toBeVisible(); await createBotFromPicker(page, { name: "Later Bot" }); - await expect(page.getByText("What do you want me on first?", { exact: true })).toHaveCount(0); + await expect( + page.getByTestId("transcript").getByText("What do you want me on first?", { exact: true }), + ).toHaveCount(0); const composer = page.getByPlaceholder(/Message/); await composer.fill("I'll set this up myself"); // Send must finish before the delay is advanced: cancel runs after a successful @@ -144,7 +156,9 @@ test("later bot waits before showing the focus card; sending cancels it", async page.getByTestId("transcript").getByText("I'll set this up myself").first(), ).toBeVisible(); await page.clock.fastForward(12_000); - await expect(page.getByText("What do you want me on first?", { exact: true })).toHaveCount(0); + await expect( + page.getByTestId("transcript").getByText("What do you want me on first?", { exact: true }), + ).toHaveCount(0); }); test("plus picker can create a Private computer bot", async ({ page }, testInfo) => { diff --git a/apps/web/e2e/onboarding-conversation.spec.ts b/apps/web/e2e/onboarding-conversation.spec.ts index 7e78720..7809caa 100644 --- a/apps/web/e2e/onboarding-conversation.spec.ts +++ b/apps/web/e2e/onboarding-conversation.spec.ts @@ -16,7 +16,9 @@ test("focus choice suggests apps and preserves a completed connection", async ({ await expect( page.getByText("Hey Robin. Fresh start on my side, so I’ll keep this short."), ).toHaveCount(0); - await expect(page.getByText("What do you want me on first?", { exact: true })).toBeVisible(); + await expect( + page.getByTestId("transcript").getByText("What do you want me on first?", { exact: true }), + ).toBeVisible(); await expect(page.getByTestId("focus-choice-day")).toBeVisible(); await expect(page.getByTestId("focus-choice-day")).toContainText("Day-to-day work"); await expect(page.getByTestId("focus-choice-research")).toContainText("Research & writing");