mirror of
https://github.com/elastic/kibana.git
synced 2025-04-23 17:28:26 -04:00
* attempt to fix dashboard view/edit flaky test hope to fix https://github.com/elastic/kibana/issues/12014 * Need to wait for global loading indicator to be hidden once top nav is visible * use Error object for throw * inline function only used once
This commit is contained in:
parent
63d0415700
commit
22ba3a0622
2 changed files with 16 additions and 3 deletions
|
@ -270,6 +270,15 @@ export function CommonPageProvider({ getService, getPageObjects, getPageObject }
|
|||
async isChromeVisible() {
|
||||
return await testSubjects.exists('kibanaChrome');
|
||||
}
|
||||
|
||||
async waitForTopNavToBeVisible() {
|
||||
await retry.try(async () => {
|
||||
const isNavVisible = await testSubjects.exists('top-nav');
|
||||
if (!isNavVisible) {
|
||||
throw new Error('Local nav not visible yet');
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
return new CommonPage();
|
||||
|
|
|
@ -10,6 +10,7 @@ export function HeaderPageProvider({ getService, getPageObjects }) {
|
|||
const defaultFindTimeout = config.get('timeouts.find');
|
||||
|
||||
class HeaderPage {
|
||||
|
||||
async clickSelector(selector) {
|
||||
remote.setFindTimeout(defaultFindTimeout);
|
||||
await remote.findByCssSelector(selector).click();
|
||||
|
@ -18,19 +19,22 @@ export function HeaderPageProvider({ getService, getPageObjects }) {
|
|||
async clickDiscover() {
|
||||
log.debug('click Discover tab');
|
||||
await this.clickSelector('a[href*=\'discover\']');
|
||||
await PageObjects.common.sleep(3000);
|
||||
await PageObjects.common.waitForTopNavToBeVisible();
|
||||
await this.isGlobalLoadingIndicatorHidden();
|
||||
}
|
||||
|
||||
async clickVisualize() {
|
||||
log.debug('click Visualize tab');
|
||||
await this.clickSelector('a[href*=\'visualize\']');
|
||||
await PageObjects.common.sleep(3000);
|
||||
await PageObjects.common.waitForTopNavToBeVisible();
|
||||
await this.isGlobalLoadingIndicatorHidden();
|
||||
}
|
||||
|
||||
async clickDashboard() {
|
||||
log.debug('click Dashboard tab');
|
||||
await this.clickSelector('a[href*=\'dashboard\']');
|
||||
await PageObjects.common.sleep(3000);
|
||||
await PageObjects.common.waitForTopNavToBeVisible();
|
||||
await this.isGlobalLoadingIndicatorHidden();
|
||||
}
|
||||
|
||||
async clickSettings() {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue