mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-31 17:38:48 +00:00
[AAE-1729] Move task-process filters methods into adf-testing, refactor dropdowns to use dropdown material testing page (#5467)
* [AAE-1729] Move task-process filters methods into adf-testing * [AAE-1729] Add default filters methods in testing package * [AAE-1729] Refactor testing package and e2e to use Dropdown testing page * [AAE-1729] Rename function * [AAE-1729] Fix failing e2e, add click and select dropdown method * [AAE-1729] Fix e2e * [AAE-1729] fix e2e * [AAE-1729] Add default filters methods in testing package * [AAE-1729] Slow down upload speed, fix cancel upload e2e * [AAE-1729] Undo slow down upload speed, fix cancel upload e2e
This commit is contained in:
@@ -15,7 +15,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { BrowserActions, BrowserVisibility, DataTableComponentPage } from '@alfresco/adf-testing';
|
||||
import { BrowserActions, BrowserVisibility, DataTableComponentPage, DropdownPage } from '@alfresco/adf-testing';
|
||||
import { browser, by, element, ElementArrayFinder, ElementFinder, protractor } from 'protractor';
|
||||
|
||||
export class DataTablePage {
|
||||
@@ -45,6 +45,8 @@ export class DataTablePage {
|
||||
idColumnHeader: ElementFinder = element(by.css(`div[data-automation-id='auto_id_id']`));
|
||||
pasteClipboardInput: ElementFinder = element(by.css(`input[data-automation-id='paste clipboard input']`));
|
||||
|
||||
selectModeDropdown = new DropdownPage(element(by.css(`mat-select[data-automation-id='datatable-selection-mode']`)));
|
||||
|
||||
constructor(data?) {
|
||||
if (this.data[data]) {
|
||||
this.dataTable = new DataTableComponentPage(element(by.css(`div[data-automation-id='` + this.data[data] + `']`)));
|
||||
@@ -127,9 +129,7 @@ export class DataTablePage {
|
||||
}
|
||||
|
||||
async selectSelectionMode(selectionMode): Promise<void> {
|
||||
const selectMode: ElementFinder = element(by.cssContainingText(`span[class='mat-option-text']`, selectionMode));
|
||||
await BrowserActions.clickExecuteScript('div[class="mat-select-arrow"]');
|
||||
await BrowserActions.click(selectMode);
|
||||
await this.selectModeDropdown.clickDropdownWithOption(selectionMode);
|
||||
}
|
||||
|
||||
getRowCheckbox(rowNumber: string): ElementFinder {
|
||||
|
@@ -20,18 +20,12 @@ import { by, element, ElementFinder } from 'protractor';
|
||||
|
||||
export class ProcessCloudDemoPage {
|
||||
|
||||
allProcesses: ElementFinder = element(by.css('span[data-automation-id="all-processes_filter"]'));
|
||||
runningProcesses: ElementFinder = element(by.css('span[data-automation-id="running-processes_filter"]'));
|
||||
completedProcesses: ElementFinder = element(by.css('span[data-automation-id="completed-processes_filter"]'));
|
||||
activeFilter: ElementFinder = element(by.css("mat-list-item[class*='active'] span"));
|
||||
processFilters: ElementFinder = element(by.css("mat-expansion-panel[data-automation-id='Process Filters']"));
|
||||
processFiltersList: ElementFinder = element(by.css('adf-cloud-process-filters'));
|
||||
|
||||
createButton: ElementFinder = element(by.css('button[data-automation-id="create-button"'));
|
||||
newProcessButton: ElementFinder = element(by.css('button[data-automation-id="btn-start-process"]'));
|
||||
|
||||
processListCloud = new ProcessListCloudComponentPage();
|
||||
editProcessFilterCloud = new EditProcessFilterCloudComponentPage();
|
||||
processFilterCloudComponent = new ProcessFiltersCloudComponentPage();
|
||||
|
||||
editProcessFilterCloudComponent(): EditProcessFilterCloudComponentPage {
|
||||
return this.editProcessFilterCloud;
|
||||
@@ -45,31 +39,6 @@ export class ProcessCloudDemoPage {
|
||||
return this.processListCloud.getAllRowsByColumn('Id');
|
||||
}
|
||||
|
||||
allProcessesFilter(): ProcessFiltersCloudComponentPage {
|
||||
return new ProcessFiltersCloudComponentPage(this.allProcesses);
|
||||
}
|
||||
|
||||
runningProcessesFilter(): ProcessFiltersCloudComponentPage {
|
||||
return new ProcessFiltersCloudComponentPage(this.runningProcesses);
|
||||
}
|
||||
|
||||
completedProcessesFilter(): ProcessFiltersCloudComponentPage {
|
||||
return new ProcessFiltersCloudComponentPage(this.completedProcesses);
|
||||
}
|
||||
|
||||
customProcessFilter(filterName): ProcessFiltersCloudComponentPage {
|
||||
return new ProcessFiltersCloudComponentPage(element(by.css(`span[data-automation-id="${filterName}_filter"]`)));
|
||||
}
|
||||
|
||||
async getActiveFilterName(): Promise<string> {
|
||||
await BrowserVisibility.waitUntilElementIsVisible(this.activeFilter);
|
||||
return BrowserActions.getText(this.activeFilter);
|
||||
}
|
||||
|
||||
async clickOnProcessFilters(): Promise<void> {
|
||||
await BrowserActions.click(this.processFilters);
|
||||
}
|
||||
|
||||
async openNewProcessForm(): Promise<void> {
|
||||
await this.clickOnCreateButton();
|
||||
await this.newProcessButtonIsDisplayed();
|
||||
@@ -80,10 +49,6 @@ export class ProcessCloudDemoPage {
|
||||
await BrowserVisibility.waitUntilElementIsClickable(this.newProcessButton);
|
||||
}
|
||||
|
||||
async isProcessFiltersListVisible(): Promise<void> {
|
||||
await BrowserVisibility.waitUntilElementIsVisible(this.processFiltersList);
|
||||
}
|
||||
|
||||
async clickOnCreateButton(): Promise<void> {
|
||||
await BrowserActions.click(this.createButton);
|
||||
}
|
||||
|
@@ -15,7 +15,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { BrowserActions, BrowserVisibility, DataTableComponentPage } from '@alfresco/adf-testing';
|
||||
import { BrowserActions, BrowserVisibility, DataTableComponentPage, DropdownPage } from '@alfresco/adf-testing';
|
||||
import { by, element, ElementFinder, protractor } from 'protractor';
|
||||
|
||||
export class ProcessListDemoPage {
|
||||
@@ -25,8 +25,9 @@ export class ProcessListDemoPage {
|
||||
emptyProcessContent: ElementFinder = element(by.css('div[class="adf-empty-content"]'));
|
||||
processDefinitionInput: ElementFinder = element(by.css('input[data-automation-id="process-definition-id"]'));
|
||||
processInstanceInput: ElementFinder = element(by.css('input[data-automation-id="process-instance-id"]'));
|
||||
stateSelector: ElementFinder = element(by.css('mat-select[data-automation-id="state"'));
|
||||
sortSelector: ElementFinder = element(by.css('mat-select[data-automation-id="sort"'));
|
||||
|
||||
stateDropdown = new DropdownPage(element(by.css('mat-select[data-automation-id="state"')));
|
||||
sortDropdown = new DropdownPage(element(by.css('mat-select[data-automation-id="sort"')));
|
||||
|
||||
dataTable: DataTableComponentPage = new DataTableComponentPage();
|
||||
|
||||
@@ -34,16 +35,12 @@ export class ProcessListDemoPage {
|
||||
return this.dataTable.getAllRowsColumnValues('Name');
|
||||
}
|
||||
|
||||
async selectSorting(sort): Promise<void> {
|
||||
await BrowserActions.click(this.sortSelector);
|
||||
const sortLocator: ElementFinder = element(by.cssContainingText('mat-option span', sort));
|
||||
await BrowserActions.click(sortLocator);
|
||||
async selectSorting(sortingOption: string): Promise<void> {
|
||||
await this.sortDropdown.clickDropdownWithOption(sortingOption);
|
||||
}
|
||||
|
||||
async selectStateFilter(state): Promise<void> {
|
||||
await BrowserActions.click(this.stateSelector);
|
||||
const stateLocator: ElementFinder = element(by.cssContainingText('mat-option span', state));
|
||||
await BrowserActions.click(stateLocator);
|
||||
async selectStateFilter(stateOption: string): Promise<void> {
|
||||
await this.stateDropdown.clickDropdownWithOption(stateOption);
|
||||
}
|
||||
|
||||
async addAppId(appId): Promise<void> {
|
||||
@@ -82,12 +79,12 @@ export class ProcessListDemoPage {
|
||||
await BrowserVisibility.waitUntilElementIsVisible(this.processInstanceInput);
|
||||
}
|
||||
|
||||
async checkStateFieldIsDisplayed(): Promise<void> {
|
||||
await BrowserVisibility.waitUntilElementIsVisible(this.stateSelector);
|
||||
async checkStateDropdownIsDisplayed(): Promise<void> {
|
||||
await this.stateDropdown.checkDropdownIsVisible();
|
||||
}
|
||||
|
||||
async checkSortFieldIsDisplayed(): Promise<void> {
|
||||
await BrowserVisibility.waitUntilElementIsVisible(this.sortSelector);
|
||||
async checkSortDropdownIsDisplayed(): Promise<void> {
|
||||
await this.sortDropdown.checkDropdownIsVisible();
|
||||
}
|
||||
|
||||
async addProcessDefinitionId(procDefinitionId): Promise<void> {
|
||||
|
@@ -15,7 +15,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { BrowserActions, BrowserVisibility, PaginationPage } from '@alfresco/adf-testing';
|
||||
import { BrowserActions, BrowserVisibility, DropdownPage, PaginationPage } from '@alfresco/adf-testing';
|
||||
import { by, element, ElementFinder } from 'protractor';
|
||||
import { TasksListPage } from '../../process-services/tasks-list.page';
|
||||
|
||||
@@ -34,8 +34,9 @@ export class TaskListDemoPage {
|
||||
dueBefore: ElementFinder = element(by.css("input[data-automation-id='due before']"));
|
||||
dueAfter: ElementFinder = element(by.css("input[data-automation-id='due after']"));
|
||||
taskId: ElementFinder = element(by.css("input[data-automation-id='task id']"));
|
||||
stateDropDownArrow: ElementFinder = element(by.css("mat-form-field[data-automation-id='state'] div[class*='arrow']"));
|
||||
stateSelector: ElementFinder = element(by.css("div[class*='mat-select-panel']"));
|
||||
|
||||
stateDropDownArrow: ElementFinder = element(by.css("mat-form-field[data-automation-id='state']"));
|
||||
stateDropdown = new DropdownPage(this.stateDropDownArrow);
|
||||
|
||||
taskList(): TasksListPage {
|
||||
return this.taskListPage;
|
||||
@@ -138,15 +139,7 @@ export class TaskListDemoPage {
|
||||
}
|
||||
|
||||
async selectState(state): Promise<void> {
|
||||
await this.clickOnStateDropDownArrow();
|
||||
|
||||
const stateElement: ElementFinder = element.all(by.cssContainingText('mat-option span', state)).first();
|
||||
await BrowserActions.click(stateElement);
|
||||
}
|
||||
|
||||
async clickOnStateDropDownArrow(): Promise<void> {
|
||||
await BrowserActions.click(this.stateDropDownArrow);
|
||||
await BrowserVisibility.waitUntilElementIsVisible(this.stateSelector);
|
||||
await this.stateDropdown.clickDropdownWithOption(state);
|
||||
}
|
||||
|
||||
getAllProcessDefinitionIds(): Promise<any> {
|
||||
|
@@ -22,23 +22,15 @@ import {
|
||||
EditTaskFilterCloudComponentPage,
|
||||
BrowserVisibility,
|
||||
TaskListCloudComponentPage,
|
||||
BrowserActions
|
||||
BrowserActions, DropdownPage
|
||||
} from '@alfresco/adf-testing';
|
||||
|
||||
export class TasksCloudDemoPage {
|
||||
|
||||
myTasks: ElementFinder = element(by.css('span[data-automation-id="my-tasks-filter"]'));
|
||||
completedTasks: ElementFinder = element(by.css('span[data-automation-id="completed-tasks-filter"]'));
|
||||
activeFilter: ElementFinder = element(by.css("mat-list-item[class*='active'] span"));
|
||||
|
||||
defaultActiveFilter: ElementFinder = element.all(by.css('.adf-filters__entry')).first();
|
||||
|
||||
createButton: ElementFinder = element(by.css('button[data-automation-id="create-button"'));
|
||||
newTaskButton: ElementFinder = element(by.css('button[data-automation-id="btn-start-task"]'));
|
||||
settingsButton: ElementFinder = element.all(by.cssContainingText('div[class*="mat-tab-label"] .mat-tab-labels div', 'Settings')).first();
|
||||
appButton: ElementFinder = element.all(by.cssContainingText('div[class*="mat-tab-label"] .mat-tab-labels div', 'App')).first();
|
||||
modeDropDownArrow: ElementFinder = element(by.css('mat-form-field[data-automation-id="selectionMode"] div[class*="arrow-wrapper"]'));
|
||||
modeSelector: ElementFinder = element(by.css("div[class*='mat-select-panel']"));
|
||||
displayTaskDetailsToggle: ElementFinder = element(by.css('mat-slide-toggle[data-automation-id="taskDetailsRedirection"]'));
|
||||
displayProcessDetailsToggle: ElementFinder = element(by.css('mat-slide-toggle[data-automation-id="processDetailsRedirection"]'));
|
||||
actionMenuToggle: ElementFinder = element(by.css('mat-slide-toggle[data-automation-id="actionmenu"]'));
|
||||
@@ -54,12 +46,15 @@ export class TasksCloudDemoPage {
|
||||
addActionButton: ElementFinder = element(by.cssContainingText('button span', 'Add'));
|
||||
disableCheckbox: ElementFinder = element(by.css(`mat-checkbox[formcontrolname='disabled']`));
|
||||
visibleCheckbox: ElementFinder = element(by.css(`mat-checkbox[formcontrolname='visible']`));
|
||||
filter: ElementFinder = element(by.css(`mat-expansion-panel[data-automation-id='Task Filters']`));
|
||||
|
||||
modeDropdown = new DropdownPage(element(by.css('mat-form-field[data-automation-id="selectionMode"]')));
|
||||
|
||||
formControllersPage: FormControllersPage = new FormControllersPage();
|
||||
|
||||
editTaskFilterCloud: EditTaskFilterCloudComponentPage = new EditTaskFilterCloudComponentPage();
|
||||
|
||||
taskFilterCloudComponent = new TaskFiltersCloudComponentPage();
|
||||
|
||||
async disableDisplayTaskDetails(): Promise<void> {
|
||||
await this.formControllersPage.disableToggle(this.displayTaskDetailsToggle);
|
||||
}
|
||||
@@ -84,10 +79,6 @@ export class TasksCloudDemoPage {
|
||||
await this.formControllersPage.enableToggle(this.testingModeToggle);
|
||||
}
|
||||
|
||||
async clickOnTaskFilter(): Promise<void> {
|
||||
await BrowserActions.click(this.filter);
|
||||
}
|
||||
|
||||
taskListCloudComponent(): TaskListCloudComponentPage {
|
||||
return new TaskListCloudComponentPage();
|
||||
}
|
||||
@@ -96,38 +87,16 @@ export class TasksCloudDemoPage {
|
||||
return this.editTaskFilterCloud;
|
||||
}
|
||||
|
||||
myTasksFilter(): TaskFiltersCloudComponentPage {
|
||||
return new TaskFiltersCloudComponentPage(this.myTasks);
|
||||
}
|
||||
|
||||
completedTasksFilter(): TaskFiltersCloudComponentPage {
|
||||
return new TaskFiltersCloudComponentPage(this.completedTasks);
|
||||
}
|
||||
|
||||
async getActiveFilterName(): Promise<string> {
|
||||
await browser.sleep(500);
|
||||
return BrowserActions.getText(this.activeFilter);
|
||||
}
|
||||
|
||||
customTaskFilter(filterName): TaskFiltersCloudComponentPage {
|
||||
return new TaskFiltersCloudComponentPage(element(by.css(`span[data-automation-id="${filterName}-filter"]`)));
|
||||
}
|
||||
|
||||
async openNewTaskForm(): Promise<void> {
|
||||
await BrowserActions.click(this.createButton);
|
||||
await BrowserActions.clickExecuteScript('button[data-automation-id="btn-start-task"]');
|
||||
}
|
||||
|
||||
async firstFilterIsActive(): Promise<boolean> {
|
||||
const value = await this.defaultActiveFilter.getAttribute('class');
|
||||
return value.includes('adf-active');
|
||||
}
|
||||
|
||||
async clickSettingsButton(): Promise<void> {
|
||||
await BrowserActions.click(this.settingsButton);
|
||||
await browser.sleep(400);
|
||||
await BrowserVisibility.waitUntilElementIsVisible(this.multiSelectionToggle);
|
||||
await BrowserVisibility.waitUntilElementIsClickable(this.modeDropDownArrow);
|
||||
await this.modeDropdown.checkDropdownIsClickable();
|
||||
}
|
||||
|
||||
async clickAppButton(): Promise<void> {
|
||||
@@ -135,15 +104,8 @@ export class TasksCloudDemoPage {
|
||||
}
|
||||
|
||||
async selectSelectionMode(mode): Promise<void> {
|
||||
await this.clickOnSelectionModeDropDownArrow();
|
||||
|
||||
const modeElement: ElementFinder = element.all(by.cssContainingText('mat-option span', mode)).first();
|
||||
await BrowserActions.click(modeElement);
|
||||
}
|
||||
|
||||
async clickOnSelectionModeDropDownArrow(): Promise<void> {
|
||||
await BrowserActions.click(this.modeDropDownArrow);
|
||||
await BrowserVisibility.waitUntilElementIsVisible(this.modeSelector);
|
||||
await this.modeDropdown.clickDropdown();
|
||||
await this.modeDropdown.selectOption(mode);
|
||||
}
|
||||
|
||||
async checkSelectedRowsIsDisplayed(): Promise<void> {
|
||||
|
Reference in New Issue
Block a user