[scout] fix flaky flyout test#217153
Merged
PhilippeOberti merged 7 commits intoelastic:mainfrom Apr 4, 2025
Merged
Conversation
pheyos
approved these changes
Apr 4, 2025
PhilippeOberti
approved these changes
Apr 4, 2025
Contributor
PhilippeOberti
left a comment
There was a problem hiding this comment.
Thank you for the fix @dmlemeshko !!
jbudz
approved these changes
Apr 4, 2025
Contributor
💚 Build Succeeded
Metrics [docs]
History
cc @dmlemeshko |
Contributor
|
Starting backport for target branches: 8.x, 9.0 https://github.com/elastic/kibana/actions/runs/14270752690 |
kibanamachine
pushed a commit
to kibanamachine/kibana
that referenced
this pull request
Apr 4, 2025
## Summary
```
TimeoutError: page.waitForSelector: Timeout 10000ms exceeded.
Call log:
- waiting for locator('[data-test-subj="globalLoadingIndicator-hidden"]')
at Object.waitForSelector (src/platform/packages/shared/kbn-scout/src/playwright/fixtures/test/scout_page/single_thread.ts:47:27)
at Page.waitForLoadingIndicatorHidden (src/platform/packages/shared/kbn-scout/src/playwright/fixtures/test/scout_page/single_thread.ts:91:27)
at x-pack/solutions/security/plugins/security_solution/ui_tests/parallel_tests/flyout/alert_details_url_sync.spec.ts:40:16
```
Failure rate before changes: 60%
<img width="487" alt="image"
src="https://github.com/user-attachments/assets/9331f973-9337-48cf-9131-c3acbf611d9c"
/>
For some reason specifically in serverless Security project loading
indicator is not hidden on page reload after 10 seconds.
To unblock Teams this PR changes tests to wait for
`detectionsAlertsPage` to be visible instead. The follow-up is to set
loading status directly in Alerting Table component and wait for
`alertsTable-loaded` data-test-subj in UI tests before interacting with
table.
Failure rate with changes: 0%
<img width="1592" alt="Screenshot 2025-04-04 at 17 08 32"
src="https://github.com/user-attachments/assets/c955ed94-bc92-4328-a3b5-0194806d31b1"
/>
(cherry picked from commit 6414204)
kibanamachine
pushed a commit
to kibanamachine/kibana
that referenced
this pull request
Apr 4, 2025
## Summary
```
TimeoutError: page.waitForSelector: Timeout 10000ms exceeded.
Call log:
- waiting for locator('[data-test-subj="globalLoadingIndicator-hidden"]')
at Object.waitForSelector (src/platform/packages/shared/kbn-scout/src/playwright/fixtures/test/scout_page/single_thread.ts:47:27)
at Page.waitForLoadingIndicatorHidden (src/platform/packages/shared/kbn-scout/src/playwright/fixtures/test/scout_page/single_thread.ts:91:27)
at x-pack/solutions/security/plugins/security_solution/ui_tests/parallel_tests/flyout/alert_details_url_sync.spec.ts:40:16
```
Failure rate before changes: 60%
<img width="487" alt="image"
src="https://github.com/user-attachments/assets/9331f973-9337-48cf-9131-c3acbf611d9c"
/>
For some reason specifically in serverless Security project loading
indicator is not hidden on page reload after 10 seconds.
To unblock Teams this PR changes tests to wait for
`detectionsAlertsPage` to be visible instead. The follow-up is to set
loading status directly in Alerting Table component and wait for
`alertsTable-loaded` data-test-subj in UI tests before interacting with
table.
Failure rate with changes: 0%
<img width="1592" alt="Screenshot 2025-04-04 at 17 08 32"
src="https://github.com/user-attachments/assets/c955ed94-bc92-4328-a3b5-0194806d31b1"
/>
(cherry picked from commit 6414204)
Contributor
💚 All backports created successfully
Note: Successful backport PRs will be merged automatically after passing CI. Questions ?Please refer to the Backport tool documentation |
This was referenced Apr 4, 2025
kibanamachine
added a commit
that referenced
this pull request
Apr 4, 2025
# Backport This will backport the following commits from `main` to `9.0`: - [[scout] fix flaky flyout test (#217153)](#217153) <!--- 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-04T17:21:30Z","message":"[scout] fix flaky flyout test (#217153)\n\n## Summary\n\n```\nTimeoutError: page.waitForSelector: Timeout 10000ms exceeded.\nCall log:\n - waiting for locator('[data-test-subj=\"globalLoadingIndicator-hidden\"]')\n\n at Object.waitForSelector (src/platform/packages/shared/kbn-scout/src/playwright/fixtures/test/scout_page/single_thread.ts:47:27)\n at Page.waitForLoadingIndicatorHidden (src/platform/packages/shared/kbn-scout/src/playwright/fixtures/test/scout_page/single_thread.ts:91:27)\n at x-pack/solutions/security/plugins/security_solution/ui_tests/parallel_tests/flyout/alert_details_url_sync.spec.ts:40:16\n```\n\nFailure rate before changes: 60%\n\n<img width=\"487\" alt=\"image\"\nsrc=\"https://github.com/user-attachments/assets/9331f973-9337-48cf-9131-c3acbf611d9c\"\n/>\n\nFor some reason specifically in serverless Security project loading\nindicator is not hidden on page reload after 10 seconds.\n\nTo unblock Teams this PR changes tests to wait for\n`detectionsAlertsPage` to be visible instead. The follow-up is to set\nloading status directly in Alerting Table component and wait for\n`alertsTable-loaded` data-test-subj in UI tests before interacting with\ntable.\n\nFailure rate with changes: 0%\n<img width=\"1592\" alt=\"Screenshot 2025-04-04 at 17 08 32\"\nsrc=\"https://github.com/user-attachments/assets/c955ed94-bc92-4328-a3b5-0194806d31b1\"\n/>","sha":"64142047fba15f52b28304b09fb78c3aa2d23b3a","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":"[scout] fix flaky flyout test","number":217153,"url":"https://github.com/elastic/kibana/pull/217153","mergeCommit":{"message":"[scout] fix flaky flyout test (#217153)\n\n## Summary\n\n```\nTimeoutError: page.waitForSelector: Timeout 10000ms exceeded.\nCall log:\n - waiting for locator('[data-test-subj=\"globalLoadingIndicator-hidden\"]')\n\n at Object.waitForSelector (src/platform/packages/shared/kbn-scout/src/playwright/fixtures/test/scout_page/single_thread.ts:47:27)\n at Page.waitForLoadingIndicatorHidden (src/platform/packages/shared/kbn-scout/src/playwright/fixtures/test/scout_page/single_thread.ts:91:27)\n at x-pack/solutions/security/plugins/security_solution/ui_tests/parallel_tests/flyout/alert_details_url_sync.spec.ts:40:16\n```\n\nFailure rate before changes: 60%\n\n<img width=\"487\" alt=\"image\"\nsrc=\"https://github.com/user-attachments/assets/9331f973-9337-48cf-9131-c3acbf611d9c\"\n/>\n\nFor some reason specifically in serverless Security project loading\nindicator is not hidden on page reload after 10 seconds.\n\nTo unblock Teams this PR changes tests to wait for\n`detectionsAlertsPage` to be visible instead. The follow-up is to set\nloading status directly in Alerting Table component and wait for\n`alertsTable-loaded` data-test-subj in UI tests before interacting with\ntable.\n\nFailure rate with changes: 0%\n<img width=\"1592\" alt=\"Screenshot 2025-04-04 at 17 08 32\"\nsrc=\"https://github.com/user-attachments/assets/c955ed94-bc92-4328-a3b5-0194806d31b1\"\n/>","sha":"64142047fba15f52b28304b09fb78c3aa2d23b3a"}},"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/217153","number":217153,"mergeCommit":{"message":"[scout] fix flaky flyout test (#217153)\n\n## Summary\n\n```\nTimeoutError: page.waitForSelector: Timeout 10000ms exceeded.\nCall log:\n - waiting for locator('[data-test-subj=\"globalLoadingIndicator-hidden\"]')\n\n at Object.waitForSelector (src/platform/packages/shared/kbn-scout/src/playwright/fixtures/test/scout_page/single_thread.ts:47:27)\n at Page.waitForLoadingIndicatorHidden (src/platform/packages/shared/kbn-scout/src/playwright/fixtures/test/scout_page/single_thread.ts:91:27)\n at x-pack/solutions/security/plugins/security_solution/ui_tests/parallel_tests/flyout/alert_details_url_sync.spec.ts:40:16\n```\n\nFailure rate before changes: 60%\n\n<img width=\"487\" alt=\"image\"\nsrc=\"https://github.com/user-attachments/assets/9331f973-9337-48cf-9131-c3acbf611d9c\"\n/>\n\nFor some reason specifically in serverless Security project loading\nindicator is not hidden on page reload after 10 seconds.\n\nTo unblock Teams this PR changes tests to wait for\n`detectionsAlertsPage` to be visible instead. The follow-up is to set\nloading status directly in Alerting Table component and wait for\n`alertsTable-loaded` data-test-subj in UI tests before interacting with\ntable.\n\nFailure rate with changes: 0%\n<img width=\"1592\" alt=\"Screenshot 2025-04-04 at 17 08 32\"\nsrc=\"https://github.com/user-attachments/assets/c955ed94-bc92-4328-a3b5-0194806d31b1\"\n/>","sha":"64142047fba15f52b28304b09fb78c3aa2d23b3a"}},{"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--> Co-authored-by: Dzmitry Lemechko <dzmitry.lemechko@elastic.co>
kibanamachine
added a commit
that referenced
this pull request
Apr 5, 2025
# Backport This will backport the following commits from `main` to `8.x`: - [[scout] fix flaky flyout test (#217153)](#217153) <!--- 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-04T17:21:30Z","message":"[scout] fix flaky flyout test (#217153)\n\n## Summary\n\n```\nTimeoutError: page.waitForSelector: Timeout 10000ms exceeded.\nCall log:\n - waiting for locator('[data-test-subj=\"globalLoadingIndicator-hidden\"]')\n\n at Object.waitForSelector (src/platform/packages/shared/kbn-scout/src/playwright/fixtures/test/scout_page/single_thread.ts:47:27)\n at Page.waitForLoadingIndicatorHidden (src/platform/packages/shared/kbn-scout/src/playwright/fixtures/test/scout_page/single_thread.ts:91:27)\n at x-pack/solutions/security/plugins/security_solution/ui_tests/parallel_tests/flyout/alert_details_url_sync.spec.ts:40:16\n```\n\nFailure rate before changes: 60%\n\n<img width=\"487\" alt=\"image\"\nsrc=\"https://github.com/user-attachments/assets/9331f973-9337-48cf-9131-c3acbf611d9c\"\n/>\n\nFor some reason specifically in serverless Security project loading\nindicator is not hidden on page reload after 10 seconds.\n\nTo unblock Teams this PR changes tests to wait for\n`detectionsAlertsPage` to be visible instead. The follow-up is to set\nloading status directly in Alerting Table component and wait for\n`alertsTable-loaded` data-test-subj in UI tests before interacting with\ntable.\n\nFailure rate with changes: 0%\n<img width=\"1592\" alt=\"Screenshot 2025-04-04 at 17 08 32\"\nsrc=\"https://github.com/user-attachments/assets/c955ed94-bc92-4328-a3b5-0194806d31b1\"\n/>","sha":"64142047fba15f52b28304b09fb78c3aa2d23b3a","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":"[scout] fix flaky flyout test","number":217153,"url":"https://github.com/elastic/kibana/pull/217153","mergeCommit":{"message":"[scout] fix flaky flyout test (#217153)\n\n## Summary\n\n```\nTimeoutError: page.waitForSelector: Timeout 10000ms exceeded.\nCall log:\n - waiting for locator('[data-test-subj=\"globalLoadingIndicator-hidden\"]')\n\n at Object.waitForSelector (src/platform/packages/shared/kbn-scout/src/playwright/fixtures/test/scout_page/single_thread.ts:47:27)\n at Page.waitForLoadingIndicatorHidden (src/platform/packages/shared/kbn-scout/src/playwright/fixtures/test/scout_page/single_thread.ts:91:27)\n at x-pack/solutions/security/plugins/security_solution/ui_tests/parallel_tests/flyout/alert_details_url_sync.spec.ts:40:16\n```\n\nFailure rate before changes: 60%\n\n<img width=\"487\" alt=\"image\"\nsrc=\"https://github.com/user-attachments/assets/9331f973-9337-48cf-9131-c3acbf611d9c\"\n/>\n\nFor some reason specifically in serverless Security project loading\nindicator is not hidden on page reload after 10 seconds.\n\nTo unblock Teams this PR changes tests to wait for\n`detectionsAlertsPage` to be visible instead. The follow-up is to set\nloading status directly in Alerting Table component and wait for\n`alertsTable-loaded` data-test-subj in UI tests before interacting with\ntable.\n\nFailure rate with changes: 0%\n<img width=\"1592\" alt=\"Screenshot 2025-04-04 at 17 08 32\"\nsrc=\"https://github.com/user-attachments/assets/c955ed94-bc92-4328-a3b5-0194806d31b1\"\n/>","sha":"64142047fba15f52b28304b09fb78c3aa2d23b3a"}},"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/217153","number":217153,"mergeCommit":{"message":"[scout] fix flaky flyout test (#217153)\n\n## Summary\n\n```\nTimeoutError: page.waitForSelector: Timeout 10000ms exceeded.\nCall log:\n - waiting for locator('[data-test-subj=\"globalLoadingIndicator-hidden\"]')\n\n at Object.waitForSelector (src/platform/packages/shared/kbn-scout/src/playwright/fixtures/test/scout_page/single_thread.ts:47:27)\n at Page.waitForLoadingIndicatorHidden (src/platform/packages/shared/kbn-scout/src/playwright/fixtures/test/scout_page/single_thread.ts:91:27)\n at x-pack/solutions/security/plugins/security_solution/ui_tests/parallel_tests/flyout/alert_details_url_sync.spec.ts:40:16\n```\n\nFailure rate before changes: 60%\n\n<img width=\"487\" alt=\"image\"\nsrc=\"https://github.com/user-attachments/assets/9331f973-9337-48cf-9131-c3acbf611d9c\"\n/>\n\nFor some reason specifically in serverless Security project loading\nindicator is not hidden on page reload after 10 seconds.\n\nTo unblock Teams this PR changes tests to wait for\n`detectionsAlertsPage` to be visible instead. The follow-up is to set\nloading status directly in Alerting Table component and wait for\n`alertsTable-loaded` data-test-subj in UI tests before interacting with\ntable.\n\nFailure rate with changes: 0%\n<img width=\"1592\" alt=\"Screenshot 2025-04-04 at 17 08 32\"\nsrc=\"https://github.com/user-attachments/assets/c955ed94-bc92-4328-a3b5-0194806d31b1\"\n/>","sha":"64142047fba15f52b28304b09fb78c3aa2d23b3a"}},{"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--> Co-authored-by: Dzmitry Lemechko <dzmitry.lemechko@elastic.co>
dmlemeshko
added a commit
that referenced
this pull request
Apr 15, 2025
…sed on loading status (#217230) ## 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](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" />
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
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
Failure rate before changes: 60%
For some reason specifically in serverless Security project loading indicator is not hidden on page reload after 10 seconds.
To unblock Teams this PR changes tests to wait for
detectionsAlertsPageto be visible instead. The follow-up is to set loading status directly in Alerting Table component and wait foralertsTable-loadeddata-test-subj in UI tests before interacting with table.Failure rate with changes: 0%
