From 997a6a597c4912def5f4e528ac7cf305976c0428 Mon Sep 17 00:00:00 2001 From: liza-mae Date: Tue, 26 Jun 2018 10:28:15 -0600 Subject: [PATCH] Fix flaky visualize lab mode tests (#20165) * Update saveSearch method in discover and add wait page loading for advance settings * Fix spaces --- test/functional/page_objects/discover_page.js | 28 ++++++------------- test/functional/page_objects/settings_page.js | 1 + 2 files changed, 9 insertions(+), 20 deletions(-) diff --git a/test/functional/page_objects/discover_page.js b/test/functional/page_objects/discover_page.js index 49e431609b098..bd5aa434f4ef8 100644 --- a/test/functional/page_objects/discover_page.js +++ b/test/functional/page_objects/discover_page.js @@ -51,20 +51,12 @@ export function DiscoverPageProvider({ getService, getPageObjects }) { .getVisibleText(); } - saveSearch(searchName) { - return this.clickSaveSearchButton() - .then(() => { - log.debug('--saveSearch button clicked'); - return getRemote().findDisplayedById('SaveSearch') - .pressKeys(searchName); - }) - .then(() => { - log.debug('--find save button'); - return testSubjects.click('discoverSaveSearchButton'); - }) - .then(async () => { - return await testSubjects.exists('saveSearchSuccess', 2000); - }); + async saveSearch(searchName) { + log.debug('saveSearch'); + await this.clickSaveSearchButton(); + await getRemote().findDisplayedById('SaveSearch').pressKeys(searchName); + await testSubjects.click('discoverSaveSearchButton'); + await PageObjects.header.waitUntilLoadingHasFinished(); } async getColumnHeaders() { @@ -74,12 +66,8 @@ export function DiscoverPageProvider({ getService, getPageObjects }) { async openSavedSearch() { await this.clickLoadSavedSearchButton(); - await retry.try(async () => { - const isLoadFormVisible = await testSubjects.exists('loadSearchForm'); - if (!isLoadFormVisible) { - throw new Error('Load search form not visible yet.'); - } - }); + await testSubjects.exists('loadSearchForm'); + await PageObjects.header.waitUntilLoadingHasFinished(); } async hasSavedSearch(searchName) { diff --git a/test/functional/page_objects/settings_page.js b/test/functional/page_objects/settings_page.js index 9f3c54c1be566..d436bd69d5d67 100644 --- a/test/functional/page_objects/settings_page.js +++ b/test/functional/page_objects/settings_page.js @@ -44,6 +44,7 @@ export function SettingsPageProvider({ getService, getPageObjects }) { async clickKibanaSettings() { await this.clickLinkText('Advanced Settings'); + await PageObjects.header.waitUntilLoadingHasFinished(); } async clickKibanaSavedObjects() {