mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-31 17:38:48 +00:00
[ADF-4015] Implementing edit task filter automated tests (#4337)
* Added a few test cases to cover task list and edit task filters cloud components properties. * Add tests for task name property. * Add processInstanceId tests * Added lastModifiedTo and lastModifiedFrom tests. * Added tests for all the properties * Add selectionMode tests. * Add selectionMode tests * Update task-list-selection.e2e.ts * [ADF-4015] Fix lint issues * Using clearField * Modified selection tests * Fixing selection tests * no message * Fix spelling * Removed a sleep from the test * Fix siteListDropDown locator
This commit is contained in:
committed by
Eugenio Romano
parent
e08bb1ebed
commit
3adc569b0a
@@ -76,4 +76,18 @@ export class ConfigEditorPage {
|
||||
Util.waitUntilElementIsClickable(button);
|
||||
return button.click();
|
||||
}
|
||||
|
||||
clickEditTaskConfiguration() {
|
||||
let button = element(by.id('adf-edit-task-filter-conf'));
|
||||
Util.waitUntilElementIsVisible(button);
|
||||
Util.waitUntilElementIsClickable(button);
|
||||
return button.click();
|
||||
}
|
||||
|
||||
clickTaskListCloudConfiguration() {
|
||||
let button = element(by.id('adf-task-list-cloud-conf'));
|
||||
Util.waitUntilElementIsVisible(button);
|
||||
Util.waitUntilElementIsClickable(button);
|
||||
return button.click();
|
||||
}
|
||||
}
|
||||
|
@@ -66,7 +66,7 @@ export class ContentServicesPage {
|
||||
copyButton = element(by.css('button[data-automation-id="content-node-selector-actions-choose"]'));
|
||||
searchInputElement = element(by.css('input[data-automation-id="content-node-selector-search-input"]'));
|
||||
shareNodeButton = element(by.cssContainingText('mat-icon', ' share '));
|
||||
siteListDropdown = element(by.css(`mat-select[data-automation-id='site-my-files-select']`));
|
||||
siteListDropdown = element(by.css(`mat-select[data-automation-id='site-my-files-option']`));
|
||||
|
||||
getUploadAreaDocumentList() {
|
||||
return new ContentListPage(element(by.css('adf-upload-drag-area')));
|
||||
|
@@ -29,7 +29,7 @@ export class DataTablePage {
|
||||
selectionDropDown = element(by.css(`div[class*='ng-trigger-transformPanel']`));
|
||||
allSelectedRows = element.all(by.css(`div[class*='is-selected']`));
|
||||
selectedRowNumber = element(by.css(`div[class*='is-selected'] div[data-automation-id*='text_']`));
|
||||
selectAll = element(by.css(`div[class*='header'] label`));
|
||||
selectAll = element(by.css(`div[class*='header'] mat-checkbox`));
|
||||
addRowElement = element(by.xpath(`//span[contains(text(),'Add row')]/..`));
|
||||
replaceRowsElement = element(by.xpath(`//span[contains(text(),'Replace rows')]/..`));
|
||||
reset = element(by.xpath(`//span[contains(text(),'Reset to default')]/..`));
|
||||
@@ -89,6 +89,24 @@ export class DataTablePage {
|
||||
checkbox.click();
|
||||
}
|
||||
|
||||
clickCheckboxByName(rowName) {
|
||||
let checkbox = this.getRowsName(rowName).element(by.xpath(`ancestor::div[contains(@class, 'adf-datatable-row')]//mat-checkbox/label`));
|
||||
Util.waitUntilElementIsVisible(checkbox);
|
||||
checkbox.click();
|
||||
}
|
||||
|
||||
getRowCheckboxByName(rowName) {
|
||||
return this.getRowsName(rowName).element(by.xpath(`ancestor::div/div/mat-checkbox[contains(@class, 'mat-checkbox-checked')]`));
|
||||
}
|
||||
|
||||
checkRowIsNotCheckedByName(rowName) {
|
||||
Util.waitUntilElementIsNotOnPage(this.getRowCheckboxByName(rowName));
|
||||
}
|
||||
|
||||
checkRowIsCheckedByName(rowName) {
|
||||
Util.waitUntilElementIsVisible(this.getRowCheckboxByName(rowName));
|
||||
}
|
||||
|
||||
selectRow(rowNumber) {
|
||||
return this.getRowByRowNumber(rowNumber).click();
|
||||
}
|
||||
@@ -105,6 +123,30 @@ export class DataTablePage {
|
||||
selectMode.click();
|
||||
}
|
||||
|
||||
selectRowByRowName(rowName) {
|
||||
let row = element(by.cssContainingText(`[data-automation-id*="${rowName}"]`, rowName));
|
||||
Util.waitUntilElementIsVisible(row);
|
||||
Util.waitUntilElementIsClickable(row);
|
||||
return row.click();
|
||||
}
|
||||
|
||||
checkRowIsSelectedByName(rowName) {
|
||||
let row = element(by.cssContainingText(`[data-automation-id*="${rowName}"]`, rowName));
|
||||
let isRowSelected = row.element(by.xpath(`ancestor::div[contains(@class, 'is-selected')]`));
|
||||
Util.waitUntilElementIsVisible(isRowSelected);
|
||||
}
|
||||
|
||||
checkRowIsNotSelectedByName(rowName) {
|
||||
let row = element(by.cssContainingText(`[data-automation-id*="${rowName}"]`, rowName));
|
||||
let isRowSelected = row.element(by.xpath(`ancestor::div[contains(@class, 'is-selected')]`));
|
||||
Util.waitUntilElementIsNotOnPage(isRowSelected);
|
||||
}
|
||||
|
||||
selectRowByNameWithKeyboard(rowName) {
|
||||
let row = element(by.cssContainingText(`[data-automation-id*="${rowName}"]`, rowName));
|
||||
browser.actions().sendKeys(protractor.Key.COMMAND).click(row).perform();
|
||||
}
|
||||
|
||||
checkRowIsSelected(rowNumber) {
|
||||
let isRowSelected = this.getRowByRowNumber(rowNumber).element(by.xpath(`ancestor::div[contains(@class, 'is-selected')]`));
|
||||
Util.waitUntilElementIsVisible(isRowSelected);
|
||||
@@ -120,8 +162,15 @@ export class DataTablePage {
|
||||
Util.waitUntilElementIsNotOnPage(this.selectedRowNumber);
|
||||
}
|
||||
|
||||
checkAllRowsButtonIsDisplayed() {
|
||||
Util.waitUntilElementIsVisible(this.selectAll);
|
||||
Util.waitUntilElementIsVisible(this.selectAll);
|
||||
return this;
|
||||
}
|
||||
|
||||
checkAllRows() {
|
||||
Util.waitUntilElementIsVisible(this.selectAll);
|
||||
Util.waitUntilElementIsClickable(this.selectAll);
|
||||
this.selectAll.click();
|
||||
}
|
||||
|
||||
@@ -265,6 +314,12 @@ export class DataTablePage {
|
||||
return element.all(by.css(`div[title='Name'][filename="${filename}"]`)).count();
|
||||
}
|
||||
|
||||
getNumberOfRowsDisplayedByName(filename) {
|
||||
let rowLocator = by.cssContainingText(`[data-automation-id*="${filename}"]`, filename);
|
||||
Util.waitUntilElementIsVisible(element(rowLocator));
|
||||
return element.all(by.css(`div[title='Name'] div[data-automation-id*="${filename}"]`)).count();
|
||||
}
|
||||
|
||||
checkColumnIsDisplayed(column) {
|
||||
Util.waitUntilElementIsVisible(element(by.css(`div[data-automation-id="auto_id_entry.${column}"]`)));
|
||||
return this;
|
||||
|
@@ -20,6 +20,8 @@ import { Util } from '../../../../util/util';
|
||||
import { TaskFiltersCloudComponent } from '../../process-cloud/taskFiltersCloudComponent';
|
||||
import { TaskListCloudComponent } from '../../process-cloud/taskListCloudComponent';
|
||||
import { EditTaskFilterCloudComponent } from '../../process-cloud/editTaskFilterCloudComponent';
|
||||
import { FormControllersPage } from '../../material/formControllersPage';
|
||||
|
||||
import { element, by } from 'protractor';
|
||||
|
||||
export class TasksCloudDemoPage {
|
||||
@@ -30,10 +32,29 @@ export class TasksCloudDemoPage {
|
||||
|
||||
taskFilters = element(by.css("mat-expansion-panel[data-automation-id='Task Filters']"));
|
||||
defaultActiveFilter = element.all(by.css('.adf-filters__entry')).first();
|
||||
editTaskFilterCloud = new EditTaskFilterCloudComponent();
|
||||
|
||||
createButton = element(by.css('button[data-automation-id="create-button"'));
|
||||
newTaskButton = element(by.css('button[data-automation-id="btn-start-task"]'));
|
||||
settingsButton = element.all(by.cssContainingText('div[class*="mat-tab-label"] .mat-tab-labels div', 'Settings')).first();
|
||||
appButton = element.all(by.cssContainingText('div[class*="mat-tab-label"] .mat-tab-labels div', 'App')).first();
|
||||
modeDropDownArrow = element(by.css('mat-form-field[data-automation-id="selectionMode"] div[class*="arrow-wrapper"]'));
|
||||
modeSelector = element(by.css("div[class*='mat-select-panel']"));
|
||||
displayTaskDetailsToggle = element(by.css('mat-slide-toggle[data-automation-id="taskDetailsRedirection"]'));
|
||||
multiSelectionToggle = element(by.css('mat-slide-toggle[data-automation-id="multiSelection"]'));
|
||||
|
||||
formControllersPage = new FormControllersPage();
|
||||
|
||||
editTaskFilterCloud = new EditTaskFilterCloudComponent();
|
||||
|
||||
disableDisplayTaskDetails() {
|
||||
this.formControllersPage.disableToggle(this.displayTaskDetailsToggle);
|
||||
return this;
|
||||
}
|
||||
|
||||
enableMultiSelection() {
|
||||
this.formControllersPage.enableToggle(this.multiSelectionToggle);
|
||||
return this;
|
||||
}
|
||||
|
||||
taskFiltersCloudComponent(filter) {
|
||||
return new TaskFiltersCloudComponent(filter);
|
||||
@@ -68,6 +89,10 @@ export class TasksCloudDemoPage {
|
||||
return new TaskListCloudComponent().getAllRowsByColumn('Id');
|
||||
}
|
||||
|
||||
getAllRowsByProcessDefIdColumn() {
|
||||
return new TaskListCloudComponent().getAllRowsByColumn('Process Definition Id');
|
||||
}
|
||||
|
||||
clickOnTaskFilters() {
|
||||
Util.waitUntilElementIsVisible(this.taskFilters);
|
||||
return this.taskFilters.click();
|
||||
@@ -101,4 +126,35 @@ export class TasksCloudDemoPage {
|
||||
return this.defaultActiveFilter.getAttribute('class').then((value) => value.includes('adf-active'));
|
||||
}
|
||||
|
||||
clickSettingsButton() {
|
||||
this.settingsButton.click();
|
||||
browser.driver.sleep(400);
|
||||
Util.waitUntilElementIsVisible(this.multiSelectionToggle);
|
||||
Util.waitUntilElementIsVisible(this.modeDropDownArrow);
|
||||
Util.waitUntilElementIsClickable(this.modeDropDownArrow);
|
||||
return this;
|
||||
}
|
||||
|
||||
clickAppButton() {
|
||||
this.appButton.click();
|
||||
this.createButtonIsDisplayed();
|
||||
return this;
|
||||
}
|
||||
|
||||
selectSelectionMode(mode) {
|
||||
this.clickOnSelectionModeDropDownArrow();
|
||||
|
||||
let modeElement = element.all(by.cssContainingText('mat-option span', mode)).first();
|
||||
Util.waitUntilElementIsClickable(modeElement);
|
||||
Util.waitUntilElementIsVisible(modeElement);
|
||||
modeElement.click();
|
||||
return this;
|
||||
}
|
||||
|
||||
clickOnSelectionModeDropDownArrow() {
|
||||
Util.waitUntilElementIsVisible(this.modeDropDownArrow);
|
||||
Util.waitUntilElementIsClickable(this.modeDropDownArrow);
|
||||
this.modeDropDownArrow.click();
|
||||
Util.waitUntilElementIsVisible(this.modeSelector);
|
||||
}
|
||||
}
|
||||
|
@@ -24,6 +24,14 @@ export class EditTaskFilterCloudComponent {
|
||||
customiseFilter = element(by.id('adf-edit-task-filter-title-id'));
|
||||
selectedOption = element(by.css('mat-option[class*="mat-selected"]'));
|
||||
assignment = element(by.css('input[data-automation-id="adf-cloud-edit-task-property-assignment"]'));
|
||||
priority = element(by.css('input[data-automation-id="adf-cloud-edit-task-property-priority"]'));
|
||||
taskName = element(by.css('input[data-automation-id="adf-cloud-edit-task-property-taskName"]'));
|
||||
processDefinitionId = element(by.css('input[data-automation-id="adf-cloud-edit-task-property-processDefinitionId"]'));
|
||||
processInstanceId = element(by.css('input[data-automation-id="adf-cloud-edit-task-property-processInstanceId"]'));
|
||||
lastModifiedFrom = element(by.css('input[data-automation-id="adf-cloud-edit-task-property-lastModifiedFrom"]'));
|
||||
lastModifiedTo = element(by.css('input[data-automation-id="adf-cloud-edit-task-property-lastModifiedTo"]'));
|
||||
parentTaskId = element(by.css('input[data-automation-id="adf-cloud-edit-task-property-parentTaskId"]'));
|
||||
owner = element(by.css('input[data-automation-id="adf-cloud-edit-task-property-owner"]'));
|
||||
saveButton = element(by.css('button[id="adf-save-id"]'));
|
||||
saveAsButton = element(by.css('button[id="adf-save-as-id"]'));
|
||||
deleteButton = element(by.css('button[id="adf-delete-id"]'));
|
||||
@@ -92,17 +100,55 @@ export class EditTaskFilterCloudComponent {
|
||||
}
|
||||
|
||||
setAssignment(option) {
|
||||
Util.waitUntilElementIsVisible(this.assignment);
|
||||
this.assignment.clear();
|
||||
this.assignment.sendKeys(option);
|
||||
this.assignment.sendKeys(protractor.Key.ENTER);
|
||||
return this;
|
||||
return this.setProperty('assignment', option);
|
||||
}
|
||||
|
||||
getAssignment() {
|
||||
return this.assignment.getText();
|
||||
}
|
||||
|
||||
setPriority(option) {
|
||||
return this.setProperty('priority', option);
|
||||
}
|
||||
|
||||
getPriority() {
|
||||
return this.priority.getText();
|
||||
}
|
||||
|
||||
setParentTaskId(option) {
|
||||
return this.setProperty('parentTaskId', option);
|
||||
}
|
||||
|
||||
getParentTaskId() {
|
||||
return this.parentTaskId.getText();
|
||||
}
|
||||
|
||||
setOwner(option) {
|
||||
return this.setProperty('owner', option);
|
||||
}
|
||||
|
||||
getOwner() {
|
||||
return this.owner.getText();
|
||||
}
|
||||
|
||||
setLastModifiedFrom(option) {
|
||||
this.clearField(this.lastModifiedFrom);
|
||||
return this.setProperty('lastModifiedFrom', option);
|
||||
}
|
||||
|
||||
getLastModifiedFrom() {
|
||||
return this.lastModifiedFrom.getText();
|
||||
}
|
||||
|
||||
setLastModifiedTo(option) {
|
||||
this.clearField(this.lastModifiedTo);
|
||||
return this.setProperty('lastModifiedTo', option);
|
||||
}
|
||||
|
||||
getLastModifiedTo() {
|
||||
return this.lastModifiedTo.getText();
|
||||
}
|
||||
|
||||
checkSaveButtonIsDisplayed() {
|
||||
Util.waitUntilElementIsVisible(this.saveButton);
|
||||
return this;
|
||||
@@ -166,4 +212,53 @@ export class EditTaskFilterCloudComponent {
|
||||
});
|
||||
}
|
||||
|
||||
setAppNameDropDown(option) {
|
||||
this.clickOnDropDownArrow('appName');
|
||||
|
||||
let appNameElement = element.all(by.cssContainingText('mat-option span', option)).first();
|
||||
Util.waitUntilElementIsClickable(appNameElement);
|
||||
Util.waitUntilElementIsVisible(appNameElement);
|
||||
appNameElement.click();
|
||||
return this;
|
||||
}
|
||||
|
||||
getAppNameDropDownValue() {
|
||||
let locator = element(by.css("mat-select[data-automation-id='adf-cloud-edit-task-property-appName'] span"));
|
||||
Util.waitUntilElementIsVisible(locator);
|
||||
return locator.getText();
|
||||
}
|
||||
|
||||
setTaskName(option) {
|
||||
return this.setProperty('taskName', option);
|
||||
}
|
||||
|
||||
getTaskName() {
|
||||
return this.taskName.getAttribute('value');
|
||||
}
|
||||
|
||||
setProcessDefinitionId(option) {
|
||||
return this.setProperty('processDefinitionId', option);
|
||||
}
|
||||
|
||||
getProcessDefinitionId() {
|
||||
return this.processDefinitionId.getAttribute('value');
|
||||
}
|
||||
|
||||
setProcessInstanceId(option) {
|
||||
return this.setProperty('processInstanceId', option);
|
||||
}
|
||||
|
||||
setProperty(property, option) {
|
||||
let locator = element(by.css('input[data-automation-id="adf-cloud-edit-task-property-' + property + '"]'));
|
||||
Util.waitUntilElementIsVisible(locator);
|
||||
locator.clear();
|
||||
locator.sendKeys(option);
|
||||
locator.sendKeys(protractor.Key.ENTER);
|
||||
return this;
|
||||
}
|
||||
|
||||
getProcessInstanceId() {
|
||||
return this.processInstanceId.getAttribute('value');
|
||||
}
|
||||
|
||||
}
|
||||
|
Reference in New Issue
Block a user