mirror of
https://github.com/elastic/kibana.git
synced 2025-04-23 17:28:26 -04:00
* Wait for saveSearch to reload, retry on openSavedSearch * Added comments and moved a waitUntilLoadingHasFinished
This commit is contained in:
parent
2e2964fa92
commit
8bd1b047dd
1 changed files with 19 additions and 3 deletions
|
@ -17,6 +17,8 @@
|
|||
* under the License.
|
||||
*/
|
||||
|
||||
import expect from 'expect.js';
|
||||
|
||||
export function DiscoverPageProvider({ getService, getPageObjects }) {
|
||||
const config = getService('config');
|
||||
const log = getService('log');
|
||||
|
@ -53,6 +55,15 @@ export function DiscoverPageProvider({ getService, getPageObjects }) {
|
|||
await getRemote().findDisplayedById('SaveSearch').pressKeys(searchName);
|
||||
await testSubjects.click('discoverSaveSearchButton');
|
||||
await PageObjects.header.waitUntilLoadingHasFinished();
|
||||
// LeeDr - this additional checking for the saved search name was an attempt
|
||||
// to cause this method to wait for the reloading of the page to complete so
|
||||
// that the next action wouldn't have to retry. But it doesn't really solve
|
||||
// that issue. But it does typically take about 3 retries to
|
||||
// complete with the expected searchName.
|
||||
await retry.try(async () => {
|
||||
const name = await this.getCurrentQueryName();
|
||||
expect(name).to.be(searchName);
|
||||
});
|
||||
}
|
||||
|
||||
async getColumnHeaders() {
|
||||
|
@ -61,9 +72,14 @@ export function DiscoverPageProvider({ getService, getPageObjects }) {
|
|||
}
|
||||
|
||||
async openSavedSearch() {
|
||||
await this.clickLoadSavedSearchButton();
|
||||
await testSubjects.exists('loadSearchForm');
|
||||
await PageObjects.header.waitUntilLoadingHasFinished();
|
||||
// We need this try loop here because previous actions in Discover like
|
||||
// saving a search cause reloading of the page and the "Open" menu item goes stale.
|
||||
await retry.try(async () => {
|
||||
await this.clickLoadSavedSearchButton();
|
||||
await PageObjects.header.waitUntilLoadingHasFinished();
|
||||
const loadIsOpen = await testSubjects.exists('loadSearchForm');
|
||||
expect(loadIsOpen).to.be(true);
|
||||
});
|
||||
}
|
||||
|
||||
async hasSavedSearch(searchName) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue