Skip to content

[Bugfix #698] Fix ambiguous team-tab test card locator#699

Merged
waleedkadous merged 6 commits into
mainfrom
builder/bugfix-698
Apr 23, 2026
Merged

[Bugfix #698] Fix ambiguous team-tab test card locator#699
waleedkadous merged 6 commits into
mainfrom
builder/bugfix-698

Conversation

@waleedkadous
Copy link
Copy Markdown
Contributor

@waleedkadous waleedkadous commented Apr 23, 2026

Summary

Fixes #698

Root Cause

packages/codev/src/agent-farm/__tests__/e2e/team-tab.test.ts filtered each team member card by hasText: 'Amr' / hasText: 'Waleed'. After PR #695 shipped review-blocking sentences (e.g. "Amr is waiting for you to review #688" rendered inside Waleed's card), those substrings appeared in multiple cards and Playwright strict mode errored with "resolved to 2 elements".

Fix

Identify each card by its .team-member-github child (the @handle element is unique per member and is never mirrored inside review-blocking sentences), using an anchored regex:

const amrCard = page
  .locator('.team-member-card')
  .filter({ has: page.locator('.team-member-github', { hasText: /^@amr$/ }) });

The anchored /^@amr$/ also guards against future members with overlapping handle prefixes (e.g. @amrit).

Test Plan

  • Ran TOWER_TEST_PORT=4199 pnpm exec playwright test team-tab.test.ts — all 5 tests pass (6.8s)
  • Kept the rest of the assertions (text content, href) intact — only the card locator changed
  • Net diff: 11 additions, 2 deletions (1 source file; status.yaml is porch-managed)

CMAP Review

Model Verdict Confidence
Gemini APPROVE HIGH
Claude APPROVE HIGH
Codex REQUEST_CHANGES HIGH
  • Gemini: "Clean and correct fix for Playwright strict mode failures using precise, anchored locators."
  • Claude: "Clean, minimal fix that correctly addresses the strict-mode locator ambiguity with an idiomatic Playwright pattern."
  • Codex: Concern about codev/projects/bugfix-698-.../status.yaml being included. This file is porch-managed — it was created by chore(porch): bugfix-698 init bugfix (074d487) at spawn time, and strict-mode builder rules explicitly prohibit editing status.yaml directly. Porch advances it at merge time; this mirrors past bugfixes (e.g. chore(porch): bugfix-693 protocol complete). Not a real blocker.

Playwright strict mode rejected the card locators because the feature
shipped in PR #695 renders review-blocking sentences that mention the
other member's name (e.g. Waleed's card contains "Amr is waiting for
you to review #688"), so hasText: 'Amr' / 'Waleed' matched both cards.

Use filter({ has: '.team-member-github' }) with an anchored regex on the
@handle instead — handles are unique per card and not duplicated in any
review-blocking text.
@amrmelsayed
Copy link
Copy Markdown
Collaborator

Architect Review

Low-risk test fix. The locator change from hasText: 'Amr' to filtering by .team-member-github with exact regex match is the right approach — it targets the identity element rather than substring-matching the full card, which broke when review-blocking sentences started mentioning other members' names.

CI is all green. Please merge.


Architect review

@waleedkadous waleedkadous merged commit 7dfc231 into main Apr 23, 2026
6 checks passed
@waleedkadous waleedkadous deleted the builder/bugfix-698 branch April 23, 2026 14:37
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.

Dashboard E2E: team-tab review-blocking test uses ambiguous locator

2 participants