Skip to content

fix(e2e): disambiguate Close Tab locator in subagent-child-navigation spec - #204

Merged
alltomatos merged 1 commit into
devfrom
claude/fix-subagent-child-e2e-close-tab-strict-mode
Sep 12, 2026
Merged

alltomatos merged 1 commit into
devfrom
claude/fix-subagent-child-e2e-close-tab-strict-mode

Conversation

@alltomatos

Copy link
Copy Markdown
Owner

Issue for this PR

Closes #195

Type of change

  • Bug fix
  • New feature
  • Refactor / code improvement
  • Documentation

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 no exact option. 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?

  • Reproduced the failure locally: bunx playwright test e2e/regression/subagent-child-navigation.spec.ts --project=chromium failed with the exact strict-mode violation seen in CI.
  • Applied the fix and reran the spec 10 times (--repeat-each=5 for both tests in the file): all 10 runs passed.
  • Ran bun run typecheck (via the pre-push hook, bun turbo typecheck): all 30 packages passed.
  • No app source (packages/app/src) was touched — this is a test-only fix.

Screenshots / recordings

N/A — e2e test-only change, not a UI change.

Checklist

  • I have tested my changes locally
  • I have not included unrelated changes in this PR

🤖 Generated with Claude Code

… 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]>
@alltomatos
alltomatos merged commit 4eff01f into dev Sep 12, 2026
8 of 10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

e2e: subagent-child-navigation 'not found fallback' fails with Close Tab strict-mode violation on all CI platforms

1 participant