From 88c345e49f39ed14c88b2c4a456af85e91c7a55d Mon Sep 17 00:00:00 2001 From: Ronaldo Davi Date: Sat, 12 Sep 2026 13:45:27 -0300 Subject: [PATCH] fix(e2e): disambiguate Close Tab locator in subagent-child-navigation spec MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The "shows the not found fallback when the viewed session is deleted" test used getByRole("button", { name: "Close Tab" }) without exact matching. Playwright's role-name matching is case-insensitive by default, so this locator matched both the tab strip's own "Close tab" button (always present while a tab is open) and the not-found fallback's "Close Tab" button, causing a deterministic strict-mode violation on every run/platform — not timing-related flakiness. Add exact: true so the locator resolves only the fallback's button. Closes #195 Co-Authored-By: Claude Sonnet 5 --- .../app/e2e/regression/subagent-child-navigation.spec.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/packages/app/e2e/regression/subagent-child-navigation.spec.ts b/packages/app/e2e/regression/subagent-child-navigation.spec.ts index 019cc156eca1..daecca7aee60 100644 --- a/packages/app/e2e/regression/subagent-child-navigation.spec.ts +++ b/packages/app/e2e/regression/subagent-child-navigation.spec.ts @@ -39,7 +39,11 @@ test("shows the not found fallback when the viewed session is deleted", async ({ }) await expect(page.getByText("This session cannot be found")).toBeVisible() - await expect(page.getByRole("button", { name: "Close Tab" })).toBeVisible() + // The tab strip's own "Close tab" button is always present alongside this + // fallback's "Close Tab" action button; Playwright role-name matching is + // case-insensitive by default, so an exact match is required to avoid a + // strict-mode violation matching both. + await expect(page.getByRole("button", { name: "Close Tab", exact: true })).toBeVisible() await expect(page.getByRole("heading", { name: taskDescription })).toHaveCount(0) })