Skip to content

fix(playwright): replace flaky toast assertion with search-based deletion verification in teams & teams drag drop spec - #27341

Merged
harsh-vador merged 6 commits into
mainfrom
remove-toast-assertions-teams-spec
Apr 15, 2026
Merged

harsh-vador merged 6 commits into
mainfrom
remove-toast-assertions-teams-spec

Conversation

@harsh-vador

Copy link
Copy Markdown
Contributor

Describe your changes:

Summary

  • softDeleteTeam and hardDeleteTeam utilities previously verified deletion via toastNotification, which was flaky in automated tests due to timing — the toast can disappear before the assertion fires.
  • Replaced with a deterministic check: after deletion, navigate to the teams listing and search for the deleted team name, asserting empty results via the existing searchTeam(..., { expectEmptyResults: true }) pattern.
  • Both utility functions now accept teamName: string as a parameter; all call sites in Teams.spec.ts and TeamsDragAndDrop.spec.ts updated accordingly.
Screen.Recording.2026-04-14.at.1.07.17.PM.mov

Type of change:

  • Bug fix
  • Improvement
  • New feature
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation

Checklist:

  • I have read the CONTRIBUTING document.
  • My PR title is Fixes <issue-number>: <short explanation>
  • I have commented on my code, particularly in hard-to-understand areas.
  • For JSON Schema changes: I updated the migration scripts or explained why it is not needed.

…tion verification in teams & teams drag drop spec
@harsh-vador harsh-vador self-assigned this Apr 14, 2026
@harsh-vador
harsh-vador requested a review from a team as a code owner April 14, 2026 07:38
@harsh-vador harsh-vador added safe to test Add this label to run secure Github workflows on PRs To release Will cherry-pick this PR into the release branch labels Apr 14, 2026
Comment thread openmetadata-ui/src/main/resources/ui/playwright/e2e/Pages/Teams.spec.ts Outdated
@github-actions

github-actions Bot commented Apr 14, 2026 •

Copy link
Copy Markdown
Contributor

Jest test Coverage

UI tests summary

Lines Statements Branches Functions
Coverage: 63%
63.88% (59797/93603) 43.64% (31322/71768) 46.73% (9415/20144)

@harsh-vador

Copy link
Copy Markdown
Contributor Author

@gitar-bot please review now, the comment is addressed

anuj-kumary
anuj-kumary previously approved these changes Apr 14, 2026
@harsh-vador
harsh-vador enabled auto-merge (squash) April 14, 2026 09:59
Comment thread openmetadata-ui/src/main/resources/ui/playwright/utils/team.ts Outdated
Comment thread openmetadata-ui/src/main/resources/ui/playwright/e2e/Pages/Teams.spec.ts Outdated
@github-actions

This comment was marked as outdated.

@gitar-bot

gitar-bot Bot commented Apr 14, 2026

Copy link
Copy Markdown

@gitar-bot please review now, the comment is addressed

Acknowledged! Running the review now.

@harsh-vador

Copy link
Copy Markdown
Contributor Author

@gitar-bot review again ,the comment is already addressed

@gitar-bot

gitar-bot Bot commented Apr 14, 2026

Copy link
Copy Markdown

@gitar-bot review again ,the comment is already addressed

Running the review again now!

@gitar-bot

gitar-bot Bot commented Apr 15, 2026 •

Copy link
Copy Markdown
Code Review ✅ Approved 1 resolved / 1 findings

Replaces flaky toast assertions with search-based verification in the teams and drag-drop specs. This change addresses the ineffective deletion check caused by incorrect name property usage.

✅ 1 resolved
✅ Bug: Passing name instead of displayName makes deletion check ineffective

📄 openmetadata-ui/src/main/resources/ui/playwright/e2e/Pages/Teams.spec.ts:358 📄 openmetadata-ui/src/main/resources/ui/playwright/e2e/Pages/Teams.spec.ts:390 📄 openmetadata-ui/src/main/resources/ui/playwright/utils/team.ts:70-72 📄 openmetadata-ui/src/main/resources/ui/playwright/utils/team.ts:320-334
In Teams.spec.ts lines 358 and 390, teamDetails?.name is passed to softDeleteTeam/hardDeleteTeam, which then calls searchTeam(page, teamName, { expectEmptyResults: true }). The searchTeam function checks link elements using filter({ hasText: teamName }).

However, createTeam() generates different values for name (e.g., pw%team-<uuid>) and displayName (e.g., PW <uuid>). The team listing links display the displayName, not name. So filter({ hasText: name }) will never match any link text, causing matchingCount === 0 to be trivially true — the assertion passes regardless of whether the team was actually deleted.

This defeats the purpose of the new verification approach. Compare with lines 504 and 768 where displayName is correctly used.

Note: For getNewTeamDetails() callers (like TeamsDragAndDrop.spec.ts), name === displayName, so those are fine.

Options

Display: compact → Showing less information.

Comment with these commands to change:

Compact
gitar display:verbose         

Was this helpful? React with 👍 / 👎 | Gitar

@sonarqubecloud

Copy link
Copy Markdown

@harsh-vador
harsh-vador merged commit bb64349 into main Apr 15, 2026
44 checks passed
@harsh-vador
harsh-vador deleted the remove-toast-assertions-teams-spec branch April 15, 2026 06:05
@github-actions

Copy link
Copy Markdown
Contributor

Failed to cherry-pick changes to the 1.12.6 branch.
Please cherry-pick the changes manually.
You can find more details here.

This branch was previously deployed

1 inactive deployment
test — 1bc77f18 Deployed Apr 15, 2026 by harsh-vador via playwright-ci-postgresql (4, 6) #42217
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 To release Will cherry-pick this PR into the release branch

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants