Skip to content

(playwright): Stabilize Playwright search export coverage#27462

Merged
harsh-vador merged 2 commits intomainfrom
fix-flaky-search-export-spec
Apr 20, 2026
Merged

(playwright): Stabilize Playwright search export coverage#27462
harsh-vador merged 2 commits intomainfrom
fix-flaky-search-export-spec

Conversation

@harsh-vador
Copy link
Copy Markdown
Contributor

Describe your changes:

Summary

This PR cleans up and stabilizes the Playwright coverage for search export behavior.

What changed

  • Removed mock-driven export test paths from SearchExport.spec.ts
  • Added a real search-mode assertion that verifies the first left-panel tab count matches export-scope-visible-count in the export modal
  • Stabilized the browse-mode visible export test by:
    • navigating to /explore/topics
    • waiting for the real topic search query to complete
    • waiting for loaders to disappear and result cards to render before opening the export modal
  • Updated export count reads to be scoped to the export modal via getExportCountFromModal(...)
  • Tightened a few existing assertions so tests check for successful search/query responses before proceeding
  • Kept the limit-exceeded test on real Explore behavior instead of intercepting search/query
Screen.Recording.2026-04-17.at.2.39.36.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.

@harsh-vador harsh-vador self-assigned this Apr 17, 2026
@harsh-vador harsh-vador requested a review from a team as a code owner April 17, 2026 09:23
@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 17, 2026
@github-actions
Copy link
Copy Markdown
Contributor

Jest test Coverage

UI tests summary

Lines Statements Branches Functions
Coverage: 63%
63.74% (59637/93557) 43.66% (31380/71873) 46.76% (9432/20171)

@gitar-bot
Copy link
Copy Markdown

gitar-bot Bot commented Apr 17, 2026

Code Review ✅ Approved 2 resolved / 2 findings

Stabilizes Playwright search export coverage by implementing mocked data for limit-exceeded scenarios and adding response status verification to waitForResponse calls. No issues remain.

✅ 2 resolved
Bug: Limit-exceeded test will fail without mocked data (< 200k assets)

📄 openmetadata-ui/src/main/resources/ui/playwright/e2e/Features/SearchExport.spec.ts:218-232
The test 'Export is disabled when all matching assets exceed limit' (line 218-237) previously used page.route() to mock a search response with 200001 hits. The mock was removed, and now the test opens the export modal against real data and asserts that the limit alert ('Export is limited to 200000 assets') is visible and the export button is disabled.

In a typical test environment, the explore page will not have > 200,000 assets, so the limit alert will never appear and the assertions at lines 226-231 and 234-236 will fail.

This test needs either:

  1. A mock/route intercept to simulate the over-limit response (as before), or
  2. A test-environment prerequisite that guarantees > 200k indexed assets (unlikely).
Edge Case: waitForResponse without status check may match failed requests

📄 openmetadata-ui/src/main/resources/ui/playwright/e2e/Features/SearchExport.spec.ts:100-106 📄 openmetadata-ui/src/main/resources/ui/playwright/e2e/Features/SearchExport.spec.ts:244-251
At lines 100-101 and 244-245, waitForResponse matches any response from /api/v1/search/query regardless of status code. The status is checked after awaiting, but if the first matching response is a non-200 (e.g., a 400 from a preflight or retry), the test will fail with a less informative assertion error rather than timing out and retrying.

The previous code filtered on response.status() === 200 inside the predicate, which would skip non-200 responses and wait for a successful one. The new pattern will accept the first response regardless of status.

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

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Apr 17, 2026

🟡 Playwright Results — all passed (29 flaky)

✅ 3652 passed · ❌ 0 failed · 🟡 29 flaky · ⏭️ 89 skipped

Shard Passed Failed Flaky Skipped
🟡 Shard 1 476 0 4 4
🟡 Shard 2 649 0 2 7
🟡 Shard 3 647 0 9 1
🟡 Shard 4 628 0 6 27
🟡 Shard 5 610 0 1 42
🟡 Shard 6 642 0 7 8
🟡 29 flaky test(s) (passed on retry)
  • Features/DataAssetRulesDisabled.spec.ts › Verify the ApiEndpoint entity item action after rules disabled (shard 1, 1 retry)
  • Features/DataAssetRulesDisabled.spec.ts › Verify the Chart entity item action after rules disabled (shard 1, 2 retries)
  • Features/DataAssetRulesDisabled.spec.ts › Verify the Database entity item action after rules disabled (shard 1, 2 retries)
  • Pages/UserCreationWithPersona.spec.ts › Create user with persona and verify on profile (shard 1, 1 retry)
  • Features/BulkEditEntity.spec.ts › Glossary (shard 2, 1 retry)
  • Features/ChangeSummaryBadge.spec.ts › AI badge should NOT appear for manually-edited descriptions (shard 2, 1 retry)
  • Features/RestoreEntityInheritedFields.spec.ts › Validate restore with Inherited domain and data products assigned (shard 3, 1 retry)
  • Features/RestoreEntityInheritedFields.spec.ts › Validate restore with Inherited domain and data products assigned (shard 3, 1 retry)
  • Features/RestoreEntityInheritedFields.spec.ts › Validate restore with Inherited domain and data products assigned (shard 3, 2 retries)
  • Features/RestoreEntityInheritedFields.spec.ts › Validate restore with Inherited domain and data products assigned (shard 3, 1 retry)
  • Features/RestoreEntityInheritedFields.spec.ts › Validate restore with Inherited domain and data products assigned (shard 3, 2 retries)
  • Features/RestoreEntityInheritedFields.spec.ts › Validate restore with Inherited domain and data products assigned (shard 3, 2 retries)
  • Features/RestoreEntityInheritedFields.spec.ts › Validate restore with Inherited domain and data products assigned (shard 3, 1 retry)
  • Features/RTL.spec.ts › Verify Following widget functionality (shard 3, 1 retry)
  • Flow/PersonaDeletionUserProfile.spec.ts › User profile loads correctly before and after persona deletion (shard 3, 1 retry)
  • Pages/Customproperties-part2.spec.ts › entityReferenceList shows item count, scrollable list, no expand toggle (shard 4, 1 retry)
  • Pages/DataContracts.spec.ts › Create Data Contract and validate for MlModel (shard 4, 1 retry)
  • Pages/DataContracts.spec.ts › Create Data Contract and validate for File (shard 4, 1 retry)
  • Pages/Domains.spec.ts › Domain owner should able to edit description of domain (shard 4, 1 retry)
  • Pages/Domains.spec.ts › Rename domain with owners and experts preserves assignments (shard 4, 1 retry)
  • Pages/Domains.spec.ts › Multiple consecutive domain renames preserve all associations (shard 4, 1 retry)
  • Pages/EntityDataSteward.spec.ts › Tag Add, Update and Remove (shard 5, 1 retry)
  • Pages/Lineage/DataAssetLineage.spec.ts › verify create lineage for entity - Container (shard 6, 1 retry)
  • Pages/Lineage/DataAssetLineage.spec.ts › verify create lineage for entity - Api Endpoint (shard 6, 1 retry)
  • Pages/Lineage/LineageFilters.spec.ts › Verify lineage schema filter selection (shard 6, 1 retry)
  • Pages/Lineage/LineageRightPanel.spec.ts › Verify custom properties tab IS visible for supported type: searchIndex (shard 6, 1 retry)
  • Pages/ServiceEntity.spec.ts › Tag Add, Update and Remove (shard 6, 1 retry)
  • Pages/UserDetails.spec.ts › Admin user can edit teams from the user profile (shard 6, 1 retry)
  • Pages/Users.spec.ts › Permissions for table details page for Data Consumer (shard 6, 1 retry)

📦 Download artifacts

How to debug locally
# Download playwright-test-results-<shard> artifact and unzip
npx playwright show-trace path/to/trace.zip    # view trace

@harsh-vador harsh-vador merged commit d6737a5 into main Apr 20, 2026
56 of 57 checks passed
@harsh-vador harsh-vador deleted the fix-flaky-search-export-spec branch April 20, 2026 08:35
@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.

harsh-vador added a commit that referenced this pull request Apr 20, 2026
* (playwright): Stabilize Playwright search export coverage

* add more test coverage & address gitar

(cherry picked from commit d6737a5)
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.

2 participants