fix viewer page loading method (#6577)

This commit is contained in:
Eugenio Romano
2021-01-26 17:58:54 +00:00
committed by GitHub
parent 099bec6f1d
commit 5258a34a5d
2 changed files with 25 additions and 5 deletions

View File

@@ -24,6 +24,8 @@ import { Logger } from '../utils/logger';
export class ViewerPage {
MAX_LOADING_TIME = 120000;
tabsPage = new TabsPage();
togglePage = new TogglePage();
@@ -117,13 +119,14 @@ export class ViewerPage {
async waitTillContentLoaded(): Promise<void> {
await browser.sleep(500);
if (this.isSpinnerPresent()) {
if (await this.isSpinnerPresent()) {
Logger.log('wait spinner disappear');
await BrowserVisibility.waitUntilElementIsNotPresent(element(by.tagName('mat-progress-spinner')));
await BrowserVisibility.waitUntilElementIsNotVisible(element(by.tagName('mat-progress-spinner')), this.MAX_LOADING_TIME);
} else {
try {
Logger.log('wait spinner is present');
await BrowserVisibility.waitUntilElementIsPresent(element(by.tagName('mat-progress-spinner')));
await BrowserVisibility.waitUntilElementIsVisible(element(by.tagName('mat-progress-spinner')));
await BrowserVisibility.waitUntilElementIsNotVisible(element(by.tagName('mat-progress-spinner')), this.MAX_LOADING_TIME);
} catch (error) {
}
}