Fix flaky lab mode test (#17622)
This commit is contained in:
parent
7b827e87a5
commit
f5b28c18fb
|
@ -1,4 +1,4 @@
|
|||
<form role="form" ng-submit="fetch()">
|
||||
<form role="form" ng-submit="fetch()" data-test-subj="loadSearchForm">
|
||||
<h2 class="kuiLocalDropdownTitle">
|
||||
Open Search
|
||||
</h2>
|
||||
|
|
|
@ -9,6 +9,7 @@ export default function ({ getService, getPageObjects }) {
|
|||
it('disabling does not break loading saved searches', async () => {
|
||||
await PageObjects.common.navigateToUrl('discover', '');
|
||||
await PageObjects.discover.saveSearch('visualize_lab_mode_test');
|
||||
await PageObjects.discover.openSavedSearch();
|
||||
const hasSaved = await PageObjects.discover.hasSavedSearch('visualize_lab_mode_test');
|
||||
expect(hasSaved).to.be(true);
|
||||
|
||||
|
@ -21,6 +22,7 @@ export default function ({ getService, getPageObjects }) {
|
|||
|
||||
// Expect the discover still to list that saved visualization in the open list
|
||||
await PageObjects.header.clickDiscover();
|
||||
await PageObjects.discover.openSavedSearch();
|
||||
const stillHasSaved = await PageObjects.discover.hasSavedSearch('visualize_lab_mode_test');
|
||||
expect(stillHasSaved).to.be(true);
|
||||
log.info('found saved search after toggling enableLabs mode');
|
||||
|
|
|
@ -53,9 +53,12 @@ export function DiscoverPageProvider({ getService, getPageObjects }) {
|
|||
return await Promise.all(headerElements.map(el => el.getVisibleText()));
|
||||
}
|
||||
|
||||
async hasSavedSearch(searchName) {
|
||||
async openSavedSearch() {
|
||||
await this.clickLoadSavedSearchButton();
|
||||
await PageObjects.header.waitUntilLoadingHasFinished();
|
||||
await testSubjects.exists('loadSearchForm');
|
||||
}
|
||||
|
||||
async hasSavedSearch(searchName) {
|
||||
const searchLink = await find.byPartialLinkText(searchName);
|
||||
return searchLink.isDisplayed();
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue