Skip to content

test(playwright): find the Teams EditUser member row by login, not display name - #38074

Merged
harsh-vador merged 1 commit into
mainfrom
fix/teams-edituser-remove-row-locator
Nov 18, 2026
Merged

harsh-vador merged 1 commit into
mainfrom
fix/teams-edituser-remove-row-locator

Conversation

@harsh-vador

@harsh-vador harsh-vador commented Nov 18, 2026 •

Copy link
Copy Markdown
Contributor

Describe your changes:

Fixes the Teams.spec.ts › Teams Page with EditUser Permission › Add and Remove User for Team nightly failure (AUT run 44200749877: 3/3 timeouts on both MySQL and PostgreSQL, also in 44223858579; passing in 44020681792).

Root cause. The "Remove user from Team" step located the member row by its accessible name:

getByRole('row', { name: `${firstName[0].toUpperCase()} ${firstName}.` })

A react-aria grid row takes its name from the row header — the first column. Until #37127 that column showed the login (happy42c4d2c6.tiger68d8c337.1794966067259), and "H Happy42c4d2c6." matched it only by coincidence: a case-insensitive substring that happened to hit the first-name/last-name separator dot. #37127 made the first column the display name and moved the login to the new Email column, so the row name became H Happy42c4d2c6Tiger68d8c337 — no dot. The locator matched nothing and the remove-user-btn click waited until the 60 s test timeout (locator.click: Target page, context or browser has been closed). The CI error-context shows the table as:

row "H Happy42c4d2c6Tiger68d8c337"
  rowheader → link "H Happy42c4d2c6Tiger68d8c337"
  gridcell  "happy42c4d2c6.tiger68d8c337.1794966067259"   ← Email column (login; email is masked for this user)

Not a product bug — the new column layout is intended.

Fix.

  • Find the row with getRowByName(page, userName) (playwright/utils/scopedLocators.ts), keyed on the user's unique login. The login is in the Email cell whether the email is masked (login shown) or visible (the email contains it), so the locator no longer depends on how the Name column formats a user.
  • The refetch wait after Confirm becomes waitForResponseWithStatus with the GET method, per handbook §7.3/7.4, so an error response fails at that line instead of hanging until timeout.

No other spec builds a row name this way.

teams-edituser-playwright-report

Type of change:

  • Bug fix

High-level design:

N/A — single-file test fix.

Tests:

Use cases covered

  • A user with only the EditUser team permission adds two members, then removes one from the team's Users tab.

Unit tests

Not applicable — Playwright-only change.

Backend integration tests

  • Not applicable (no backend API changes).

Ingestion integration tests

  • Not applicable (no ingestion changes).

Playwright (UI) tests

  • Files updated: playwright/e2e/Pages/Teams.spec.ts
  • Run locally with --project=chromium --no-deps --retries=0 against a local server:
    • Teams Page with EditUser Permission › Add and Remove User for Team, --repeat-each=3: 3 passed, 0 failed, 0 flaky
    • whole Teams.spec.ts: 21 passed, 0 failed
  • The local UI predates Show users by display name in UserPopOverCard by default #37127, so the old Username column is still there. To check the new layout, I rebuilt the CI aria snapshot (react-aria grid with display-name rowheader and login in the Email cell) as a DOM fixture: the old locator matches 0 rows, which is the CI hang, and the new one matches exactly the target row.
  • eslint on the spec: 0 errors (the 4 warnings are older, on the untouched fixture lines 138–156); prettier --check clean; tsc -p playwright/tsconfig.json reports no errors in this file.

Result (HTML report screenshot):

screenshot: teams-edituser-playwright-report.png

screenshot: teams-full-playwright-report.png

Visual regression baselines

  • Not applicable (no rendering change).

Manual testing performed

  1. Pulled results.json and the HTML report (error-context + screenshot) for the failing test from the nightly run.
  2. Bisected between nightly 44020681792 (pass) and 44200749877 (fail) to Show users by display name in UserPopOverCard by default #37127 (eee37774138).
  3. Ran the fixed spec locally as shown above.

UI screen recording:

Not applicable — test-only fix, no UI behaviour change.

Checklist:

  • I have read the CONTRIBUTING document.
  • My PR title is Fixes <issue-number>: <short explanation> — N/A, test fix (skip-pr-checks).
  • My PR is linked to a GitHub issue via Fixes #<issue-number> above — N/A, test fix.
  • I have commented on my code, particularly in hard-to-understand areas — N/A, nothing non-obvious.
  • For JSON Schema changes: N/A.
  • For a UI feature or feature task: not applicable — test fix.
  • I have added tests (unit / integration / Playwright as applicable) and listed them above.
  • Self-review: I reviewed the final diff against REVIEW.md (the pr-checklist skill runs it) and fixed every 🔴 finding, or answered it on the line below.
    Reviewed e74dcda137b (rebase of d03ea1e582c, same diff): no 🔴. No helper or test id renamed, so Collate callers are unaffected; reverting the locator brings back the CI hang; the closing not.toBeVisible targets an element visible before the action, so it can still fail.
  • Decision check: no durable decision.

🤖 Generated with Claude Code

RetriggerView in GreptileConfidence Score: 5/5

This test-only change appears safe to merge.

Summary

Updates the Teams member-removal test to find the user by login instead of display-name formatting.

  • The Teams permission test finds members by login when removing them.

No actionable issues found. Tests were not run during this review.

Reviews (7) · Last reviewed commit: "test(playwright): find the Teams EditUse..." · Reviewed by Greptile

…splay name

#37127 moved the login out of the users table's Name column, so the row
name no longer contains the firstName-dot the locator relied on and the
remove click hung until the test timeout.
@harsh-vador
harsh-vador requested a review from a team as a code owner November 18, 2026 05:37
@harsh-vador harsh-vador added the skip-pr-checks Bypass PR metadata validation check label Nov 18, 2026
@gitar-bot

gitar-bot Bot commented Nov 18, 2026 •

Copy link
Copy Markdown
Code Review ✅ Approved 🟢 Low risk

The Playwright-only locator and response-wait fix changes test synchronization, not product behavior, so its impact is limited to this test.

Switches the Teams EditUser remove-user step to locate the member row by unique login in the Email cell instead of display-name row text, fixing the nightly timeout caused by the new column layout. The refetch wait now uses waitForResponseWithStatus so error responses fail fast. No issues found.

Verification

Rules No rules evaluated

Functional validation Not enabled

Set up

Auto-approval Not enabled

Set up

For more verification details, comment gitar display:verbose.

Options

Display: compact → Showing compact verification results.

Comment with these commands to change the behavior for this request:

Compact
gitar display:verbose         

Was this helpful? React with 👍 / 👎 | Powered by Gitar — free for open source

@harsh-vador harsh-vador added the safe to test Add this label to run secure Github workflows on PRs label Nov 18, 2026
@harsh-vador
harsh-vador enabled auto-merge (squash) November 18, 2026 05:55
@harsh-vador
harsh-vador merged commit c935cc4 into main Nov 18, 2026
50 checks passed
@harsh-vador
harsh-vador deleted the fix/teams-edituser-remove-row-locator branch November 18, 2026 05:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

safe to test Add this label to run secure Github workflows on PRs skip-pr-checks Bypass PR metadata validation check

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants