Skip to content

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

Description

@alltomatos

`e2e/regression/subagent-child-navigation.spec.ts`'s "shows the not found fallback when the viewed session is deleted" fails consistently on `unit (windows)`/`e2e (windows)` and `e2e (linux)` CI jobs (confirmed identically failing on `dev` HEAD baseline, and on unrelated PRs #190/#191 that don't touch this file), always at the same assertion:

```
Error: strict mode violation: getByRole('button', { name: 'Close Tab' }) resolved to 2 elements:
1) <button ... aria-label="Close tab" ...> aka getByRole('button', { name: 'Close tab', exact: true })
2) <button ... data-icon="xmark-small" ...> aka getByRole('button', { name: 'Close Tab', exact: true })


### 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 when a tab is open)
- \`session.error.notFound.closeTab\` → "Close Tab" (the session-not-found fallback's own button)

Playwright's \`getByRole\` name matching is case-insensitive by default, so \`page.getByRole("button", { name: "Close Tab" })\` (no \`exact\`) matches both whenever they're both on screen — which is this test's exact scenario (a tab open, showing the not-found fallback inside it). This is not timing-dependent flakiness; it's a deterministic locator ambiguity in the test, which is why it fails identically on every platform/run.

### Fix

#195 — adds \`exact: true\` to the locator, making the match case-sensitive so it resolves only the fallback's own "Close Tab" button.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions