Skip to content

Commit

Permalink
Fix flaky visualize lab mode tests (elastic#20165)
Browse files Browse the repository at this point in the history
* Update saveSearch method in discover and add wait page loading for advance settings

* Fix spaces
  • Loading branch information
liza-mae authored and Liza Dayoub committed Jun 26, 2018
1 parent d44abbb commit a9c5a3d
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 14 deletions.
21 changes: 7 additions & 14 deletions test/functional/page_objects/discover_page.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,20 +32,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() {
Expand All @@ -56,6 +48,7 @@ export function DiscoverPageProvider({ getService, getPageObjects }) {
async openSavedSearch() {
await this.clickLoadSavedSearchButton();
await testSubjects.exists('loadSearchForm');
await PageObjects.header.waitUntilLoadingHasFinished();
}

async hasSavedSearch(searchName) {
Expand Down
1 change: 1 addition & 0 deletions test/functional/page_objects/settings_page.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ export function SettingsPageProvider({ getService, getPageObjects }) {

async clickKibanaSettings() {
await this.clickLinkText('Advanced Settings');
await PageObjects.header.waitUntilLoadingHasFinished();
}

async clickKibanaSavedObjects() {
Expand Down

0 comments on commit a9c5a3d

Please sign in to comment.