[ADF-5263] Empty page displayed all the time when load content fix (#6209)

* Make test run on API update
Improve create librrary test

* Fix empty page displayed always first

* remvoe console

* fix

* fix

* lint

* fix

* fix

* fix

* fix

* fix
This commit is contained in:
Eugenio Romano
2020-10-05 00:26:56 +01:00
committed by GitHub
parent d128bc158c
commit 04f5fdffd7
27 changed files with 174 additions and 179 deletions

View File

@@ -50,7 +50,7 @@ export class CardTextItemPage {
async enterTextField(text: string): Promise<void> {
await BrowserVisibility.waitUntilElementIsVisible(this.rootElement.element(this.textField));
await BrowserActions.clearSendKeys(this.rootElement.element(this.textField), text);
await BrowserActions.clearSendKeys(this.rootElement.element(this.textField), text, 500);
await this.rootElement.element(this.textField).sendKeys(Key.TAB);
}

View File

@@ -36,6 +36,8 @@ export class DataTableComponentPage {
emptyListTitle: ElementFinder;
emptyListSubtitle: ElementFinder;
MAX_LOADING_TIME = 120000;
constructor(rootElement = element.all(by.css('adf-datatable')).first()) {
this.rootElement = rootElement;
this.list = this.rootElement.all(by.css(`div[class*='adf-datatable-body'] adf-datatable-row[class*='adf-datatable-row']`));
@@ -311,21 +313,24 @@ export class DataTableComponentPage {
}
async waitTillContentLoaded(): Promise<void> {
await browser.sleep(500);
if (await this.isSpinnerPresent()) {
Logger.log('wait datatable loading spinner disappear');
await BrowserVisibility.waitUntilElementIsNotVisible(element(by.tagName('mat-spinner')));
await BrowserVisibility.waitUntilElementIsNotVisible(this.rootElement.element(by.tagName('mat-progress-spinner')), this.MAX_LOADING_TIME);
if (await this.isEmpty()) {
Logger.log('empty page');
} else {
await this.waitFirstElementPresent();
}
} else if (await this.isEmpty()) {
Logger.log('empty page');
} else {
try {
Logger.log('wait datatable loading spinner is present');
await BrowserVisibility.waitUntilElementIsVisible(element(by.tagName('mat-spinner')), 2000);
await BrowserVisibility.waitUntilElementIsVisible(this.rootElement.element(by.tagName('mat-progress-spinner')), 2000);
await BrowserVisibility.waitUntilElementIsNotVisible(this.rootElement.element(by.tagName('mat-progress-spinner')), this.MAX_LOADING_TIME);
} catch (error) {
}
@@ -341,7 +346,7 @@ export class DataTableComponentPage {
let isSpinnerPresent;
try {
isSpinnerPresent = await element(by.tagName('mat-spinner')).isDisplayed();
isSpinnerPresent = await this.rootElement.element(by.tagName('mat-progress-spinner')).isDisplayed();
} catch (error) {
isSpinnerPresent = false;
}
@@ -353,7 +358,7 @@ export class DataTableComponentPage {
let isSpinnerPresent;
try {
isSpinnerPresent = await element(by.tagName('mat-progress-bar')).isDisplayed();
isSpinnerPresent = await this.rootElement.element(by.tagName('mat-progress-bar')).isDisplayed();
} catch (error) {
isSpinnerPresent = false;
}

View File

@@ -119,11 +119,11 @@ export class ViewerPage {
if (this.isSpinnerPresent()) {
Logger.log('wait spinner disappear');
await BrowserVisibility.waitUntilElementIsNotPresent(element(by.tagName('mat-spinner')));
await BrowserVisibility.waitUntilElementIsNotPresent(element(by.tagName('mat-progress-spinner')));
} else {
try {
Logger.log('wait spinner is present');
await BrowserVisibility.waitUntilElementIsPresent(element(by.tagName('mat-spinner')));
await BrowserVisibility.waitUntilElementIsPresent(element(by.tagName('mat-progress-spinner')));
} catch (error) {
}
}
@@ -133,7 +133,7 @@ export class ViewerPage {
let isSpinnerPresent;
try {
isSpinnerPresent = await element(by.tagName('mat-spinner')).isDisplayed();
isSpinnerPresent = await element(by.tagName('mat-progress-spinner')).isDisplayed();
} catch (error) {
isSpinnerPresent = false;
}