[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:
arditdomi
2020-02-27 13:51:36 +00:00
committed by GitHub
parent d2ec8ccee7
commit 14529da097
58 changed files with 601 additions and 650 deletions

View File

@@ -16,12 +16,11 @@
*/
import { by, element, ElementFinder } from 'protractor';
import { BrowserVisibility, BrowserActions, CardTextItemPage } from '@alfresco/adf-testing';
import { BrowserVisibility, BrowserActions, CardTextItemPage, DropdownPage } from '@alfresco/adf-testing';
export class CardViewComponentPage {
addButton: ElementFinder = element(by.className('adf-card-view__key-value-pairs__add-btn'));
selectValue = 'mat-option';
nameCardTextItem: CardTextItemPage = new CardTextItemPage('name');
intField: ElementFinder = element(by.css(`input[data-automation-id='card-textitem-editinput-int']`));
floatField: ElementFinder = element(by.css(`input[data-automation-id='card-textitem-editinput-float']`));
@@ -29,15 +28,15 @@ export class CardViewComponentPage {
nameInputField: ElementFinder = element(by.xpath(`//*[contains(@id,'input') and @placeholder='Name']`));
consoleLog: ElementFinder = element(by.className('app-console'));
deleteButton: ElementFinder = element.all(by.className('adf-card-view__key-value-pairs__remove-btn')).first();
select: ElementFinder = element(by.css('mat-select[data-automation-class="select-box"]'));
checkbox: ElementFinder = element(by.css(`mat-checkbox[data-automation-id='card-boolean-boolean']`));
resetButton: ElementFinder = element(by.css(`#adf-reset-card-log`));
listContent: ElementFinder = element(by.css('.mat-select-panel'));
editableSwitch: ElementFinder = element(by.id('app-toggle-editable'));
clearDateSwitch: ElementFinder = element(by.id('app-toggle-clear-date'));
noneOptionSwitch: ElementFinder = element(by.id('app-toggle-none-option'));
clickableField: ElementFinder = element(by.css(`[data-automation-id="card-textitem-toggle-click"]`));
selectDropdown = new DropdownPage(element(by.css('mat-select[data-automation-class="select-box"]')));
async clickOnAddButton(): Promise<void> {
await BrowserActions.click(this.addButton);
}
@@ -151,8 +150,8 @@ export class CardViewComponentPage {
}
async clickSelectBox(): Promise<void> {
await BrowserActions.click(this.select);
await BrowserVisibility.waitUntilElementIsVisible(this.listContent);
await this.selectDropdown.clickDropdown();
await this.selectDropdown.checkOptionsPanelIsDisplayed();
}
async checkboxClick(): Promise<void> {
@@ -160,8 +159,7 @@ export class CardViewComponentPage {
}
async selectValueFromComboBox(index): Promise<void> {
const value: ElementFinder = element.all(by.className(this.selectValue)).get(index);
await BrowserActions.click(value);
await this.selectDropdown.selectOptionFromIndex(index);
}
async disableEdit(): Promise<void> {

View File

@@ -81,13 +81,15 @@ export class ContentServicesPage {
copyContentElement: ElementFinder = element(by.css('button[data-automation-id*="COPY"]'));
lockContentElement: ElementFinder = element(by.css('button[data-automation-id="DOCUMENT_LIST.ACTIONS.LOCK"]'));
downloadContent: ElementFinder = element(by.css('button[data-automation-id*="DOWNLOAD"]'));
siteListDropdown: ElementFinder = element(by.css(`mat-select[data-automation-id='site-my-files-option']`));
downloadButton: ElementFinder = element(by.css('button[title="Download"]'));
favoriteButton: ElementFinder = element(by.css('button[data-automation-id="favorite"]'));
markedFavorite: ElementFinder = element(by.cssContainingText('button[data-automation-id="favorite"] mat-icon', 'star'));
notMarkedFavorite: ElementFinder = element(by.cssContainingText('button[data-automation-id="favorite"] mat-icon', 'star_border'));
multiSelectToggle: ElementFinder = element(by.cssContainingText('span.mat-slide-toggle-content', ' Multiselect (with checkboxes) '));
siteListDropdown = new DropdownPage(element(by.css(`mat-select[data-automation-id='site-my-files-option']`)));
sortingDropdown = new DropdownPage(element(by.css('mat-select[data-automation-id="grid-view-sorting"]')));
async pressContextMenuActionNamed(actionName): Promise<void> {
await BrowserActions.clickExecuteScript(`button[data-automation-id="context-${actionName}"]`);
}
@@ -577,11 +579,8 @@ export class ContentServicesPage {
await browser.actions().sendKeys(protractor.Key.ENTER).perform();
}
async selectGridSortingFromDropdown(sortingChosen): Promise<void> {
const sortingDropdown: ElementFinder = element(by.css('mat-select[data-automation-id="grid-view-sorting"]'));
await BrowserActions.click(sortingDropdown);
const optionToClick: ElementFinder = element(by.css(`mat-option[data-automation-id="grid-view-sorting-${sortingChosen}"]`));
await BrowserActions.click(optionToClick);
async selectGridSortingFromDropdown(sortingOption): Promise<void> {
await this.sortingDropdown.clickDropdownWithOption(sortingOption);
}
async checkRowIsDisplayed(rowName): Promise<void> {
@@ -595,13 +594,11 @@ export class ContentServicesPage {
}
async checkSelectedSiteIsDisplayed(siteName): Promise<void> {
await BrowserVisibility.waitUntilElementIsVisible(this.siteListDropdown.element(by.cssContainingText('.mat-select-value-text span', siteName)));
await this.siteListDropdown.checkOptionIsSelected(siteName);
}
async selectSite(siteName: string): Promise<void> {
const dropdownPage = new DropdownPage(this.siteListDropdown);
await dropdownPage.clickDropdown();
await dropdownPage.selectOption(siteName);
await this.siteListDropdown.clickDropdownWithOption(siteName);
}
async clickDownloadButton(): Promise<void> {

View File

@@ -16,19 +16,18 @@
*/
import { element, by, ElementFinder } from 'protractor';
import { BrowserVisibility, BrowserActions } from '@alfresco/adf-testing';
import { BrowserActions, DropdownPage } from '@alfresco/adf-testing';
export class BreadCrumbDropdownPage {
breadCrumb: ElementFinder = element(by.css(`adf-dropdown-breadcrumb[data-automation-id='content-node-selector-content-breadcrumb']`));
parentFolder = this.breadCrumb.element(by.css(`button[data-automation-id='dropdown-breadcrumb-trigger']`));
breadCrumbDropdown: ElementFinder = element.all(by.css(`div[class*='mat-select-panel']`)).first();
currentFolder = this.breadCrumb.element(by.css(`div span[data-automation-id="current-folder"]`));
breadCrumbDropdown = new DropdownPage(element.all(by.css(`div[class*='mat-select-panel']`)).first());
async choosePath(pathName): Promise<void> {
const path = this.breadCrumbDropdown.element(by.cssContainingText(`mat-option[data-automation-class='dropdown-breadcrumb-path-option'] span[class='mat-option-text']`,
pathName));
await BrowserActions.click(path);
await this.breadCrumbDropdown.selectOption(pathName);
}
async clickParentFolder(): Promise<void> {
@@ -36,7 +35,7 @@ export class BreadCrumbDropdownPage {
}
async checkBreadCrumbDropdownIsDisplayed(): Promise<void> {
await BrowserVisibility.waitUntilElementIsVisible(this.breadCrumbDropdown);
await this.breadCrumbDropdown.checkDropdownIsVisible();
}
async getTextOfCurrentFolder(): Promise<string> {

View File

@@ -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 {

View File

@@ -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);
}

View File

@@ -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> {

View File

@@ -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> {

View File

@@ -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> {

View File

@@ -16,22 +16,22 @@
*/
import { element, by, browser, ElementFinder } from 'protractor';
import { BrowserVisibility, BrowserActions } from '@alfresco/adf-testing';
import { BrowserVisibility, BrowserActions, DropdownPage } from '@alfresco/adf-testing';
export class NotificationPage {
messageField: ElementFinder = element(by.css('input[data-automation-id="notification-message"]'));
horizontalPosition: ElementFinder = element(by.css('mat-select[data-automation-id="notification-horizontal-position"]'));
verticalPosition: ElementFinder = element(by.css('mat-select[data-automation-id="notification-vertical-position"]'));
durationField: ElementFinder = element(by.css('input[data-automation-id="notification-duration"]'));
direction: ElementFinder = element(by.css('mat-select[data-automation-id="notification-direction"]'));
actionToggle: ElementFinder = element(by.css('mat-slide-toggle[data-automation-id="notification-action-toggle"]'));
notificationSnackBar: ElementFinder = element.all(by.css('simple-snack-bar')).first();
actionOutput: ElementFinder = element(by.css('div[data-automation-id="notification-action-output"]'));
selectionDropDown: ElementFinder = element.all(by.css('.mat-select-panel')).first();
notificationsPage: ElementFinder = element(by.css('.app-sidenav-link[data-automation-id="Notifications"]'));
notificationConfig: ElementFinder = element(by.css('p[data-automation-id="notification-custom-object"]'));
horizontalPositionDropdown = new DropdownPage(element(by.css('mat-select[data-automation-id="notification-horizontal-position"]')));
verticalPositionDropdown = new DropdownPage(element(by.css('mat-select[data-automation-id="notification-vertical-position"]')));
directionDropdown = new DropdownPage(element(by.css('mat-select[data-automation-id="notification-direction"]')));
async checkNotifyContains(message): Promise<void> {
await BrowserVisibility.waitUntilElementIsVisible(element.all(by.cssContainingText('simple-snack-bar', message)).first());
}
@@ -65,25 +65,16 @@ export class NotificationPage {
await BrowserActions.clearSendKeys(this.durationField, time);
}
async selectHorizontalPosition(selectedItem): Promise<void> {
const selectItem: ElementFinder = element(by.cssContainingText('span[class="mat-option-text"]', selectedItem));
await BrowserActions.click(this.horizontalPosition);
await BrowserVisibility.waitUntilElementIsVisible(this.selectionDropDown);
await BrowserActions.click(selectItem);
async selectHorizontalPosition(selectItem): Promise<void> {
await this.horizontalPositionDropdown.clickDropdownWithOption(selectItem);
}
async selectVerticalPosition(selectedItem): Promise<void> {
const selectItem: ElementFinder = element(by.cssContainingText('span[class="mat-option-text"]', selectedItem));
await BrowserActions.click(this.verticalPosition);
await BrowserVisibility.waitUntilElementIsVisible(this.selectionDropDown);
await BrowserActions.click(selectItem);
async selectVerticalPosition(selectItem): Promise<void> {
await this.verticalPositionDropdown.clickDropdownWithOption(selectItem);
}
async selectDirection(selectedItem): Promise<void> {
const selectItem: ElementFinder = element(by.cssContainingText('span[class="mat-option-text"]', selectedItem));
await BrowserActions.click(this.direction);
await BrowserVisibility.waitUntilElementIsVisible(this.selectionDropDown);
await BrowserActions.click(selectItem);
async selectDirection(selectItem): Promise<void> {
await this.directionDropdown.clickDropdownWithOption(selectItem);
}
async clickNotificationButton(): Promise<void> {

View File

@@ -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 } from 'protractor';
const column = {
@@ -120,8 +120,7 @@ export class PermissionsPage {
}
async selectOption(name): Promise<void> {
const selectProcessDropdown = element(by.cssContainingText('.mat-option-text', name));
await BrowserActions.click(selectProcessDropdown);
await new DropdownPage().selectOption(name);
}
async checkPermissionContainerIsDisplayed(): Promise<void> {

View File

@@ -16,7 +16,7 @@
*/
import { element, by, ElementFinder } from 'protractor';
import { BrowserVisibility, BrowserActions } from '@alfresco/adf-testing';
import { BrowserVisibility, BrowserActions, DropdownPage } from '@alfresco/adf-testing';
export class AttachFormPage {
@@ -26,7 +26,7 @@ export class AttachFormPage {
formDropdown: ElementFinder = element(by.id('form_id'));
cancelButton: ElementFinder = element(by.id('adf-no-form-cancel-button'));
defaultTitle: ElementFinder = element(by.css('mat-card-title[class="mat-card-title mat-card-title"]'));
attachFormDropdown: ElementFinder = element(by.css("div[class='adf-attach-form-row']"));
attachFormDropdown = new DropdownPage(element(by.css("div[class='adf-attach-form-row']")));
async checkNoFormMessageIsDisplayed(): Promise<void> {
await BrowserVisibility.waitUntilElementIsVisible(this.noFormMessage);
@@ -57,12 +57,8 @@ export class AttachFormPage {
await BrowserVisibility.waitUntilElementIsVisible(this.cancelButton);
}
async clickAttachFormDropdown(): Promise<void> {
await BrowserActions.click(this.attachFormDropdown);
}
async selectAttachFormOption(option): Promise<void> {
await BrowserActions.click(element(by.cssContainingText("mat-option[role='option']", option)));
await this.attachFormDropdown.clickDropdownWithOption(option);
}
async clickCancelButton(): Promise<void> {

View File

@@ -16,7 +16,7 @@
*/
import { element, by, Key, ElementFinder } from 'protractor';
import { BrowserVisibility, BrowserActions } from '@alfresco/adf-testing';
import { BrowserVisibility, BrowserActions, DropdownPage } from '@alfresco/adf-testing';
export class StartTaskDialogPage {
@@ -27,7 +27,9 @@ export class StartTaskDialogPage {
startButton: ElementFinder = element(by.css('button[id="button-start"]'));
startButtonEnabled: ElementFinder = element(by.css('button[id="button-start"]:not(disabled)'));
cancelButton: ElementFinder = element(by.css('button[id="button-cancel"]'));
formDropDown: ElementFinder = element(by.css('mat-select[id="form_id"]'));
selectFormDropdown = new DropdownPage(element(by.css('mat-select[id="form_id"]')));
selectAssigneeDropdown = new DropdownPage();
async addName(userName): Promise<void> {
await BrowserVisibility.waitUntilElementIsVisible(this.name);
@@ -52,9 +54,7 @@ export class StartTaskDialogPage {
}
async selectAssigneeFromList(name): Promise<void> {
const assigneeRow: ElementFinder = element(by.cssContainingText('mat-option span.adf-people-label-name', name));
await BrowserActions.click(assigneeRow);
await BrowserVisibility.waitUntilElementIsNotVisible(assigneeRow);
await this.selectAssigneeDropdown.selectOption(name);
}
async getAssignee(): Promise<string> {
@@ -62,14 +62,8 @@ export class StartTaskDialogPage {
return this.assignee.getAttribute('placeholder');
}
async addForm(form): Promise<void> {
await BrowserActions.click(this.formDropDown);
return this.selectForm(form);
}
async selectForm(form): Promise<void> {
const option: ElementFinder = element(by.cssContainingText('span[class*="mat-option-text"]', form));
await BrowserActions.click(option);
await this.selectFormDropdown.clickDropdownWithOption(form);
}
async clickStartButton(): Promise<void> {

View File

@@ -16,7 +16,7 @@
*/
import { by, element, Key, protractor, browser, ElementFinder } from 'protractor';
import { BrowserVisibility, BrowserActions, FormFields } from '@alfresco/adf-testing';
import { BrowserVisibility, BrowserActions, FormFields, DropdownPage } from '@alfresco/adf-testing';
export class StartProcessPage {
@@ -30,6 +30,8 @@ export class StartProcessPage {
processDefinition: ElementFinder = element(by.css('input[id="processDefinitionName"]'));
processDefinitionOptionsPanel: ElementFinder = element(by.css('div[class*="processDefinitionOptions"]'));
dropdownPage = new DropdownPage();
async checkNoProcessMessage(): Promise<void> {
await BrowserVisibility.waitUntilElementIsVisible(this.noProcess);
}
@@ -67,19 +69,15 @@ export class StartProcessPage {
}
async checkOptionIsDisplayed(name): Promise<void> {
const selectProcessDropdown: ElementFinder = element(by.cssContainingText('.mat-option-text', name));
await BrowserVisibility.waitUntilElementIsVisible(selectProcessDropdown);
await BrowserVisibility.waitUntilElementIsClickable(selectProcessDropdown);
await this.dropdownPage.checkOptionIsDisplayed(name);
}
async checkOptionIsNotDisplayed(name): Promise<void> {
const selectProcessDropdown: ElementFinder = element(by.cssContainingText('.mat-option-text', name));
await BrowserVisibility.waitUntilElementIsNotVisible(selectProcessDropdown);
await this.dropdownPage.checkOptionIsNotDisplayed(name);
}
async selectOption(name): Promise<void> {
const selectProcessDropdown: ElementFinder = element(by.xpath(`//mat-option/child::span [text() = ' ${name} ']`));
await BrowserActions.click(selectProcessDropdown);
await this.dropdownPage.selectOption(name);
}
async typeProcessDefinition(name): Promise<void> {

View File

@@ -15,7 +15,7 @@
* limitations under the License.
*/
import { BrowserActions, BrowserVisibility, TabsPage } from '@alfresco/adf-testing';
import { BrowserActions, BrowserVisibility, DropdownPage, TabsPage } from '@alfresco/adf-testing';
import { browser, by, element, ElementFinder } from 'protractor';
import { AppSettingsTogglesPage } from './dialog/app-settings-toggles.page';
@@ -55,7 +55,6 @@ export class TaskDetailsPage {
involvePeopleHeader: ElementFinder = element(by.css('div[class="adf-search-text-header"]'));
removeInvolvedPeople: ElementFinder = element(by.css('button[data-automation-id="Remove"]'));
peopleTitle: ElementFinder = element(by.id('people-title'));
attachFormDropdown: ElementFinder = element(by.css('div[class="adf-attach-form-row"]'));
cancelAttachForm: ElementFinder = element(by.id('adf-no-form-cancel-button'));
attachFormButton: ElementFinder = element(by.id('adf-no-form-attach-form-button'));
disabledAttachFormButton: ElementFinder = element(by.css('button[id="adf-no-form-attach-form-button"][disabled]'));
@@ -67,6 +66,8 @@ export class TaskDetailsPage {
claimElement = element(by.css('[data-automation-id="header-claim-button"]'));
releaseElement = element(by.css('[data-automation-id="header-unclaim-button"]'));
attachFormDropdown = new DropdownPage(element(by.css('div[class="adf-attach-form-row"]')));
async checkEditableAssigneeIsNotDisplayed(): Promise<void> {
await BrowserVisibility.waitUntilElementIsNotVisible(this.editableAssignee);
}
@@ -96,8 +97,7 @@ export class TaskDetailsPage {
}
async checkSelectedForm(formName): Promise<void> {
const text = await BrowserActions.getText(this.attachFormName);
await expect(formName).toEqual(text);
await this.attachFormDropdown.checkOptionIsSelected(formName);
}
async checkAttachFormButtonIsDisabled(): Promise<void> {
@@ -109,16 +109,11 @@ export class TaskDetailsPage {
}
async checkAttachFormDropdownIsDisplayed(): Promise<void> {
await BrowserVisibility.waitUntilElementIsVisible(this.attachFormDropdown);
}
async clickAttachFormDropdown(): Promise<void> {
await BrowserActions.click(this.attachFormDropdown);
await this.attachFormDropdown.checkDropdownIsVisible();
}
async selectAttachFormOption(option): Promise<void> {
const selectedOption: ElementFinder = element(by.cssContainingText('mat-option[role="option"]', option));
await BrowserActions.click(selectedOption);
await this.attachFormDropdown.clickDropdownWithOption(option);
}
async checkCancelAttachFormIsDisplayed(): Promise<void> {

View File

@@ -52,7 +52,7 @@ export class TasksPage {
await dialog.addName(name);
await dialog.addDescription(description);
await dialog.addDueDate(dueDate);
await dialog.addForm(formName);
await dialog.selectForm(formName);
await dialog.clickStartButton();
}