Skip to content

Commit f92f51a

Browse files
committed
[ML] Functional tests - stabilize Discover custom URL test (elastic#119578)
This PR stabilizes the Discover custom URL test by making sure all popover are closed before clicking the Discover hide side bar button. # Conflicts: # x-pack/test/functional/services/ml/custom_urls.ts
1 parent a13a01c commit f92f51a

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

x-pack/test/functional/services/ml/custom_urls.ts

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ export function MachineLearningCustomUrlsProvider({
1616
getService,
1717
getPageObjects,
1818
}: FtrProviderContext) {
19+
const browser = getService('browser');
1920
const testSubjects = getService('testSubjects');
2021
const retry = getService('retry');
2122
const comboBox = getService('comboBox');
@@ -169,7 +170,13 @@ export function MachineLearningCustomUrlsProvider({
169170

170171
async assertDiscoverCustomUrlAction(expectedHitCountFormatted: string) {
171172
await PageObjects.discover.waitForDiscoverAppOnScreen();
172-
await retry.tryForTime(5000, async () => {
173+
// Make sure all existing popovers are closed
174+
await browser.pressKeys(browser.keys.ESCAPE);
175+
176+
// During cloud tests, the small browser width might cause hit count to be invisible
177+
// so temporarily collapsing the sidebar ensures the count shows
178+
await PageObjects.discover.closeSidebar();
179+
await retry.tryForTime(10 * 1000, async () => {
173180
const hitCount = await PageObjects.discover.getHitCount();
174181
expect(hitCount).to.eql(
175182
expectedHitCountFormatted,

0 commit comments

Comments
 (0)