[8.x] Make sort integration test resilient to network delays. (#196516) (#197237)

# Backport

This will backport the following commits from `main` to `8.x`:
- [Make sort integration test resilient to network delays.
(#196516)](https://github.com/elastic/kibana/pull/196516)

<!--- Backport version: 9.4.3 -->

### Questions ?
Please refer to the [Backport tool
documentation](https://github.com/sqren/backport)

<!--BACKPORT [{"author":{"name":"Abdul Wahab
Zahid","email":"awahab07@yahoo.com"},"sourceCommit":{"committedDate":"2024-10-22T13:11:08Z","message":"Make
sort integration test resilient to network delays. (#196516)\n\nFixes
https://github.com/elastic/kibana/issues/182017\r\n\r\n##
Summary\r\n\r\nThe PR tries to address the flakiness from the
test.\r\n\r\nCo-authored-by: Elastic Machine
<elasticmachine@users.noreply.github.com>","sha":"cbf7982887decc527455dd8f64477813e8ea2672","branchLabelMapping":{"^v9.0.0$":"main","^v8.17.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["bug","release_note:skip","v9.0.0","backport:prev-minor","Team:obs-ux-logs"],"title":"Make
sort integration test resilient to network
delays.","number":196516,"url":"https://github.com/elastic/kibana/pull/196516","mergeCommit":{"message":"Make
sort integration test resilient to network delays. (#196516)\n\nFixes
https://github.com/elastic/kibana/issues/182017\r\n\r\n##
Summary\r\n\r\nThe PR tries to address the flakiness from the
test.\r\n\r\nCo-authored-by: Elastic Machine
<elasticmachine@users.noreply.github.com>","sha":"cbf7982887decc527455dd8f64477813e8ea2672"}},"sourceBranch":"main","suggestedTargetBranches":[],"targetPullRequestStates":[{"branch":"main","label":"v9.0.0","branchLabelMappingKey":"^v9.0.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/196516","number":196516,"mergeCommit":{"message":"Make
sort integration test resilient to network delays. (#196516)\n\nFixes
https://github.com/elastic/kibana/issues/182017\r\n\r\n##
Summary\r\n\r\nThe PR tries to address the flakiness from the
test.\r\n\r\nCo-authored-by: Elastic Machine
<elasticmachine@users.noreply.github.com>","sha":"cbf7982887decc527455dd8f64477813e8ea2672"}}]}]
BACKPORT-->

Co-authored-by: Abdul Wahab Zahid <awahab07@yahoo.com>
This commit is contained in:
Kibana Machine 2024-10-23 02:07:34 +11:00 committed by GitHub
parent d6df65e969
commit 6c8699f6b5
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -214,25 +214,25 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
it('should sort the integrations list by the clicked sorting option', async () => {
// Test ascending order
await PageObjects.observabilityLogsExplorer.clickSortButtonBy('asc');
await retry.try(async () => {
await PageObjects.observabilityLogsExplorer.clickSortButtonBy('desc');
await PageObjects.observabilityLogsExplorer.clickSortButtonBy('asc');
const { integrations } = await PageObjects.observabilityLogsExplorer.getIntegrations();
expect(integrations).to.eql(initialPackagesTexts);
});
// Test descending order
await PageObjects.observabilityLogsExplorer.clickSortButtonBy('desc');
await retry.try(async () => {
await PageObjects.observabilityLogsExplorer.clickSortButtonBy('asc');
await PageObjects.observabilityLogsExplorer.clickSortButtonBy('desc');
const { integrations } = await PageObjects.observabilityLogsExplorer.getIntegrations();
expect(integrations).to.eql(initialPackagesTexts.slice().reverse());
});
// Test back ascending order
await PageObjects.observabilityLogsExplorer.clickSortButtonBy('asc');
await retry.try(async () => {
await PageObjects.observabilityLogsExplorer.clickSortButtonBy('desc');
await PageObjects.observabilityLogsExplorer.clickSortButtonBy('asc');
const { integrations } = await PageObjects.observabilityLogsExplorer.getIntegrations();
expect(integrations).to.eql(initialPackagesTexts);
});