From e351e8a1a44541c8e7e6dd8e778fc87092b0b2c5 Mon Sep 17 00:00:00 2001 From: Danny White <3104761+dnywh@users.noreply.github.com> Date: Wed, 9 Sep 2026 15:07:35 +1000 Subject: [PATCH] test(studio): scope realtime broadcast helper (#50164) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ## What kind of change does this PR introduce? Bug fix ## What is the current behavior? The Realtime Inspector has two buttons named “Broadcast a message” after joining a channel: one in the listening status toolbar and one in the empty grid state. The shared E2E helper matches both and fails with a Playwright strict mode violation. ## What is the new behavior? The helper scopes the action to the listening status region, where the persistent broadcast control lives. ## To test Run the Realtime Inspector E2E tests: ```bash pnpm --prefix e2e/studio run e2e -- features/realtime-inspector.spec.ts ## Summary by CodeRabbit * **Tests** * Improved end-to-end test reliability when opening the broadcast message modal. --- e2e/studio/utils/realtime-helpers.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/e2e/studio/utils/realtime-helpers.ts b/e2e/studio/utils/realtime-helpers.ts index e1729f2c8f7..d58dba5397f 100644 --- a/e2e/studio/utils/realtime-helpers.ts +++ b/e2e/studio/utils/realtime-helpers.ts @@ -36,7 +36,9 @@ export async function stopListening(page: Page) { } export async function openBroadcastModal(page: Page) { - const broadcastButton = page.getByRole('button', { name: 'Broadcast a message' }) + const broadcastButton = page + .getByRole('status') + .getByRole('button', { name: 'Broadcast a message' }) await expect(broadcastButton).toBeVisible({ timeout: 5000 }) await broadcastButton.click() await expect(page.getByText('Broadcast a message to all clients')).toBeVisible({ timeout: 5000 })