Skip to content

[scout] fix flaky flyout test#217153

Merged
PhilippeOberti merged 7 commits intoelastic:mainfrom
dmlemeshko:scout/fix-flaky-flyout-test
Apr 4, 2025
Merged

[scout] fix flaky flyout test#217153
PhilippeOberti merged 7 commits intoelastic:mainfrom
dmlemeshko:scout/fix-flaky-flyout-test

Conversation

@dmlemeshko
Copy link
Contributor

@dmlemeshko dmlemeshko commented 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%

image

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%
Screenshot 2025-04-04 at 17 08 32

@dmlemeshko dmlemeshko changed the title Scout/fix flaky flyout test [scout] fix flaky flyout test Apr 4, 2025
@dmlemeshko dmlemeshko self-assigned this Apr 4, 2025
@dmlemeshko dmlemeshko added release_note:skip Skip the PR/issue when compiling release notes backport:version Backport to applied version labels v9.1.0 v8.19.0 v9.0.1 labels Apr 4, 2025
@dmlemeshko dmlemeshko marked this pull request as ready for review April 4, 2025 15:11
@dmlemeshko dmlemeshko requested review from a team as code owners April 4, 2025 15:11
Copy link
Contributor

@PhilippeOberti PhilippeOberti left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for the fix @dmlemeshko !!

@elasticmachine
Copy link
Contributor

💚 Build Succeeded

Metrics [docs]

✅ unchanged

History

cc @dmlemeshko

@PhilippeOberti PhilippeOberti merged commit 6414204 into elastic:main Apr 4, 2025
10 checks passed
@kibanamachine
Copy link
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)
@kibanamachine
Copy link
Contributor

💚 All backports created successfully

Status Branch Result
8.x
9.0

Note: Successful backport PRs will be merged automatically after passing CI.

Questions ?

Please refer to the Backport tool documentation

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)


![image](https://github.com/user-attachments/assets/6580f134-0bf2-48b8-8cc9-b6d476f4e932)

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)

![image](https://github.com/user-attachments/assets/6580f134-0bf2-48b8-8cc9-b6d476f4e932)

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![image](https://github.com/user-attachments/assets/6580f134-0bf2-48b8-8cc9-b6d476f4e932)\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![image](https://github.com/user-attachments/assets/6580f134-0bf2-48b8-8cc9-b6d476f4e932)\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![image](https://github.com/user-attachments/assets/6580f134-0bf2-48b8-8cc9-b6d476f4e932)\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-->
@mistic mistic removed the v9.0.1 label Apr 15, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport:version Backport to applied version labels release_note:skip Skip the PR/issue when compiling release notes v8.19.0 v9.0.0 v9.1.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants