From bff38927e8679522c483b62bee1765355dbaf062 Mon Sep 17 00:00:00 2001 From: "sentry-junior[bot]" <264270552+sentry-junior[bot]@users.noreply.github.com> Date: Fri, 27 Nov 2026 13:12:33 +0000 Subject: [PATCH] test(dashboard): Wait for the transcript to stop moving a question card before a click A click on a control that the transcript still moves fails Playwright's stability check. Its retry calls scrollIntoView({ block: "end" }) on the control, which scrolls the transcript up from the latest message, so the shot shows another place. In the question card spec, the answered question above the card reads its closed item after the list, and its row grows by 58px. Wait for that record before the clicks. In the unsent answers spec, the card shows below the latest message, and the transcript follows it a frame later. Wait until the card is in full view. Refs getsentry/junior#4176 Co-Authored-By: BYK <126780+BYK@users.noreply.github.com> --- .../e2e/inbox/conversation-inbox-items.spec.ts | 5 +++++ packages/junior-dashboard/e2e/question-cards.spec.ts | 10 ++++++++++ 2 files changed, 15 insertions(+) diff --git a/packages/junior-dashboard/e2e/inbox/conversation-inbox-items.spec.ts b/packages/junior-dashboard/e2e/inbox/conversation-inbox-items.spec.ts index 0980d2ac398..cbaf8f323b6 100644 --- a/packages/junior-dashboard/e2e/inbox/conversation-inbox-items.spec.ts +++ b/packages/junior-dashboard/e2e/inbox/conversation-inbox-items.spec.ts @@ -178,6 +178,11 @@ test.describe("new UI", () => { // The question came from the second page, and its card in the // transcript holds the form. const card = page.getByRole("region", { name: `Asked ${migration.title}` }); + // The card shows below the latest message, and the transcript follows + // it a frame later. A click in that frame finds a moving option, and + // Playwright's retry scrolls the option to the bottom edge, which also + // leaves the latest message. + await expect(card).toBeInViewport({ ratio: 1 }); const approve = card.getByRole("radio", { name: "Approve" }); await approve.click(); await expect(card.getByText("1 of 2 answered")).toBeVisible(); diff --git a/packages/junior-dashboard/e2e/question-cards.spec.ts b/packages/junior-dashboard/e2e/question-cards.spec.ts index 35d5323d563..722afb4a3f5 100644 --- a/packages/junior-dashboard/e2e/question-cards.spec.ts +++ b/packages/junior-dashboard/e2e/question-cards.spec.ts @@ -36,6 +36,16 @@ for (const view of [desktop, mobile]) { name: "Asked Approve the payments-v42 rollout", }); await expect(card).toContainText("Waiting on you"); + if (view === desktop) { + // The answered question above reads its closed item after the list, + // and its row then grows. A click while the transcript follows that + // growth finds a moving button, and Playwright's retry scrolls the + // button to the bottom edge, which leaves the latest message. A phone + // shows the form in a sheet, out of the transcript. + await expect( + page.getByRole("region", { name: "Asked Pick the canary region" }), + ).toBeVisible(); + } // Nothing docks over the message box, and nothing takes the focus. await expect(page.getByRole("region", { name: /^Question:/ })).toHaveCount( 0,