mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-24 17:32:15 +00:00
[DW-1478] E2e - Move 'filter' component from Admin Application (#5061)
* [DW-1478] E2e - Move 'filter' component from Admin Application * Replace admin e2e framework methods with ADF reusable ones * Add return type for filter component method * Fix browser-actions errors * Remove clear() method from browser-actions * Add and rename edit filter components methods * Remove unused methods from browser-actions Add method to retrieve the application selected in Edit Process Filter * Fix called method in edit task filter component
This commit is contained in:
committed by
Eugenio Romano
parent
140f60b8dc
commit
46247c6351
@@ -21,9 +21,18 @@ import { BrowserVisibility } from '../utils/browser-visibility';
|
||||
export class BrowserActions {
|
||||
|
||||
static async click(elementFinder: ElementFinder): Promise<void> {
|
||||
await BrowserVisibility.waitUntilElementIsVisible(elementFinder);
|
||||
await BrowserVisibility.waitUntilElementIsClickable(elementFinder);
|
||||
await elementFinder.click();
|
||||
try {
|
||||
await BrowserVisibility.waitUntilElementIsVisible(elementFinder);
|
||||
await BrowserVisibility.waitUntilElementIsClickable(elementFinder);
|
||||
await elementFinder.click();
|
||||
} catch (clickErr) {
|
||||
try {
|
||||
await browser.executeScript(`arguments[0].scrollIntoView();`, elementFinder);
|
||||
await browser.executeScript(`arguments[0].click();`, elementFinder);
|
||||
} catch (jsErr) {
|
||||
throw jsErr;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static async waitUntilActionMenuIsVisible(): Promise<void> {
|
||||
|
@@ -26,7 +26,7 @@ export class BrowserVisibility {
|
||||
return browser.wait(until.presenceOf(elementToCheck), waitTimeout, 'Element is not present ' + elementToCheck.locator());
|
||||
}
|
||||
/*
|
||||
* Wait for element is visible
|
||||
* Wait for element to be visible
|
||||
*/
|
||||
static async waitUntilElementIsVisible(elementToCheck: ElementFinder, waitTimeout: number = DEFAULT_TIMEOUT, message: string = 'Element is not visible'): Promise<any> {
|
||||
return browser.wait(until.visibilityOf(elementToCheck), waitTimeout, message + elementToCheck.locator());
|
||||
|
@@ -27,6 +27,7 @@ export class EditProcessFilterCloudComponentPage {
|
||||
saveButton: ElementFinder = element(by.css('button[data-automation-id="adf-filter-action-save"]'));
|
||||
saveAsButton: ElementFinder = element(by.css('button[data-automation-id="adf-filter-action-saveAs"]'));
|
||||
deleteButton: ElementFinder = element(by.css('button[data-automation-id="adf-filter-action-delete"]'));
|
||||
filter: ElementFinder = element(by.css(`adf-cloud-edit-process-filter mat-expansion-panel-header`));
|
||||
|
||||
editProcessFilterDialogPage = new EditProcessFilterDialogPage();
|
||||
|
||||
@@ -34,7 +35,11 @@ export class EditProcessFilterCloudComponentPage {
|
||||
return this.editProcessFilterDialogPage;
|
||||
}
|
||||
|
||||
async clickCustomiseFilterHeader(): Promise<void> {
|
||||
async isFilterDisplayed(): Promise<Boolean> {
|
||||
return await BrowserVisibility.waitUntilElementIsVisible(this.filter);
|
||||
}
|
||||
|
||||
async openFilter(): Promise<void> {
|
||||
await BrowserActions.click(this.customiseFilter);
|
||||
await browser.driver.sleep(1000);
|
||||
}
|
||||
@@ -93,6 +98,11 @@ export class EditProcessFilterCloudComponentPage {
|
||||
await BrowserActions.click(appNameElement);
|
||||
}
|
||||
|
||||
async getApplicationSelected(): Promise<String> {
|
||||
const applicationDropdown = element(by.css(`[data-automation-id='adf-cloud-edit-process-property-appName']`));
|
||||
return await applicationDropdown.getText();
|
||||
}
|
||||
|
||||
async checkAppNamesAreUnique(): Promise<boolean> {
|
||||
const appNameList = element.all(by.css('mat-option[data-automation-id="adf-cloud-edit-process-property-optionsappName"] span'));
|
||||
const appTextList: any = await appNameList.getText();
|
||||
@@ -109,6 +119,11 @@ export class EditProcessFilterCloudComponentPage {
|
||||
return dropdownOptions.count();
|
||||
}
|
||||
|
||||
async isApplicationListLoaded(): Promise<Boolean> {
|
||||
const emptyList = element(by.css(`[data-automation-id='adf-cloud-edit-process-property-appName'] .mat-select-placeholder`));
|
||||
return await BrowserVisibility.waitUntilElementIsNotVisible(emptyList);
|
||||
}
|
||||
|
||||
async setProcessInstanceId(option): Promise<void> {
|
||||
await this.setProperty('processInstanceId', option);
|
||||
}
|
||||
|
@@ -38,6 +38,7 @@ export class EditTaskFilterCloudComponentPage {
|
||||
saveButton: ElementFinder = element(by.css('[data-automation-id="adf-filter-action-save"]'));
|
||||
saveAsButton: ElementFinder = element(by.css('[data-automation-id="adf-filter-action-saveAs"]'));
|
||||
deleteButton: ElementFinder = element(by.css('[data-automation-id="adf-filter-action-delete"]'));
|
||||
filter: ElementFinder = element(by.css(`adf-cloud-edit-task-filter mat-expansion-panel-header`));
|
||||
|
||||
editTaskFilterDialogPage = new EditTaskFilterDialogPage();
|
||||
|
||||
@@ -45,7 +46,11 @@ export class EditTaskFilterCloudComponentPage {
|
||||
return this.editTaskFilterDialogPage;
|
||||
}
|
||||
|
||||
async clickCustomiseFilterHeader(): Promise<void> {
|
||||
async isFilterDisplayed(): Promise<Boolean> {
|
||||
return await BrowserVisibility.waitUntilElementIsVisible(this.filter);
|
||||
}
|
||||
|
||||
async openFilter(): Promise<void> {
|
||||
await BrowserActions.click(this.customiseFilter);
|
||||
await browser.driver.sleep(1000);
|
||||
}
|
||||
|
Reference in New Issue
Block a user