[8.x] [kbn/response-ops-alerts-table] set data-test-subj for EuiDataGrid based on loading status (#217230)#218243
Merged
dmlemeshko merged 1 commit intoelastic:8.xfrom Apr 15, 2025
Conversation
…sed on loading status (elastic#217230) ## Summary Follow-up to elastic#217153 ### Problem Description In UI tests, there was no reliable way to determine when the Alerts table content had fully loaded before interacting with it. This could lead to flaky tests where interactions occurred before the data was available (rows are not present yet), causing failures or inconsistent results (checking for row with specific content to exist)  Quite often we see tests waiting for global indicator (spinner in the top left corner) to be hidden as a condition for page loading is complete. This is quite unreliable approach and testing tools have no consistent built-in solution: FTR, Cypress or even Playwright - network idle wait is officially marked as [discouraged](https://playwright.dev/docs/api/class-page)). We need to help testing tool to interact with UI components in ready state only. ### Solution To address this issue, I modified a `data-test-subj` property in the `<EuiDataGrid>` component. The property dynamically switches between `alertsTableIsLoading` when data is still loading and `alertsTableIsLoaded `once the content is available. This allows UI tests to wait for precisely `alertsTableIsLoaded` to be in in the DOM before interacting with the table, ensuring more reliable and stable test execution. Passed 10/10 <img width="538" alt="image" src="https://github.com/user-attachments/assets/e44bae5f-4094-4ed2-89f3-74a52cb2be53" /> (cherry picked from commit edf8d6d) # Conflicts: # x-pack/test/functional/services/observability/alerts/common.ts
fake-haris
approved these changes
Apr 15, 2025
...curity/packages/kbn-scout-security/src/playwright/fixtures/test/page_objects/alerts_table.ts
Show resolved
Hide resolved
Contributor
💛 Build succeeded, but was flaky
Failed CI StepsMetrics [docs]Async chunks
|
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.
Backport
This will backport the following commits from
mainto8.x:Questions ?
Please refer to the Backport tool documentation