[kbn/response-ops-alerts-table] set data-test-subj for EuiDataGrid based on loading status#217230
Merged
dmlemeshko merged 15 commits intoelastic:mainfrom Apr 15, 2025
Conversation
…b.com:dmlemeshko/kibana into alerts-table/update-dts-based-on-loading-prop
…b.com:dmlemeshko/kibana into alerts-table/update-dts-based-on-loading-prop
This reverts commit f34e475.
fake-haris
approved these changes
Apr 7, 2025
fkanout
approved these changes
Apr 8, 2025
PhilippeOberti
approved these changes
Apr 8, 2025
szwarckonrad
approved these changes
Apr 9, 2025
Contributor
szwarckonrad
left a comment
There was a problem hiding this comment.
Defend Workflows changes LGTM!
maxcold
approved these changes
Apr 9, 2025
Contributor
maxcold
left a comment
There was a problem hiding this comment.
cloud_security_posture changes LGTM
cnasikas
approved these changes
Apr 9, 2025
tomsonpl
approved these changes
Apr 10, 2025
Contributor
tomsonpl
left a comment
There was a problem hiding this comment.
This is awesome! Thanks!
Contributor
💚 Build Succeeded
Metrics [docs]Async chunks
History
cc @dmlemeshko |
Contributor
|
Starting backport for target branches: 8.x, 9.0 https://github.com/elastic/kibana/actions/runs/14467872286 |
Contributor
💔 All backports failed
Manual backportTo create the backport manually run: Questions ?Please refer to the Backport tool documentation |
dmlemeshko
added a commit
to dmlemeshko/kibana
that referenced
this pull request
Apr 15, 2025
…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
Contributor
Author
💚 All backports created successfully
Note: Successful backport PRs will be merged automatically after passing CI. Questions ?Please refer to the Backport tool documentation |
dmlemeshko
added a commit
that referenced
this pull request
Apr 15, 2025
…rid based on loading status (#217230) (#218243) # Backport This will backport the following commits from `main` to `8.x`: - [[kbn/response-ops-alerts-table] set data-test-subj for EuiDataGrid based on loading status (#217230)](#217230) <!--- Backport version: 9.6.6 --> ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sorenlouv/backport) <!--BACKPORT [{"author":{"name":"Dzmitry Lemechko","email":"dzmitry.lemechko@elastic.co"},"sourceCommit":{"committedDate":"2025-04-15T11:05:49Z","message":"[kbn/response-ops-alerts-table] set data-test-subj for EuiDataGrid based on loading status (#217230)\n\n## Summary\n\nFollow-up to #217153\n\n### Problem Description\nIn UI tests, there was no reliable way to determine when the Alerts\ntable content had fully loaded before interacting with it. This could\nlead to flaky tests where interactions occurred before the data was\navailable (rows are not present yet), causing failures or inconsistent\nresults (checking for row with specific content to exist)\n\n\n\n\nQuite often we see tests waiting for global indicator (spinner in the\ntop left corner) to be hidden as a condition for page loading is\ncomplete. This is quite unreliable approach and testing tools have no\nconsistent built-in solution: FTR, Cypress or even Playwright - network\nidle wait is officially marked as\n[discouraged](https://playwright.dev/docs/api/class-page)).\nWe need to help testing tool to interact with UI components in ready\nstate only.\n\n\n### Solution\nTo address this issue, I modified a `data-test-subj` property in the\n`<EuiDataGrid>` component. The property dynamically switches between\n`alertsTableIsLoading` when data is still loading and\n`alertsTableIsLoaded `once the content is available. This allows UI\ntests to wait for precisely `alertsTableIsLoaded` to be in in the DOM\nbefore interacting with the table, ensuring more reliable and stable\ntest execution.\n\n\nPassed 10/10\n<img width=\"538\" alt=\"image\"\nsrc=\"https://github.com/user-attachments/assets/e44bae5f-4094-4ed2-89f3-74a52cb2be53\"\n/>","sha":"edf8d6d975f7ae2bd4df8a469bc391ca602ddc1e","branchLabelMapping":{"^v9.1.0$":"main","^v8.19.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:skip","backport:version","v9.1.0","v8.19.0","v9.0.1"],"title":"[kbn/response-ops-alerts-table] set data-test-subj for EuiDataGrid based on loading status","number":217230,"url":"https://github.com/elastic/kibana/pull/217230","mergeCommit":{"message":"[kbn/response-ops-alerts-table] set data-test-subj for EuiDataGrid based on loading status (#217230)\n\n## Summary\n\nFollow-up to #217153\n\n### Problem Description\nIn UI tests, there was no reliable way to determine when the Alerts\ntable content had fully loaded before interacting with it. This could\nlead to flaky tests where interactions occurred before the data was\navailable (rows are not present yet), causing failures or inconsistent\nresults (checking for row with specific content to exist)\n\n\n\n\nQuite often we see tests waiting for global indicator (spinner in the\ntop left corner) to be hidden as a condition for page loading is\ncomplete. This is quite unreliable approach and testing tools have no\nconsistent built-in solution: FTR, Cypress or even Playwright - network\nidle wait is officially marked as\n[discouraged](https://playwright.dev/docs/api/class-page)).\nWe need to help testing tool to interact with UI components in ready\nstate only.\n\n\n### Solution\nTo address this issue, I modified a `data-test-subj` property in the\n`<EuiDataGrid>` component. The property dynamically switches between\n`alertsTableIsLoading` when data is still loading and\n`alertsTableIsLoaded `once the content is available. This allows UI\ntests to wait for precisely `alertsTableIsLoaded` to be in in the DOM\nbefore interacting with the table, ensuring more reliable and stable\ntest execution.\n\n\nPassed 10/10\n<img width=\"538\" alt=\"image\"\nsrc=\"https://github.com/user-attachments/assets/e44bae5f-4094-4ed2-89f3-74a52cb2be53\"\n/>","sha":"edf8d6d975f7ae2bd4df8a469bc391ca602ddc1e"}},"sourceBranch":"main","suggestedTargetBranches":["8.x","9.0"],"targetPullRequestStates":[{"branch":"main","label":"v9.1.0","branchLabelMappingKey":"^v9.1.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/217230","number":217230,"mergeCommit":{"message":"[kbn/response-ops-alerts-table] set data-test-subj for EuiDataGrid based on loading status (#217230)\n\n## Summary\n\nFollow-up to #217153\n\n### Problem Description\nIn UI tests, there was no reliable way to determine when the Alerts\ntable content had fully loaded before interacting with it. This could\nlead to flaky tests where interactions occurred before the data was\navailable (rows are not present yet), causing failures or inconsistent\nresults (checking for row with specific content to exist)\n\n\n\n\nQuite often we see tests waiting for global indicator (spinner in the\ntop left corner) to be hidden as a condition for page loading is\ncomplete. This is quite unreliable approach and testing tools have no\nconsistent built-in solution: FTR, Cypress or even Playwright - network\nidle wait is officially marked as\n[discouraged](https://playwright.dev/docs/api/class-page)).\nWe need to help testing tool to interact with UI components in ready\nstate only.\n\n\n### Solution\nTo address this issue, I modified a `data-test-subj` property in the\n`<EuiDataGrid>` component. The property dynamically switches between\n`alertsTableIsLoading` when data is still loading and\n`alertsTableIsLoaded `once the content is available. This allows UI\ntests to wait for precisely `alertsTableIsLoaded` to be in in the DOM\nbefore interacting with the table, ensuring more reliable and stable\ntest execution.\n\n\nPassed 10/10\n<img width=\"538\" alt=\"image\"\nsrc=\"https://github.com/user-attachments/assets/e44bae5f-4094-4ed2-89f3-74a52cb2be53\"\n/>","sha":"edf8d6d975f7ae2bd4df8a469bc391ca602ddc1e"}},{"branch":"8.x","label":"v8.19.0","branchLabelMappingKey":"^v8.19.0$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"9.0","label":"v9.0.1","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"}]}] BACKPORT-->
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.
Summary
Follow-up to #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).
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-subjproperty in the<EuiDataGrid>component. The property dynamically switches betweenalertsTableIsLoadingwhen data is still loading andalertsTableIsLoadedonce the content is available. This allows UI tests to wait for preciselyalertsTableIsLoadedto be in in the DOM before interacting with the table, ensuring more reliable and stable test execution.Passed 10/10
