Repository navigation
fix(e2e): disambiguate Close Tab locator in subagent-child-navigation.spec.ts - #196
Closed
alltomatos wants to merge 1 commit into
Closed
alltomatos wants to merge 1 commit into
alltomatos wants to merge 1 commit into
Conversation
….spec.ts
"shows the not found fallback when the viewed session is deleted" was
failing consistently on both unit(windows)/e2e(windows) and e2e(linux) CI
jobs, always at the same assertion, always with:
Error: strict mode violation: getByRole('button', { name: 'Close Tab' })
resolved to 2 elements
Root cause: two different i18n keys produce near-identical accessible
names — common.closeTab ("Close tab", the tab strip's icon button) and
session.error.notFound.closeTab ("Close Tab", the fallback's own button).
Playwright's getByRole name matching is case-insensitive by default, so
an inexact match matches both buttons whenever they're both on screen —
which is exactly this test's scenario (a tab open + the not-found
fallback rendered in it). This isn't timing-dependent flakiness; it's a
deterministic locator ambiguity in the test itself, which is why it
failed the same way on every CI platform.
Fixed by adding `exact: true`, which makes Playwright's name matching
case-sensitive and resolves only the fallback's "Close Tab" button.
Co-Authored-By: Claude Sonnet 5 <[email protected]>
alltomatos
pushed a commit
that referenced
this pull request
Sep 11, 2026
….spec.ts
The e2e (linux) job on this PR's CI failed with a strict-mode violation:
getByRole('button', { name: 'Close Tab' }) resolves to two elements
whenever a tab is open and showing the not-found fallback, because
Playwright's getByRole name matching is case-insensitive by default and
two different i18n keys produce near-identical accessible names
(common.closeTab -> "Close tab", session.error.notFound.closeTab ->
"Close Tab"). Confirmed this is not caused by this PR's diff (which
doesn't touch packages/app at all): the same failure reproduces
identically on dev HEAD (9ef686e) and on unrelated PRs #190/#191.
A fix already exists as open PR #196 (closes tracking issue #195),
verified there by reproducing the failure and the fix locally. Ported
the same one-line change (adding exact: true) into this PR so CI goes
green here without waiting on #196 to merge first.
Co-Authored-By: Claude Sonnet 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01AGh7o4NA8jUjwakDzZo12e
4 of 6 tasks
Owner
Author
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?
"shows the not found fallback when the viewed session is deleted" was failing consistently on both
unit (windows)/e2e (windows)ande2e (linux)CI jobs — confirmed identically failing ondevHEAD baseline and on unrelated PRs (#190, #191) that don't touch this file — always at the same assertion:Root cause: two different i18n keys produce near-identical accessible names —
common.closeTab→ "Close tab" (the tab strip's own close-tab icon button, always present while a tab is open) andsession.error.notFound.closeTab→ "Close Tab" (the fallback's own button). Playwright'sgetByRolename matching is case-insensitive by default, so an inexact match resolves to both buttons whenever they're both on screen — exactly this test's scenario (a tab open, showing the not-found fallback). This isn't timing-dependent flakiness; it's a deterministic locator ambiguity in the test itself, which is why it failed the same way on every CI platform every time.Fixed by adding
exact: true, which makes Playwright's name matching case-sensitive and resolves only the fallback's "Close Tab" button.How did you verify your code works?
bunx playwright test e2e/regression/subagent-child-navigation.spec.ts -g "shows the not found fallback"fails with the strict-mode violation above, reproduced consistently.bun run typecheck(root, via pre-push hook, all 30 workspace tasks) passes clean.Screenshots / recordings
Not applicable — test-only change, no UI/behavior change.
Checklist