From fd604538ca451b470f81f389838592dc8cf1f3ec Mon Sep 17 00:00:00 2001 From: Julia Rechkunova Date: Mon, 18 Sep 2023 09:35:12 +0200 Subject: [PATCH] [Discover] Fix ESQL flaky test (#166249) - Closes https://github.com/elastic/kibana/issues/165860 100x https://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/3083 --- test/functional/apps/discover/group2/_esql_view.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/test/functional/apps/discover/group2/_esql_view.ts b/test/functional/apps/discover/group2/_esql_view.ts index d820841b16cd0..212420b56317d 100644 --- a/test/functional/apps/discover/group2/_esql_view.ts +++ b/test/functional/apps/discover/group2/_esql_view.ts @@ -91,6 +91,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { await monacoEditor.setCodeEditorValue(testQuery); await testSubjects.click('querySubmitButton'); await PageObjects.header.waitUntilLoadingHasFinished(); + await PageObjects.discover.waitUntilSearchingHasFinished(); // here Lens suggests a XY so it is rendered expect(await testSubjects.exists('unifiedHistogramChart')).to.be(true); expect(await testSubjects.exists('xyVisChart')).to.be(true); @@ -104,6 +105,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { await monacoEditor.setCodeEditorValue(testQuery); await testSubjects.click('querySubmitButton'); await PageObjects.header.waitUntilLoadingHasFinished(); + await PageObjects.discover.waitUntilSearchingHasFinished(); let cell = await dataGrid.getCellElement(0, 2); expect(await cell.getVisibleText()).to.be('1'); await PageObjects.timePicker.setAbsoluteRange( @@ -111,9 +113,11 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { 'Sep 19, 2015 @ 06:31:44.000' ); await PageObjects.header.waitUntilLoadingHasFinished(); + await PageObjects.discover.waitUntilSearchingHasFinished(); expect(await testSubjects.exists('discoverNoResults')).to.be(true); await PageObjects.timePicker.setDefaultAbsoluteRange(); await PageObjects.header.waitUntilLoadingHasFinished(); + await PageObjects.discover.waitUntilSearchingHasFinished(); cell = await dataGrid.getCellElement(0, 2); expect(await cell.getVisibleText()).to.be('1'); });