fix(e2e): disambiguate Close Tab locator in subagent-child-navigation spec - #204
Merged
alltomatos merged 1 commit intoSep 12, 2026
Merged
Conversation
… spec
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 <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Issue for this PR
Closes #195
Type of change
What does this PR do?
e2e/regression/subagent-child-navigation.spec.ts's "shows the not found fallback when the viewed session is deleted" test failed consistently (not flakily — same spec, same failure, every run/platform) on unrelated PR #202's CI, and reproduced identically on a full rerun.Root cause: two different i18n keys produce accessible names that differ only by case:
common.closeTab→ "Close tab" (the tab strip's own close-tab icon button, always present while a tab is open)session.error.notFound.closeTab→ "Close Tab" (the not-found fallback's own action button)The test's
page.getByRole("button", { name: "Close Tab" })had noexactoption. Playwright's role-name matching is case-insensitive by default, so this locator matched both buttons whenever the fallback was shown inside an open tab — exactly this test's scenario — producing a deterministic strict-mode violation ("resolved to 2 elements"). This is a test locator bug, not an app regression: the underlying "not found" fallback logic (session-lineage.ts/session-components.tsx) behaves correctly.The fix adds
exact: true, which is the existing convention used elsewhere in this test suite for disambiguating near-identical accessible names/text.How did you verify your code works?
bunx playwright test e2e/regression/subagent-child-navigation.spec.ts --project=chromiumfailed with the exact strict-mode violation seen in CI.--repeat-each=5for both tests in the file): all 10 runs passed.bun run typecheck(via the pre-push hook,bun turbo typecheck): all 30 packages passed.packages/app/src) was touched — this is a test-only fix.Screenshots / recordings
N/A — e2e test-only change, not a UI change.
Checklist
🤖 Generated with Claude Code