mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-24 17:32:15 +00:00
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:
@@ -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());
|
||||
}
|
||||
|
||||
|
@@ -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);
|
||||
}
|
||||
|
@@ -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> {
|
||||
|
Reference in New Issue
Block a user