From d769242c37c5028b6156c53434b5c5a4641c85f0 Mon Sep 17 00:00:00 2001 From: Julia Rechkunova Date: Tue, 16 Apr 2024 22:09:08 +0200 Subject: [PATCH] [Discover] Fix customization flaky test (#180940) - Closes https://github.com/elastic/kibana/issues/177401 25x https://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/5695 --- .../customizations.ts | 17 ++++++++++------- .../customizations.ts | 17 ++++++++++------- 2 files changed, 20 insertions(+), 14 deletions(-) diff --git a/test/examples/discover_customization_examples/customizations.ts b/test/examples/discover_customization_examples/customizations.ts index 33aeae98d7154..6d0d223a06cfe 100644 --- a/test/examples/discover_customization_examples/customizations.ts +++ b/test/examples/discover_customization_examples/customizations.ts @@ -20,6 +20,7 @@ export default ({ getService, getPageObjects }: FtrProviderContext) => { const testSubjects = getService('testSubjects'); const browser = getService('browser'); const dataGrid = getService('dataGrid'); + const retry = getService('retry'); const defaultSettings = { defaultIndex: 'logstash-*' }; describe('Customizations', () => { @@ -61,13 +62,15 @@ export default ({ getService, getPageObjects }: FtrProviderContext) => { await testSubjects.click('logsViewSelectorButton'); await testSubjects.click('logsViewSelectorOption-ASavedSearch'); await PageObjects.header.waitUntilLoadingHasFinished(); - const { title, description } = await PageObjects.common.getSharedItemTitleAndDescription(); - const expected = { - title: 'A Saved Search', - description: 'A Saved Search Description', - }; - expect(title).to.eql(expected.title); - expect(description).to.eql(expected.description); + await retry.try(async () => { + const { title, description } = await PageObjects.common.getSharedItemTitleAndDescription(); + const expected = { + title: 'A Saved Search', + description: 'A Saved Search Description', + }; + expect(title).to.eql(expected.title); + expect(description).to.eql(expected.description); + }); }); it('Search bar Prepend Filters exists and should apply filter properly', async () => { diff --git a/x-pack/test_serverless/functional/test_suites/common/examples/discover_customization_examples/customizations.ts b/x-pack/test_serverless/functional/test_suites/common/examples/discover_customization_examples/customizations.ts index e538ead1ce64b..08e59867c8aac 100644 --- a/x-pack/test_serverless/functional/test_suites/common/examples/discover_customization_examples/customizations.ts +++ b/x-pack/test_serverless/functional/test_suites/common/examples/discover_customization_examples/customizations.ts @@ -18,6 +18,7 @@ export default ({ getService, getPageObjects }: FtrProviderContext) => { const testSubjects = getService('testSubjects'); const browser = getService('browser'); const dataGrid = getService('dataGrid'); + const retry = getService('retry'); const defaultSettings = { defaultIndex: 'logstash-*' }; describe('Customizations', () => { @@ -60,13 +61,15 @@ export default ({ getService, getPageObjects }: FtrProviderContext) => { await testSubjects.click('logsViewSelectorButton'); await testSubjects.click('logsViewSelectorOption-ASavedSearch'); await PageObjects.header.waitUntilLoadingHasFinished(); - const { title, description } = await PageObjects.common.getSharedItemTitleAndDescription(); - const expected = { - title: 'A Saved Search', - description: 'A Saved Search Description', - }; - expect(title).to.eql(expected.title); - expect(description).to.eql(expected.description); + await retry.try(async () => { + const { title, description } = await PageObjects.common.getSharedItemTitleAndDescription(); + const expected = { + title: 'A Saved Search', + description: 'A Saved Search Description', + }; + expect(title).to.eql(expected.title); + expect(description).to.eql(expected.description); + }); }); it('Search bar Prepend Filters exists and should apply filter properly', async () => {