stabilize some e2e cloud (#5701)

* stabilize some e2e cloud

* Update protractor.conf.ts

* Update protractor.conf.ts

* improve some other test

* fix
This commit is contained in:
Eugenio Romano
2020-05-14 09:42:40 +01:00
committed by GitHub
parent bf729f60a2
commit c26b8e046c
9 changed files with 48 additions and 32 deletions

View File

@@ -17,7 +17,8 @@
import { browser, by, element, ElementFinder, protractor } from 'protractor';
const DEFAULT_TIMEOUT = global['TestConfig'] ? global['TestConfig'].main.timeout : 40000;
const DEFAULT_TIMEOUT = global['TestConfig'] ? global['TestConfig'].main.timeout : 20000;
const NOT_VISIBLE_DEFAULT_TIMEOUT = global['TestConfig'] ? global['TestConfig'].main.timeout : 5000;
export class BrowserVisibility {
@@ -48,7 +49,7 @@ export class BrowserVisibility {
/*
* Wait for element to not be visible
*/
static async waitUntilElementIsNotVisible(elementToCheck: ElementFinder, waitTimeout: number = DEFAULT_TIMEOUT): Promise<any> {
static async waitUntilElementIsNotVisible(elementToCheck: ElementFinder, waitTimeout: number = NOT_VISIBLE_DEFAULT_TIMEOUT): Promise<any> {
return browser.wait(protractor.ExpectedConditions.invisibilityOf(elementToCheck), waitTimeout, 'Element is Visible and it should not' + elementToCheck.locator());
}
@@ -59,7 +60,7 @@ export class BrowserVisibility {
return browser.wait(protractor.ExpectedConditions.textToBePresentInElementValue(elementToCheck, elementValue), waitTimeout, 'Element doesn\'t have a value ' + elementToCheck.locator());
}
static async waitUntilElementIsNotPresent(elementToCheck: ElementFinder, waitTimeout: number = DEFAULT_TIMEOUT): Promise<any> {
static async waitUntilElementIsNotPresent(elementToCheck: ElementFinder, waitTimeout: number = NOT_VISIBLE_DEFAULT_TIMEOUT): Promise<any> {
return browser.wait(protractor.ExpectedConditions.stalenessOf(elementToCheck), waitTimeout, 'Element is present ' + elementToCheck.locator());
}

View File

@@ -24,6 +24,7 @@ export class PeopleCloudComponentPage {
peopleCloudSearch: ElementFinder = element(by.css('input[data-automation-id="adf-people-cloud-search-input"]'));
assigneeField: ElementFinder = element(by.css('input[data-automation-id="adf-people-cloud-search-input"]'));
selectionReady: ElementFinder = element(by.css('div[data-automation-id="adf-people-cloud-row"]'));
formFields: FormFields = new FormFields();
labelLocator: Locator = by.css("label[class*='adf-label']");
inputLocator: Locator = by.css('input');
@@ -48,10 +49,6 @@ export class PeopleCloudComponentPage {
await BrowserActions.clearSendKeys(this.peopleCloudSearch, name);
}
async searchAssigneeToExisting(name: string): Promise<void> {
await BrowserActions.clearSendKeys(this.peopleCloudSearch, name);
}
async selectAssigneeFromList(name: string): Promise<void> {
const assigneeRow = element.all(by.cssContainingText('mat-option span.adf-people-label-name', name)).first();
await BrowserActions.click(assigneeRow);
@@ -79,6 +76,7 @@ export class PeopleCloudComponentPage {
}
async checkUserIsNotDisplayed(name: string): Promise<void> {
await BrowserVisibility.waitUntilElementIsVisible(this.selectionReady);
const assigneeRow = element(by.cssContainingText('mat-option span.adf-people-label-name', name));
await BrowserVisibility.waitUntilElementIsNotVisible(assigneeRow);
}

View File

@@ -34,7 +34,7 @@ export class TaskFiltersCloudComponentPage {
this.filter = this.getTaskFilterLocatorByFilterName(filterName);
await BrowserVisibility.waitUntilElementIsClickable(this.filter);
await BrowserActions.click(this.filter);
await browser.sleep(1000);
await browser.sleep(1500);
}
async checkTaskFilterNotDisplayed(filterName: string): Promise<void> {