fix(playwright): make SearchExport tests robust for AUT environments with >200k assets#27316
Open
harsh-vador wants to merge 1 commit intomainfrom
Open
fix(playwright): make SearchExport tests robust for AUT environments with >200k assets#27316harsh-vador wants to merge 1 commit intomainfrom
harsh-vador wants to merge 1 commit intomainfrom
Conversation
…with >200k assets
Code Review ✅ ApprovedHardened SearchExport tests to handle AUT environments with over 200k assets, improving robustness across scale scenarios. No issues found. OptionsDisplay: compact → Showing less information. Comment with these commands to change:
Was this helpful? React with 👍 / 👎 | Gitar |
Contributor
|
This comment was marked as outdated.
This comment was marked as outdated.
anuj-kumary
approved these changes
Apr 13, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



Describe your changes:
Problem
In AUT environments where the Explore page returns >200,000 total assets, the Export button is disabled by design when "All matching assets" scope is selected. This caused multiple
SearchExport.spec.tstests to fail because:openExportScopeModalhelper assertedtoBeEnabled()on the Export button unconditionallyRoot Cause
The Export modal fetches the total asset count via a fresh
searchQuerycall when the modal opens (not on page load). In AUT, this returns >200,000, triggering the limit guard and disabling the Export button.Fix
toBeEnabled()fromopenExportScopeModalhelper — the enabled state is environment-dependent and belongs in individual tests, not the shared helpermockSearchQueryCounthelper — intercepts**/api/v1/search/query?*to return a small count (default: 10), ensuring the modal sees a count below the 200k limitmockSearchQueryCountto 4 tests that click Export with the default "All matching assets" scope:All matching assets export calls API with dataAsset indexExport button is disabled while export is in progressExport API error is shown inside the modalExport downloads CSV and closes modalTests using "Visible results" scope are unaffected — switching to that radio always enables the Export button regardless of total count.
Type of change:
Checklist:
Fixes <issue-number>: <short explanation>