From cdaa0302929776ecd2771ba862809fde36fadc0d Mon Sep 17 00:00:00 2001 From: Robert Oskamp Date: Wed, 24 Nov 2021 18:01:49 +0100 Subject: [PATCH] [ML] Functional tests - stabilize Discover custom URL test (#119578) This PR stabilizes the Discover custom URL test by making sure all popover are closed before clicking the Discover hide side bar button. --- x-pack/test/functional/services/ml/custom_urls.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/x-pack/test/functional/services/ml/custom_urls.ts b/x-pack/test/functional/services/ml/custom_urls.ts index 3d26236741a8..1695b575e1f0 100644 --- a/x-pack/test/functional/services/ml/custom_urls.ts +++ b/x-pack/test/functional/services/ml/custom_urls.ts @@ -16,6 +16,7 @@ export function MachineLearningCustomUrlsProvider({ getService, getPageObjects, }: FtrProviderContext) { + const browser = getService('browser'); const testSubjects = getService('testSubjects'); const retry = getService('retry'); const comboBox = getService('comboBox'); @@ -169,6 +170,9 @@ export function MachineLearningCustomUrlsProvider({ async assertDiscoverCustomUrlAction(expectedHitCountFormatted: string) { await PageObjects.discover.waitForDiscoverAppOnScreen(); + // Make sure all existing popovers are closed + await browser.pressKeys(browser.keys.ESCAPE); + // During cloud tests, the small browser width might cause hit count to be invisible // so temporarily collapsing the sidebar ensures the count shows await PageObjects.discover.closeSidebar();