mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-24 17:32:15 +00:00
[no-issue] Parallel run e2e and e2e common action refactoring (#4702)
This commit is contained in:
@@ -18,6 +18,7 @@
|
||||
import { by, element } from 'protractor';
|
||||
import { DocumentListPage } from '../pages/document-list.page';
|
||||
import { BrowserVisibility } from '../../core/utils/browser-visibility';
|
||||
import { BrowserActions } from '../../core/utils/browser-actions';
|
||||
|
||||
export class ContentNodeSelectorDialogPage {
|
||||
dialog = element(by.css(`adf-content-node-selector`));
|
||||
@@ -40,8 +41,7 @@ export class ContentNodeSelectorDialogPage {
|
||||
}
|
||||
|
||||
getDialogHeaderText() {
|
||||
BrowserVisibility.waitUntilElementIsVisible(this.header);
|
||||
return this.header.getText();
|
||||
return BrowserActions.getText(this.header);
|
||||
}
|
||||
|
||||
checkSearchInputIsDisplayed() {
|
||||
@@ -50,8 +50,7 @@ export class ContentNodeSelectorDialogPage {
|
||||
}
|
||||
|
||||
getSearchLabel() {
|
||||
BrowserVisibility.waitUntilElementIsVisible(this.searchLabel);
|
||||
return this.searchLabel.getText();
|
||||
return BrowserActions.getText(this.searchLabel);
|
||||
}
|
||||
|
||||
checkSelectedSiteIsDisplayed(siteName) {
|
||||
@@ -63,8 +62,7 @@ export class ContentNodeSelectorDialogPage {
|
||||
}
|
||||
|
||||
clickCancelButton() {
|
||||
BrowserVisibility.waitUntilElementIsVisible(this.cancelButton);
|
||||
return this.cancelButton.click();
|
||||
return BrowserActions.click(this.cancelButton);
|
||||
}
|
||||
|
||||
checkMoveCopyButtonIsDisplayed() {
|
||||
@@ -72,13 +70,11 @@ export class ContentNodeSelectorDialogPage {
|
||||
}
|
||||
|
||||
getMoveCopyButtonText() {
|
||||
BrowserVisibility.waitUntilElementIsVisible(this.moveCopyButton);
|
||||
return this.moveCopyButton.getText();
|
||||
return BrowserActions.getText(this.moveCopyButton);
|
||||
}
|
||||
|
||||
clickMoveCopyButton() {
|
||||
BrowserVisibility.waitUntilElementIsVisible(this.moveCopyButton);
|
||||
return this.moveCopyButton.click();
|
||||
return BrowserActions.click(this.moveCopyButton);
|
||||
}
|
||||
|
||||
numberOfResultsDisplayed() {
|
||||
|
@@ -0,0 +1,28 @@
|
||||
/*!
|
||||
* @license
|
||||
* Copyright 2019 Alfresco Software, Ltd.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { by, element } from 'protractor';
|
||||
import { BrowserActions } from '../../core/utils/browser-actions';
|
||||
|
||||
export class DownloadDialogPage {
|
||||
cancelButton = element(by.id(`cancel-button`));
|
||||
|
||||
clickCancelButton() {
|
||||
return BrowserActions.click(this.cancelButton);
|
||||
}
|
||||
|
||||
}
|
@@ -16,3 +16,4 @@
|
||||
*/
|
||||
|
||||
export * from './content-node-selector-dialog.page';
|
||||
export * from './download-dialog.page';
|
||||
|
@@ -18,14 +18,15 @@
|
||||
import { by, element, ElementFinder, browser } from 'protractor';
|
||||
import { DataTableComponentPage } from '../../core/pages/data-table-component.page';
|
||||
import { BrowserVisibility } from '../../core/utils/browser-visibility';
|
||||
import { BrowserActions } from '../../core/utils/browser-actions';
|
||||
|
||||
export class DocumentListPage {
|
||||
|
||||
rootElement: ElementFinder;
|
||||
actionMenu = element(by.css('div[role="menu"]'));
|
||||
optionButton = by.css('button[data-automation-id*="action_menu_"]');
|
||||
tableBody;
|
||||
dataTable;
|
||||
tableBody: ElementFinder;
|
||||
dataTable: DataTableComponentPage;
|
||||
|
||||
constructor(rootElement: ElementFinder = element.all(by.css('adf-document-list')).first()) {
|
||||
this.rootElement = rootElement;
|
||||
@@ -64,6 +65,7 @@ export class DocumentListPage {
|
||||
}
|
||||
|
||||
clickOnActionMenu(content) {
|
||||
BrowserActions.closeMenuAndDialogs();
|
||||
const row = this.dataTable.getRow('Display name', content);
|
||||
row.element(this.optionButton).click();
|
||||
BrowserVisibility.waitUntilElementIsVisible(this.actionMenu);
|
||||
|
@@ -18,6 +18,7 @@
|
||||
import { ApiService } from '../api.service';
|
||||
import { UserModel } from '../../models/user.model';
|
||||
import { PersonBodyCreate } from '@alfresco/js-api';
|
||||
import { RolesService } from './roles.service';
|
||||
|
||||
export class IdentityService {
|
||||
|
||||
@@ -27,6 +28,14 @@ export class IdentityService {
|
||||
this.api = api;
|
||||
}
|
||||
|
||||
async createActivitiUserWithRole(apiService, role: string = 'ACTIVITI_USER') {
|
||||
const rolesService = new RolesService(apiService);
|
||||
const apsUser = await this.createIdentityUser();
|
||||
const apsUserRoleId = await rolesService.getRoleIdByRoleName(role);
|
||||
await this.assignRole(apsUser.idIdentityService, apsUserRoleId, role);
|
||||
return apsUser;
|
||||
}
|
||||
|
||||
async createIdentityUser(user: UserModel = new UserModel()) {
|
||||
await this.createUser(user);
|
||||
|
||||
@@ -77,16 +86,14 @@ export class IdentityService {
|
||||
'enabled': true,
|
||||
'email': user.email
|
||||
};
|
||||
const data = await this.api.performIdentityOperation(path, method, queryParams, postBody);
|
||||
return data;
|
||||
return await this.api.performIdentityOperation(path, method, queryParams, postBody);
|
||||
}
|
||||
|
||||
async deleteUser(userId) {
|
||||
const path = `/users/${userId}`;
|
||||
const method = 'DELETE';
|
||||
const queryParams = {}, postBody = {};
|
||||
const data = await this.api.performIdentityOperation(path, method, queryParams, postBody);
|
||||
return data;
|
||||
return await this.api.performIdentityOperation(path, method, queryParams, postBody);
|
||||
}
|
||||
|
||||
async getUserInfoByUsername(username) {
|
||||
@@ -104,8 +111,7 @@ export class IdentityService {
|
||||
const queryParams = {},
|
||||
postBody = { 'type': 'password', 'value': password, 'temporary': false };
|
||||
|
||||
const data = await this.api.performIdentityOperation(path, method, queryParams, postBody);
|
||||
return data;
|
||||
return await this.api.performIdentityOperation(path, method, queryParams, postBody);
|
||||
}
|
||||
|
||||
async assignRole(userId, roleId, roleName) {
|
||||
@@ -114,8 +120,7 @@ export class IdentityService {
|
||||
const queryParams = {},
|
||||
postBody = [{ 'id': roleId, 'name': roleName }];
|
||||
|
||||
const data = await this.api.performIdentityOperation(path, method, queryParams, postBody);
|
||||
return data;
|
||||
return await this.api.performIdentityOperation(path, method, queryParams, postBody);
|
||||
}
|
||||
|
||||
async deleteClientRole(userId: string, clientId: string, roleId: string, roleName: string) {
|
||||
@@ -128,8 +133,7 @@ export class IdentityService {
|
||||
'clientRole': true,
|
||||
'containerId': clientId
|
||||
}];
|
||||
const data = await this.api.performIdentityOperation(path, method, queryParams, postBody);
|
||||
return data;
|
||||
return await this.api.performIdentityOperation(path, method, queryParams, postBody);
|
||||
}
|
||||
|
||||
}
|
||||
|
@@ -26,23 +26,33 @@ export class QueryService {
|
||||
}
|
||||
|
||||
async getProcessInstanceTasks(processInstanceId, appName) {
|
||||
const path = '/' + appName + '/query/v1/process-instances/' + processInstanceId + '/tasks';
|
||||
const method = 'GET';
|
||||
try {
|
||||
const path = '/' + appName + '/query/v1/process-instances/' + processInstanceId + '/tasks';
|
||||
const method = 'GET';
|
||||
|
||||
const queryParams = {}, postBody = {};
|
||||
const queryParams = {}, postBody = {};
|
||||
|
||||
const data = await this.api.performBpmOperation(path, method, queryParams, postBody);
|
||||
return data;
|
||||
const data = await this.api.performBpmOperation(path, method, queryParams, postBody);
|
||||
return data;
|
||||
} catch (error) {
|
||||
// tslint:disable-next-line:no-console
|
||||
console.log('get process-instances Service error');
|
||||
}
|
||||
}
|
||||
|
||||
async getProcessInstanceSubProcesses(processInstanceId, appName) {
|
||||
const path = '/' + appName + '/query/v1/process-instances/' + processInstanceId + '/subprocesses';
|
||||
const method = 'GET';
|
||||
try {
|
||||
const path = '/' + appName + '/query/v1/process-instances/' + processInstanceId + '/subprocesses';
|
||||
const method = 'GET';
|
||||
|
||||
const queryParams = {};
|
||||
const queryParams = {};
|
||||
|
||||
const data = await this.api.performBpmOperation(path, method, queryParams, {});
|
||||
return data;
|
||||
const data = await this.api.performBpmOperation(path, method, queryParams, {});
|
||||
return data;
|
||||
} catch (error) {
|
||||
// tslint:disable-next-line:no-console
|
||||
console.log('get subprocesses process-instances Service error');
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
@@ -26,84 +26,115 @@ export class TasksService {
|
||||
}
|
||||
|
||||
async createStandaloneTask(taskName, appName, options?) {
|
||||
const path = '/' + appName + '/rb/v1/tasks';
|
||||
const method = 'POST';
|
||||
try {
|
||||
const path = '/' + appName + '/rb/v1/tasks';
|
||||
const method = 'POST';
|
||||
|
||||
const queryParams = {}, postBody = {
|
||||
'name': taskName,
|
||||
'payloadType': 'CreateTaskPayload',
|
||||
...options
|
||||
};
|
||||
const queryParams = {}, postBody = {
|
||||
'name': taskName,
|
||||
'payloadType': 'CreateTaskPayload',
|
||||
...options
|
||||
};
|
||||
|
||||
const data = await this.api.performBpmOperation(path, method, queryParams, postBody);
|
||||
return data;
|
||||
return await this.api.performBpmOperation(path, method, queryParams, postBody);
|
||||
} catch (error) {
|
||||
// tslint:disable-next-line:no-console
|
||||
console.log('Task Service error');
|
||||
}
|
||||
}
|
||||
|
||||
async completeTask(taskId, appName) {
|
||||
const path = '/' + appName + '/rb/v1/tasks/' + taskId + '/complete';
|
||||
const method = 'POST';
|
||||
try {
|
||||
const path = '/' + appName + '/rb/v1/tasks/' + taskId + '/complete';
|
||||
const method = 'POST';
|
||||
|
||||
const queryParams = {}, postBody = {'payloadType': 'CompleteTaskPayload'};
|
||||
const queryParams = {}, postBody = { 'payloadType': 'CompleteTaskPayload' };
|
||||
|
||||
return await this.api.performBpmOperation(path, method, queryParams, postBody);
|
||||
} catch (error) {
|
||||
// tslint:disable-next-line:no-console
|
||||
console.log('Task Service error');
|
||||
}
|
||||
|
||||
const data = await this.api.performBpmOperation(path, method, queryParams, postBody);
|
||||
return data;
|
||||
}
|
||||
|
||||
async claimTask(taskId, appName) {
|
||||
const path = '/' + appName + '/rb/v1/tasks/' + taskId + '/claim';
|
||||
const method = 'POST';
|
||||
async claimTask(taskId, appName, assignee: string = global['TestConfig'].adf.adminEmail) {
|
||||
try {
|
||||
const path = '/' + appName + '/rb/v1/tasks/' + taskId + `/claim?assignee=${assignee}`;
|
||||
const method = 'POST';
|
||||
|
||||
const queryParams = {}, postBody = {};
|
||||
const queryParams = {}, postBody = {};
|
||||
|
||||
const data = await this.api.performBpmOperation(path, method, queryParams, postBody);
|
||||
return data;
|
||||
return await this.api.performBpmOperation(path, method, queryParams, postBody);
|
||||
} catch (error) {
|
||||
// tslint:disable-next-line:no-console
|
||||
console.log('claim Task Service error');
|
||||
}
|
||||
}
|
||||
|
||||
async deleteTask(taskId, appName) {
|
||||
const path = '/' + appName + '/rb/v1/tasks/' + taskId;
|
||||
const method = 'DELETE';
|
||||
try {
|
||||
const path = '/' + appName + '/rb/v1/tasks/' + taskId;
|
||||
const method = 'DELETE';
|
||||
|
||||
const queryParams = {}, postBody = {};
|
||||
const queryParams = {}, postBody = {};
|
||||
|
||||
const data = await this.api.performBpmOperation(path, method, queryParams, postBody);
|
||||
return data;
|
||||
return await this.api.performBpmOperation(path, method, queryParams, postBody);
|
||||
} catch (error) {
|
||||
// tslint:disable-next-line:no-console
|
||||
console.log('delete task Service error');
|
||||
}
|
||||
}
|
||||
|
||||
async createAndCompleteTask (taskName, appName) {
|
||||
async createAndCompleteTask(taskName, appName, assignee: string = global['TestConfig'].adf.adminEmail) {
|
||||
const task = await this.createStandaloneTask(taskName, appName);
|
||||
await this.claimTask(task.entry.id, appName);
|
||||
await this.claimTask(task.entry.id, appName, assignee);
|
||||
await this.completeTask(task.entry.id, appName);
|
||||
return task;
|
||||
}
|
||||
|
||||
async getTask(taskId, appName) {
|
||||
const path = '/' + appName + '/query/v1/tasks/' + taskId;
|
||||
const method = 'GET';
|
||||
try {
|
||||
const path = '/' + appName + '/query/v1/tasks/' + taskId;
|
||||
const method = 'GET';
|
||||
|
||||
const queryParams = {}, postBody = {};
|
||||
const queryParams = {}, postBody = {};
|
||||
|
||||
const data = await this.api.performBpmOperation(path, method, queryParams, postBody);
|
||||
return data;
|
||||
return await this.api.performBpmOperation(path, method, queryParams, postBody);
|
||||
} catch (error) {
|
||||
// tslint:disable-next-line:no-console
|
||||
console.log('get Task Service error');
|
||||
}
|
||||
}
|
||||
|
||||
async getTaskId(taskName, appName) {
|
||||
const path = '/' + appName + '/query/v1/tasks';
|
||||
const method = 'GET';
|
||||
try {
|
||||
const path = '/' + appName + '/query/v1/tasks';
|
||||
const method = 'GET';
|
||||
|
||||
const queryParams = {name: taskName}, postBody = {};
|
||||
const queryParams = { name: taskName }, postBody = {};
|
||||
|
||||
const data = await this.api.performBpmOperation(path, method, queryParams, postBody);
|
||||
return data.list.entries[0].entry.id;
|
||||
const data = await this.api.performBpmOperation(path, method, queryParams, postBody);
|
||||
return data.list.entries && data.list.entries.length > 0 ? data.list.entries[0].entry.id : null;
|
||||
} catch (error) {
|
||||
// tslint:disable-next-line:no-console
|
||||
console.log('get Task Service error');
|
||||
}
|
||||
}
|
||||
|
||||
async createStandaloneSubtask(parentTaskId, appName, name) {
|
||||
const path = '/' + appName + '/rb/v1/tasks';
|
||||
const method = 'POST';
|
||||
try {
|
||||
const path = '/' + appName + '/rb/v1/tasks';
|
||||
const method = 'POST';
|
||||
|
||||
const queryParams = {}, postBody = {'name': name, 'parentTaskId': parentTaskId, 'payloadType': 'CreateTaskPayload'};
|
||||
const queryParams = {},
|
||||
postBody = { 'name': name, 'parentTaskId': parentTaskId, 'payloadType': 'CreateTaskPayload' };
|
||||
|
||||
const data = await this.api.performBpmOperation(path, method, queryParams, postBody);
|
||||
return data;
|
||||
return await this.api.performBpmOperation(path, method, queryParams, postBody);
|
||||
} catch (error) {
|
||||
// tslint:disable-next-line:no-console
|
||||
console.log('create Task Service error');
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
@@ -20,7 +20,7 @@ import { StringUtil } from '../utils/string.util';
|
||||
export class UserModel {
|
||||
|
||||
firstName: string = StringUtil.generateRandomString();
|
||||
lastName: string = StringUtil.generateRandomString() + 'LastName';
|
||||
lastName: string = StringUtil.generateRandomString();
|
||||
password: string = StringUtil.generateRandomString();
|
||||
email: string = StringUtil.generateRandomEmail('@alfresco.com');
|
||||
username: string = StringUtil.generateRandomString().toLowerCase();
|
||||
|
@@ -18,6 +18,7 @@
|
||||
import { browser, by, element, protractor } from 'protractor';
|
||||
import { ElementFinder, ElementArrayFinder } from 'protractor/built/element';
|
||||
import { BrowserVisibility } from '../utils/browser-visibility';
|
||||
import { BrowserActions } from '../utils/browser-actions';
|
||||
|
||||
export class DataTableComponentPage {
|
||||
|
||||
@@ -103,10 +104,9 @@ export class DataTableComponentPage {
|
||||
}
|
||||
|
||||
selectRow(columnName, columnValue) {
|
||||
BrowserActions.closeMenuAndDialogs();
|
||||
const row = this.getRow(columnName, columnValue);
|
||||
BrowserVisibility.waitUntilElementIsVisible(row);
|
||||
BrowserVisibility.waitUntilElementIsClickable(row);
|
||||
row.click();
|
||||
BrowserActions.click(row);
|
||||
return this;
|
||||
}
|
||||
|
||||
@@ -126,8 +126,7 @@ export class DataTableComponentPage {
|
||||
const row = this.getRow(identifyingColumn, identifyingValue);
|
||||
BrowserVisibility.waitUntilElementIsVisible(row);
|
||||
const rowColumn = row.element(by.css(`div[title="${columnName}"] span`));
|
||||
BrowserVisibility.waitUntilElementIsVisible(rowColumn);
|
||||
return rowColumn.getText();
|
||||
return BrowserActions.getText(rowColumn);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -158,6 +157,7 @@ export class DataTableComponentPage {
|
||||
}
|
||||
|
||||
rightClickOnRow(columnName, columnValue) {
|
||||
BrowserActions.closeMenuAndDialogs();
|
||||
const row = this.getRow(columnName, columnValue);
|
||||
browser.actions().click(row, protractor.Button.RIGHT).perform();
|
||||
BrowserVisibility.waitUntilElementIsVisible(element(by.id('adf-context-menu-content')));
|
||||
@@ -188,12 +188,10 @@ export class DataTableComponentPage {
|
||||
return this.rootElement.all(columnLocator).getText();
|
||||
}
|
||||
|
||||
doubleClickRow(columnName, columnValue) {
|
||||
doubleClickRow(columnName: string, columnValue: string) {
|
||||
BrowserActions.closeMenuAndDialogs();
|
||||
const row = this.getRow(columnName, columnValue);
|
||||
BrowserVisibility.waitUntilElementIsVisible(row);
|
||||
BrowserVisibility.waitUntilElementIsClickable(row);
|
||||
row.click();
|
||||
this.checkRowIsSelected(columnName, columnValue);
|
||||
BrowserActions.click(row);
|
||||
browser.actions().sendKeys(protractor.Key.ENTER).perform();
|
||||
return this;
|
||||
}
|
||||
@@ -249,7 +247,6 @@ export class DataTableComponentPage {
|
||||
getRow(columnName, columnValue) {
|
||||
const row = this.rootElement.all(by.css(`div[title="${columnName}"] div[data-automation-id="text_${columnValue}"]`)).first()
|
||||
.element(by.xpath(`ancestor::div[contains(@class, 'adf-datatable-row')]`));
|
||||
BrowserVisibility.waitUntilElementIsVisible(row);
|
||||
return row;
|
||||
}
|
||||
|
||||
@@ -317,14 +314,11 @@ export class DataTableComponentPage {
|
||||
|
||||
clickRowByContent(name) {
|
||||
const resultElement = this.rootElement.all(by.css(`div[data-automation-id='${name}']`)).first();
|
||||
BrowserVisibility.waitUntilElementIsVisible(resultElement);
|
||||
BrowserVisibility.waitUntilElementIsClickable(resultElement);
|
||||
resultElement.click();
|
||||
BrowserActions.click(resultElement);
|
||||
}
|
||||
|
||||
getCopyContentTooltip() {
|
||||
BrowserVisibility.waitUntilElementIsVisible(this.copyColumnTooltip);
|
||||
return this.copyColumnTooltip.getText();
|
||||
return BrowserActions.getText(this.copyColumnTooltip);
|
||||
}
|
||||
|
||||
copyContentTooltipIsNotDisplayed() {
|
||||
@@ -351,9 +345,7 @@ export class DataTableComponentPage {
|
||||
}
|
||||
|
||||
clickElement(elem) {
|
||||
BrowserVisibility.waitUntilElementIsVisible(elem);
|
||||
BrowserVisibility.waitUntilElementIsClickable(elem);
|
||||
elem.click();
|
||||
BrowserActions.click(elem);
|
||||
return this;
|
||||
}
|
||||
}
|
||||
|
@@ -17,6 +17,7 @@
|
||||
|
||||
import { BrowserVisibility } from '../utils/browser-visibility';
|
||||
import { element, by } from 'protractor';
|
||||
import { BrowserActions } from '../utils/browser-actions';
|
||||
|
||||
export class ErrorPage {
|
||||
|
||||
@@ -27,13 +28,11 @@ export class ErrorPage {
|
||||
secondButton = element(by.id('adf-secondary-button'));
|
||||
|
||||
clickBackButton() {
|
||||
BrowserVisibility.waitUntilElementIsVisible(this.backButton);
|
||||
this.backButton.click();
|
||||
BrowserActions.click(this.backButton);
|
||||
}
|
||||
|
||||
clickSecondButton() {
|
||||
BrowserVisibility.waitUntilElementIsVisible(this.secondButton);
|
||||
this.secondButton.click();
|
||||
BrowserActions.click(this.secondButton);
|
||||
}
|
||||
|
||||
checkErrorCode() {
|
||||
@@ -41,17 +40,14 @@ export class ErrorPage {
|
||||
}
|
||||
|
||||
getErrorCode() {
|
||||
BrowserVisibility.waitUntilElementIsVisible(this.errorPageCode);
|
||||
return this.errorPageCode.getText();
|
||||
return BrowserActions.getText(this.errorPageCode);
|
||||
}
|
||||
|
||||
getErrorTitle() {
|
||||
BrowserVisibility.waitUntilElementIsVisible(this.errorPageTitle);
|
||||
return this.errorPageTitle.getText();
|
||||
return BrowserActions.getText(this.errorPageTitle);
|
||||
}
|
||||
|
||||
getErrorDescription() {
|
||||
BrowserVisibility.waitUntilElementIsVisible(this.errorPageDescription);
|
||||
return this.errorPageDescription.getText();
|
||||
return BrowserActions.getText(this.errorPageDescription);
|
||||
}
|
||||
}
|
||||
|
@@ -17,6 +17,7 @@
|
||||
|
||||
import { element, by, protractor } from 'protractor';
|
||||
import { BrowserVisibility } from '../utils/browser-visibility';
|
||||
import { BrowserActions } from '../utils/browser-actions';
|
||||
|
||||
export class HeaderPage {
|
||||
|
||||
@@ -50,13 +51,13 @@ export class HeaderPage {
|
||||
|
||||
clickShowMenuButton() {
|
||||
const checkBox = element.all(by.css('mat-checkbox'));
|
||||
BrowserVisibility.waitUntilElementIsVisible(checkBox);
|
||||
BrowserVisibility.waitUntilElementIsVisible(checkBox.first());
|
||||
return checkBox.get(0).click();
|
||||
}
|
||||
|
||||
changeHeaderColor(color) {
|
||||
const headerColor = element(by.css('option[value="' + color + '"]'));
|
||||
return headerColor.click();
|
||||
return BrowserActions.click(headerColor);
|
||||
}
|
||||
|
||||
checkAppTitle(name) {
|
||||
@@ -65,8 +66,7 @@ export class HeaderPage {
|
||||
}
|
||||
|
||||
addTitle(title) {
|
||||
BrowserVisibility.waitUntilElementIsVisible(this.titleInput);
|
||||
this.titleInput.click();
|
||||
BrowserActions.click(this.titleInput);
|
||||
this.titleInput.sendKeys(title);
|
||||
this.titleInput.sendKeys(protractor.Key.ENTER);
|
||||
}
|
||||
@@ -77,8 +77,7 @@ export class HeaderPage {
|
||||
}
|
||||
|
||||
addIcon(url) {
|
||||
BrowserVisibility.waitUntilElementIsVisible(this.iconInput);
|
||||
this.iconInput.click();
|
||||
BrowserActions.click(this.iconInput);
|
||||
this.iconInput.sendKeys(url);
|
||||
this.iconInput.sendKeys(protractor.Key.ENTER);
|
||||
}
|
||||
@@ -96,35 +95,31 @@ export class HeaderPage {
|
||||
}
|
||||
|
||||
addHexCodeColor(hexCode) {
|
||||
BrowserVisibility.waitUntilElementIsVisible(this.hexColorInput);
|
||||
this.hexColorInput.click();
|
||||
BrowserActions.click(this.hexColorInput);
|
||||
this.hexColorInput.sendKeys(hexCode);
|
||||
return this.hexColorInput.sendKeys(protractor.Key.ENTER);
|
||||
}
|
||||
|
||||
addLogoHyperlink(hyperlink) {
|
||||
BrowserVisibility.waitUntilElementIsVisible(this.logoHyperlinkInput);
|
||||
BrowserVisibility.waitUntilElementIsClickable(this.logoHyperlinkInput);
|
||||
this.logoHyperlinkInput.click();
|
||||
BrowserActions.click(this.logoHyperlinkInput);
|
||||
this.logoHyperlinkInput.sendKeys(hyperlink);
|
||||
return this.logoHyperlinkInput.sendKeys(protractor.Key.ENTER);
|
||||
}
|
||||
|
||||
addLogoTooltip(tooltip) {
|
||||
BrowserVisibility.waitUntilElementIsVisible(this.logoTooltipInput);
|
||||
this.logoTooltipInput.click();
|
||||
BrowserActions.click(this.logoTooltipInput);
|
||||
this.logoTooltipInput.sendKeys(tooltip);
|
||||
return this.logoTooltipInput.sendKeys(protractor.Key.ENTER);
|
||||
}
|
||||
|
||||
sideBarPositionStart() {
|
||||
BrowserVisibility.waitUntilElementIsVisible(this.positionStart);
|
||||
return this.positionStart.click();
|
||||
return BrowserActions.click(this.positionStart);
|
||||
|
||||
}
|
||||
|
||||
sideBarPositionEnd() {
|
||||
BrowserVisibility.waitUntilElementIsVisible(this.positionEnd);
|
||||
return this.positionEnd.click();
|
||||
return BrowserActions.click(this.positionEnd);
|
||||
|
||||
}
|
||||
|
||||
checkSidebarPositionStart() {
|
||||
|
@@ -17,6 +17,7 @@
|
||||
|
||||
import { element, by, browser, protractor } from 'protractor';
|
||||
import { BrowserVisibility } from '../utils/browser-visibility';
|
||||
import { BrowserActions } from '../utils/browser-actions';
|
||||
|
||||
export class LoginSSOPage {
|
||||
|
||||
@@ -38,34 +39,27 @@ export class LoginSSOPage {
|
||||
}
|
||||
|
||||
clickOnSSOButton() {
|
||||
BrowserVisibility.waitUntilElementIsVisible(this.ssoButton);
|
||||
this.ssoButton.click();
|
||||
return BrowserActions.clickExecuteScript('[data-automation-id="login-button-sso"]');
|
||||
}
|
||||
|
||||
enterUsername(username) {
|
||||
BrowserVisibility.waitUntilElementIsVisible(this.usernameField);
|
||||
this.usernameField.clear();
|
||||
this.usernameField.sendKeys(username);
|
||||
BrowserActions.clearSendKeys(this.usernameField, username);
|
||||
}
|
||||
|
||||
enterPassword(password) {
|
||||
BrowserVisibility.waitUntilElementIsVisible(this.passwordField);
|
||||
this.passwordField.clear();
|
||||
this.passwordField.sendKeys(password);
|
||||
BrowserActions.clearSendKeys(this.passwordField, password);
|
||||
}
|
||||
|
||||
clickLoginButton() {
|
||||
BrowserVisibility.waitUntilElementIsVisible(this.loginButton);
|
||||
return this.loginButton.click();
|
||||
return BrowserActions.click(this.loginButton);
|
||||
}
|
||||
|
||||
checkLoginErrorIsDisplayed() {
|
||||
BrowserVisibility.waitUntilElementIsVisible(this.loginError);
|
||||
return BrowserVisibility.waitUntilElementIsVisible(this.loginError);
|
||||
}
|
||||
|
||||
getLoginErrorMessage() {
|
||||
BrowserVisibility.waitUntilElementIsVisible(this.loginError);
|
||||
return this.loginError.getText();
|
||||
return BrowserActions.getText(this.loginError);
|
||||
}
|
||||
|
||||
}
|
||||
|
@@ -19,6 +19,7 @@ import { FormControllersPage } from './form-controller.page';
|
||||
import { browser, by, element, protractor } from 'protractor';
|
||||
import { BrowserVisibility } from '../utils/browser-visibility';
|
||||
import { LocalStorageUtil } from '../utils/local-storage.util';
|
||||
import { BrowserActions } from '../utils/browser-actions';
|
||||
|
||||
export class LoginPage {
|
||||
|
||||
@@ -74,7 +75,7 @@ export class LoginPage {
|
||||
)
|
||||
);
|
||||
|
||||
goToLoginPage() {
|
||||
async goToLoginPage() {
|
||||
browser.waitForAngularEnabled(true);
|
||||
browser.driver.get(this.loginURL);
|
||||
this.waitForElements();
|
||||
@@ -88,19 +89,14 @@ export class LoginPage {
|
||||
}
|
||||
|
||||
enterUsername(username) {
|
||||
BrowserVisibility.waitUntilElementIsVisible(this.txtUsername);
|
||||
this.txtUsername.sendKeys('');
|
||||
this.txtUsername.clear();
|
||||
return this.txtUsername.sendKeys(username);
|
||||
BrowserActions.clearSendKeys(this.txtUsername, username);
|
||||
}
|
||||
|
||||
enterPassword(password) {
|
||||
BrowserVisibility.waitUntilElementIsVisible(this.txtPassword);
|
||||
this.txtPassword.clear();
|
||||
return this.txtPassword.sendKeys(password);
|
||||
BrowserActions.clearSendKeys(this.txtPassword, password);
|
||||
}
|
||||
|
||||
clearUsername() {
|
||||
async clearUsername() {
|
||||
BrowserVisibility.waitUntilElementIsVisible(this.txtUsername);
|
||||
this.txtUsername.click();
|
||||
this.txtUsername.getAttribute('value').then((value) => {
|
||||
@@ -111,7 +107,7 @@ export class LoginPage {
|
||||
return this;
|
||||
}
|
||||
|
||||
clearPassword() {
|
||||
async clearPassword() {
|
||||
BrowserVisibility.waitUntilElementIsVisible(this.txtPassword);
|
||||
this.txtPassword.getAttribute('value').then((value) => {
|
||||
for (let i = value.length; i >= 0; i--) {
|
||||
@@ -121,18 +117,15 @@ export class LoginPage {
|
||||
}
|
||||
|
||||
getUsernameTooltip() {
|
||||
BrowserVisibility.waitUntilElementIsVisible(this.usernameTooltip);
|
||||
return this.usernameTooltip.getText();
|
||||
return BrowserActions.getText(this.usernameTooltip);
|
||||
}
|
||||
|
||||
getPasswordTooltip() {
|
||||
BrowserVisibility.waitUntilElementIsVisible(this.passwordTooltip);
|
||||
return this.passwordTooltip.getText();
|
||||
return BrowserActions.getText(this.passwordTooltip);
|
||||
}
|
||||
|
||||
getLoginError() {
|
||||
BrowserVisibility.waitUntilElementIsVisible(this.loginTooltip);
|
||||
return this.loginTooltip.getText();
|
||||
return BrowserActions.getText(this.loginTooltip);
|
||||
}
|
||||
|
||||
checkLoginImgURL() {
|
||||
@@ -171,12 +164,20 @@ export class LoginPage {
|
||||
return this.signInButton.isEnabled();
|
||||
}
|
||||
|
||||
async loginToAllUsingUserModel(userModel) {
|
||||
this.goToLoginPage();
|
||||
await LocalStorageUtil.clearStorage();
|
||||
await LocalStorageUtil.setStorageItem('providers', 'ALL');
|
||||
await LocalStorageUtil.apiReset();
|
||||
return this.login(userModel.email, userModel.password);
|
||||
}
|
||||
|
||||
async loginToProcessServicesUsingUserModel(userModel) {
|
||||
this.goToLoginPage();
|
||||
await LocalStorageUtil.clearStorage();
|
||||
await LocalStorageUtil.setStorageItem('providers', 'BPM');
|
||||
await LocalStorageUtil.apiReset();
|
||||
this.login(userModel.email, userModel.password);
|
||||
return this.login(userModel.email, userModel.password);
|
||||
}
|
||||
|
||||
async loginToContentServicesUsingUserModel(userModel) {
|
||||
@@ -184,7 +185,7 @@ export class LoginPage {
|
||||
await LocalStorageUtil.clearStorage();
|
||||
await LocalStorageUtil.setStorageItem('providers', 'ECM');
|
||||
await LocalStorageUtil.apiReset();
|
||||
this.login(userModel.getId(), userModel.getPassword());
|
||||
return this.login(userModel.getId(), userModel.getPassword());
|
||||
}
|
||||
|
||||
async loginToContentServices(username, password) {
|
||||
@@ -192,28 +193,23 @@ export class LoginPage {
|
||||
await LocalStorageUtil.clearStorage();
|
||||
await LocalStorageUtil.setStorageItem('providers', 'ECM');
|
||||
await LocalStorageUtil.apiReset();
|
||||
this.waitForElements();
|
||||
this.login(username, password);
|
||||
return this.login(username, password);
|
||||
}
|
||||
|
||||
clickSignInButton() {
|
||||
BrowserVisibility.waitUntilElementIsVisible(this.signInButton);
|
||||
this.signInButton.click();
|
||||
BrowserActions.clickExecuteScript('#login-button');
|
||||
}
|
||||
|
||||
clickSettingsIcon() {
|
||||
BrowserVisibility.waitUntilElementIsVisible(this.settingsIcon);
|
||||
this.settingsIcon.click();
|
||||
BrowserActions.click(this.settingsIcon);
|
||||
}
|
||||
|
||||
showPassword() {
|
||||
BrowserVisibility.waitUntilElementIsVisible(this.showPasswordElement);
|
||||
this.showPasswordElement.click();
|
||||
BrowserActions.click(this.showPasswordElement);
|
||||
}
|
||||
|
||||
hidePassword() {
|
||||
BrowserVisibility.waitUntilElementIsVisible(this.hidePasswordElement);
|
||||
this.hidePasswordElement.click();
|
||||
BrowserActions.click(this.hidePasswordElement);
|
||||
}
|
||||
|
||||
getShownPassword() {
|
||||
@@ -269,21 +265,14 @@ export class LoginPage {
|
||||
}
|
||||
|
||||
enterSuccessRoute(route) {
|
||||
BrowserVisibility.waitUntilElementIsVisible(this.successRouteTxt);
|
||||
this.successRouteTxt.sendKeys('');
|
||||
this.successRouteTxt.clear();
|
||||
return this.successRouteTxt.sendKeys(route);
|
||||
return BrowserActions.clearSendKeys(this.successRouteTxt, route);
|
||||
}
|
||||
|
||||
enterLogo(logo) {
|
||||
BrowserVisibility.waitUntilElementIsVisible(this.logoTxt);
|
||||
this.logoTxt.sendKeys('');
|
||||
this.logoTxt.clear();
|
||||
return this.logoTxt.sendKeys(logo);
|
||||
BrowserActions.clearSendKeys(this.logoTxt, logo);
|
||||
}
|
||||
|
||||
login(username, password) {
|
||||
this.waitForElements();
|
||||
this.enterUsername(username);
|
||||
this.enterPassword(password);
|
||||
this.clickSignInButton();
|
||||
|
@@ -17,10 +17,10 @@
|
||||
|
||||
import { browser, by, element, protractor } from 'protractor';
|
||||
import { BrowserVisibility } from '../utils/browser-visibility';
|
||||
import { BrowserActions } from '../utils/browser-actions';
|
||||
|
||||
export class PaginationPage {
|
||||
|
||||
itemsPerPageDropdown = element(by.css('div[class*="adf-pagination__perpage-block"] button'));
|
||||
pageSelectorDropDown = element(by.css('div[class*="adf-pagination__page-selector"]'));
|
||||
pageSelectorArrow = element(by.css('button[data-automation-id="page-selector"]'));
|
||||
itemsPerPage = element(by.css('span[class="adf-pagination__max-items"]'));
|
||||
@@ -37,18 +37,10 @@ export class PaginationPage {
|
||||
totalFiles = element(by.css('span[class="adf-pagination__range"]'));
|
||||
|
||||
selectItemsPerPage(numberOfItem: string) {
|
||||
BrowserVisibility.waitUntilElementIsVisible(this.itemsPerPageDropdown);
|
||||
BrowserVisibility.waitUntilElementIsClickable(this.itemsPerPageDropdown);
|
||||
browser.actions().mouseMove(this.itemsPerPageDropdown).perform();
|
||||
BrowserVisibility.waitUntilElementIsVisible(this.itemsPerPageDropdown);
|
||||
BrowserVisibility.waitUntilElementIsClickable(this.itemsPerPageDropdown);
|
||||
this.itemsPerPageDropdown.click();
|
||||
browser.executeScript(`document.querySelector('div[class*="adf-pagination__perpage-block"] button').click();`);
|
||||
BrowserVisibility.waitUntilElementIsVisible(this.pageSelectorDropDown);
|
||||
|
||||
const itemsPerPage = element.all(by.cssContainingText('.mat-menu-item', numberOfItem)).first();
|
||||
BrowserVisibility.waitUntilElementIsClickable(itemsPerPage);
|
||||
BrowserVisibility.waitUntilElementIsVisible(itemsPerPage);
|
||||
itemsPerPage.click();
|
||||
BrowserActions.click(itemsPerPage);
|
||||
return this;
|
||||
}
|
||||
|
||||
@@ -66,46 +58,33 @@ export class PaginationPage {
|
||||
}
|
||||
|
||||
getCurrentItemsPerPage() {
|
||||
BrowserVisibility.waitUntilElementIsVisible(this.itemsPerPage);
|
||||
return this.itemsPerPage.getText();
|
||||
return BrowserActions.getText(this.itemsPerPage);
|
||||
}
|
||||
|
||||
getCurrentPage() {
|
||||
BrowserVisibility.waitUntilElementIsVisible(this.paginationSection);
|
||||
BrowserVisibility.waitUntilElementIsVisible(this.currentPage);
|
||||
return this.currentPage.getText();
|
||||
return BrowserActions.getText(this.currentPage);
|
||||
}
|
||||
|
||||
getTotalPages() {
|
||||
BrowserVisibility.waitUntilElementIsVisible(this.totalPages);
|
||||
return this.totalPages.getText();
|
||||
return BrowserActions.getText(this.totalPages);
|
||||
}
|
||||
|
||||
getPaginationRange() {
|
||||
BrowserVisibility.waitUntilElementIsVisible(this.paginationRange);
|
||||
return this.paginationRange.getText();
|
||||
return BrowserActions.getText(this.paginationRange);
|
||||
}
|
||||
|
||||
clickOnNextPage() {
|
||||
BrowserVisibility.waitUntilElementIsVisible(this.nextPageButton);
|
||||
BrowserVisibility.waitUntilElementIsClickable(this.nextPageButton);
|
||||
browser.actions().mouseMove(this.nextPageButton).perform();
|
||||
BrowserVisibility.waitUntilElementIsVisible(this.nextPageButton);
|
||||
BrowserVisibility.waitUntilElementIsClickable(this.nextPageButton);
|
||||
return this.nextPageButton.click();
|
||||
browser.executeScript(`document.querySelector('button[class*="adf-pagination__next-button"]').click();`);
|
||||
}
|
||||
|
||||
clickOnPageDropdown() {
|
||||
BrowserVisibility.waitUntilElementIsVisible(this.pageDropDown);
|
||||
BrowserVisibility.waitUntilElementIsClickable(this.pageDropDown);
|
||||
return this.pageDropDown.click();
|
||||
return BrowserActions.click(this.pageDropDown);
|
||||
}
|
||||
|
||||
clickOnPageDropdownOption(numberOfItemPerPage: string) {
|
||||
BrowserVisibility.waitUntilElementIsVisible(element.all(this.pageDropDownOptions).first());
|
||||
const option = element(by.cssContainingText('div[class*="mat-menu-content"] button', numberOfItemPerPage));
|
||||
BrowserVisibility.waitUntilElementIsVisible(option);
|
||||
option.click();
|
||||
BrowserActions.click(option);
|
||||
return this;
|
||||
}
|
||||
|
||||
|
@@ -17,6 +17,7 @@
|
||||
|
||||
import { browser, by, element, protractor } from 'protractor';
|
||||
import { BrowserVisibility } from '../utils/browser-visibility';
|
||||
import { BrowserActions } from '../utils/browser-actions';
|
||||
|
||||
export class SettingsPage {
|
||||
|
||||
@@ -71,7 +72,7 @@ export class SettingsPage {
|
||||
}
|
||||
|
||||
getSelectedOptionText() {
|
||||
return this.selectedOption.getText();
|
||||
return BrowserActions.getText(this.selectedOption);
|
||||
}
|
||||
|
||||
getBpmHostUrl() {
|
||||
@@ -95,7 +96,6 @@ export class SettingsPage {
|
||||
}
|
||||
|
||||
setProviderEcmBpm() {
|
||||
this.goToSettingsPage();
|
||||
this.setProvider(this.ecmAndBpm.option, this.ecmAndBpm.text);
|
||||
BrowserVisibility.waitUntilElementIsVisible(this.bpmText);
|
||||
BrowserVisibility.waitUntilElementIsVisible(this.ecmText);
|
||||
@@ -104,7 +104,6 @@ export class SettingsPage {
|
||||
}
|
||||
|
||||
setProviderBpm() {
|
||||
this.goToSettingsPage();
|
||||
this.setProvider(this.bpm.option, this.bpm.text);
|
||||
BrowserVisibility.waitUntilElementIsVisible(this.bpmText);
|
||||
this.clickApply();
|
||||
@@ -112,7 +111,6 @@ export class SettingsPage {
|
||||
}
|
||||
|
||||
setProviderEcm() {
|
||||
this.goToSettingsPage();
|
||||
this.setProvider(this.ecm.option, this.ecm.text);
|
||||
BrowserVisibility.waitUntilElementIsVisible(this.ecmText);
|
||||
expect(this.bpmText.isPresent()).toBeFalsy();
|
||||
@@ -145,15 +143,15 @@ export class SettingsPage {
|
||||
this.setProvider(this.ecm.option, this.ecm.text);
|
||||
BrowserVisibility.waitUntilElementIsNotOnPage(this.bpmText);
|
||||
BrowserVisibility.waitUntilElementIsVisible(this.ecmText);
|
||||
await this.clickSsoRadioButton();
|
||||
await this.setClientId(clientId);
|
||||
await this.setContentServicesURL(contentServiceURL);
|
||||
await this.setAuthHost(authHost);
|
||||
await this.setIdentityHost(identityHost);
|
||||
await this.setSilentLogin(silentLogin);
|
||||
await this.setImplicitFlow(implicitFlow);
|
||||
await this.setLogoutUrl(logoutUr);
|
||||
await this.clickApply();
|
||||
this.clickSsoRadioButton();
|
||||
this.setContentServicesURL(contentServiceURL);
|
||||
this.setAuthHost(authHost);
|
||||
this.setIdentityHost(identityHost);
|
||||
this.setSilentLogin(silentLogin);
|
||||
this.setImplicitFlow(implicitFlow);
|
||||
this.setLogoutUrl(logoutUr);
|
||||
this.clickApply();
|
||||
browser.sleep(1000);
|
||||
}
|
||||
|
||||
async setProviderBpmSso(processServiceURL, authHost, identityHost, silentLogin = true, implicitFlow = true) {
|
||||
@@ -161,14 +159,15 @@ export class SettingsPage {
|
||||
this.setProvider(this.bpm.option, this.bpm.text);
|
||||
BrowserVisibility.waitUntilElementIsVisible(this.bpmText);
|
||||
BrowserVisibility.waitUntilElementIsNotOnPage(this.ecmText);
|
||||
await this.clickSsoRadioButton();
|
||||
await this.setClientId();
|
||||
await this.setProcessServicesURL(processServiceURL);
|
||||
await this.setAuthHost(authHost);
|
||||
await this.setIdentityHost(identityHost);
|
||||
await this.setSilentLogin(silentLogin);
|
||||
await this.setImplicitFlow(implicitFlow);
|
||||
await this.clickApply();
|
||||
this.clickSsoRadioButton();
|
||||
this.setClientId();
|
||||
this.setProcessServicesURL(processServiceURL);
|
||||
this.setAuthHost(authHost);
|
||||
this.setIdentityHost(identityHost);
|
||||
this.setSilentLogin(silentLogin);
|
||||
this.setImplicitFlow(implicitFlow);
|
||||
this.clickApply();
|
||||
browser.sleep(1000);
|
||||
}
|
||||
|
||||
async setLogoutUrl(logoutUrl) {
|
||||
@@ -179,8 +178,7 @@ export class SettingsPage {
|
||||
|
||||
async setProcessServicesURL(processServiceURL) {
|
||||
BrowserVisibility.waitUntilElementIsVisible(this.bpmText);
|
||||
this.bpmText.clear();
|
||||
this.bpmText.sendKeys(processServiceURL);
|
||||
BrowserActions.clearSendKeys(this.bpmText, processServiceURL);
|
||||
}
|
||||
|
||||
async setClientId(clientId: string = browser.params.config.oauth2.clientId) {
|
||||
@@ -191,8 +189,7 @@ export class SettingsPage {
|
||||
|
||||
async setContentServicesURL(contentServiceURL) {
|
||||
BrowserVisibility.waitUntilElementIsClickable(this.ecmText);
|
||||
this.ecmText.clear();
|
||||
this.ecmText.sendKeys(contentServiceURL);
|
||||
BrowserActions.clearSendKeys(this.ecmText, contentServiceURL);
|
||||
}
|
||||
|
||||
clearContentServicesURL() {
|
||||
@@ -227,7 +224,7 @@ export class SettingsPage {
|
||||
}
|
||||
|
||||
async setSilentLogin(enableToggle) {
|
||||
await BrowserVisibility.waitUntilElementIsVisible(this.silentLoginToggleElement);
|
||||
BrowserVisibility.waitUntilElementIsVisible(this.silentLoginToggleElement);
|
||||
|
||||
const isChecked = (await this.silentLoginToggleElement.getAttribute('class')).includes('mat-checked');
|
||||
|
||||
@@ -239,7 +236,7 @@ export class SettingsPage {
|
||||
}
|
||||
|
||||
async setImplicitFlow(enableToggle) {
|
||||
await BrowserVisibility.waitUntilElementIsVisible(this.implicitFlowElement);
|
||||
BrowserVisibility.waitUntilElementIsVisible(this.implicitFlowElement);
|
||||
|
||||
const isChecked = (await this.implicitFlowElement.getAttribute('class')).includes('mat-checked');
|
||||
|
||||
@@ -251,7 +248,7 @@ export class SettingsPage {
|
||||
}
|
||||
|
||||
checkApplyButtonIsDisabled() {
|
||||
BrowserVisibility.waitUntilElementIsVisible(this.applyButton.getAttribute('disabled'));
|
||||
BrowserVisibility.waitUntilElementIsVisible(element(by.css('button[data-automation-id*="host-button"]:disabled')));
|
||||
return this;
|
||||
}
|
||||
|
||||
|
@@ -15,9 +15,10 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { element, by, browser, protractor } from 'protractor';
|
||||
import { element, by } from 'protractor';
|
||||
import { BrowserVisibility } from '../utils/browser-visibility';
|
||||
import { TabsPage } from '../../material/pages/tabs.page';
|
||||
import { BrowserActions } from '../utils/browser-actions';
|
||||
|
||||
export class UserInfoPage {
|
||||
|
||||
@@ -50,8 +51,7 @@ export class UserInfoPage {
|
||||
}
|
||||
|
||||
clickUserProfile() {
|
||||
BrowserVisibility.waitUntilElementIsVisible(this.userProfileButton);
|
||||
this.userProfileButton.click();
|
||||
BrowserActions.click(this.userProfileButton);
|
||||
}
|
||||
|
||||
clickOnContentServicesTab() {
|
||||
@@ -79,63 +79,52 @@ export class UserInfoPage {
|
||||
|
||||
getContentHeaderTitle() {
|
||||
BrowserVisibility.waitUntilElementIsVisible(this.dialog);
|
||||
BrowserVisibility.waitUntilElementIsVisible(this.userInfoEcmHeaderTitle);
|
||||
return this.userInfoEcmHeaderTitle.getText();
|
||||
return BrowserActions.getText(this.userInfoEcmHeaderTitle);
|
||||
}
|
||||
|
||||
getContentTitle() {
|
||||
BrowserVisibility.waitUntilElementIsVisible(this.userInfoEcmTitle);
|
||||
return this.userInfoEcmTitle.getText();
|
||||
return BrowserActions.getText(this.userInfoEcmTitle);
|
||||
}
|
||||
|
||||
getContentEmail() {
|
||||
BrowserVisibility.waitUntilElementIsVisible(this.ecmEmail);
|
||||
return this.ecmEmail.getText();
|
||||
return BrowserActions.getText(this.ecmEmail);
|
||||
}
|
||||
|
||||
getContentJobTitle() {
|
||||
BrowserVisibility.waitUntilElementIsVisible(this.ecmJobTitle);
|
||||
return this.ecmJobTitle.getText();
|
||||
return BrowserActions.getText(this.ecmJobTitle);
|
||||
}
|
||||
|
||||
getProcessHeaderTitle() {
|
||||
BrowserVisibility.waitUntilElementIsVisible(this.userInfoProcessHeaderTitle);
|
||||
return this.userInfoProcessHeaderTitle.getText();
|
||||
return BrowserActions.getText(this.userInfoProcessHeaderTitle);
|
||||
}
|
||||
|
||||
getProcessTitle() {
|
||||
BrowserVisibility.waitUntilElementIsVisible(this.userInfoProcessTitle);
|
||||
return this.userInfoProcessTitle.getText();
|
||||
return BrowserActions.getText(this.userInfoProcessTitle);
|
||||
}
|
||||
|
||||
getProcessEmail() {
|
||||
BrowserVisibility.waitUntilElementIsVisible(this.processEmail);
|
||||
return this.processEmail.getText();
|
||||
return BrowserActions.getText(this.processEmail);
|
||||
}
|
||||
|
||||
getProcessTenant() {
|
||||
BrowserVisibility.waitUntilElementIsVisible(this.processTenant);
|
||||
return this.processTenant.getText();
|
||||
return BrowserActions.getText(this.processTenant);
|
||||
}
|
||||
|
||||
getSsoHeaderTitle () {
|
||||
BrowserVisibility.waitUntilElementIsVisible(this.userInfoSsoHeaderTitle);
|
||||
return this.userInfoSsoHeaderTitle.getText();
|
||||
getSsoHeaderTitle() {
|
||||
return BrowserActions.getText(this.userInfoSsoHeaderTitle);
|
||||
}
|
||||
|
||||
getSsoTitle() {
|
||||
BrowserVisibility.waitUntilElementIsVisible(this.userInfoSsoTitle);
|
||||
return this.userInfoSsoTitle.getText();
|
||||
return BrowserActions.getText(this.userInfoSsoTitle);
|
||||
}
|
||||
|
||||
getSsoEmail() {
|
||||
BrowserVisibility.waitUntilElementIsVisible(this.ssoEmail);
|
||||
return this.ssoEmail.getText();
|
||||
return BrowserActions.getText(this.ssoEmail);
|
||||
}
|
||||
|
||||
closeUserProfile() {
|
||||
BrowserVisibility.waitUntilElementIsVisible(this.dialog);
|
||||
browser.actions().sendKeys(protractor.Key.ESCAPE).perform();
|
||||
BrowserActions.closeMenuAndDialogs();
|
||||
}
|
||||
|
||||
checkACSProfileImage() {
|
||||
|
63
lib/testing/src/lib/core/utils/browser-actions.ts
Normal file
63
lib/testing/src/lib/core/utils/browser-actions.ts
Normal file
@@ -0,0 +1,63 @@
|
||||
/*!
|
||||
* @license
|
||||
* Copyright 2019 Alfresco Software, Ltd.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { BrowserVisibility } from './browser-visibility';
|
||||
import { browser, by, element, ElementFinder, protractor } from 'protractor';
|
||||
|
||||
export class BrowserActions {
|
||||
|
||||
static async click(elementFinder: ElementFinder) {
|
||||
BrowserVisibility.waitUntilElementIsVisible(elementFinder);
|
||||
BrowserVisibility.waitUntilElementIsClickable(elementFinder);
|
||||
return elementFinder.click();
|
||||
}
|
||||
|
||||
static async getUrl(url: string) {
|
||||
return browser.get(url);
|
||||
}
|
||||
|
||||
static async clickExecuteScript(elementCssSelector: string) {
|
||||
BrowserVisibility.waitUntilElementIsVisible(element(by.css(elementCssSelector)));
|
||||
browser.executeScript(`document.querySelector('${elementCssSelector}').click();`);
|
||||
}
|
||||
|
||||
static async getText(elementFinder: ElementFinder) {
|
||||
BrowserVisibility.waitUntilElementIsVisible(elementFinder);
|
||||
return elementFinder.getText();
|
||||
}
|
||||
|
||||
static async clearSendKeys(elementFinder: ElementFinder, text: string) {
|
||||
BrowserVisibility.waitUntilElementIsVisible(elementFinder);
|
||||
elementFinder.click();
|
||||
elementFinder.sendKeys('');
|
||||
elementFinder.clear();
|
||||
|
||||
elementFinder.sendKeys(text);
|
||||
}
|
||||
|
||||
static async closeMenuAndDialogs() {
|
||||
return browser.actions().sendKeys(protractor.Key.ESCAPE).perform();
|
||||
}
|
||||
|
||||
static clickOnDropdownOption(option: string, dropDownElement: ElementFinder) {
|
||||
this.click(dropDownElement);
|
||||
BrowserVisibility.waitUntilElementIsVisible(element('div[class*="mat-menu-content"] button'));
|
||||
const optionElement = element(by.cssContainingText('div[class*="mat-menu-content"] button', option));
|
||||
BrowserActions.click(optionElement);
|
||||
return this;
|
||||
}
|
||||
}
|
@@ -15,7 +15,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { browser, protractor } from 'protractor';
|
||||
import { browser, by, element, ElementFinder, protractor } from 'protractor';
|
||||
|
||||
const until = protractor.ExpectedConditions;
|
||||
const DEFAULT_TIMEOUT = global['TestConfig'] ? global['TestConfig'].main.timeout : 40000;
|
||||
@@ -25,7 +25,7 @@ export class BrowserVisibility {
|
||||
/*
|
||||
* Wait for element is visible
|
||||
*/
|
||||
static waitUntilElementIsVisible(elementToCheck, waitTimeout: number = DEFAULT_TIMEOUT) {
|
||||
static waitUntilElementIsVisible(elementToCheck: ElementFinder, waitTimeout: number = DEFAULT_TIMEOUT, message: string = '') {
|
||||
let isDisplayed = false;
|
||||
return browser.wait(() => {
|
||||
browser.waitForAngularEnabled();
|
||||
@@ -39,13 +39,13 @@ export class BrowserVisibility {
|
||||
}
|
||||
);
|
||||
return isDisplayed;
|
||||
}, waitTimeout, 'Element is not visible ' + elementToCheck.locator());
|
||||
}, waitTimeout, 'Element is not visible ' + elementToCheck.locator() + ' ' + message);
|
||||
}
|
||||
|
||||
/*
|
||||
* Wait for element to be clickable
|
||||
*/
|
||||
static waitUntilElementIsClickable(elementToCheck, waitTimeout: number = DEFAULT_TIMEOUT) {
|
||||
static waitUntilElementIsClickable(elementToCheck: ElementFinder, waitTimeout: number = DEFAULT_TIMEOUT) {
|
||||
let isDisplayed = false;
|
||||
return browser.wait(() => {
|
||||
browser.waitForAngularEnabled();
|
||||
@@ -59,20 +59,20 @@ export class BrowserVisibility {
|
||||
}
|
||||
);
|
||||
return isDisplayed;
|
||||
}, waitTimeout, 'Element is not visible ' + elementToCheck.locator());
|
||||
}, waitTimeout, 'Element is not Clickable ' + elementToCheck.locator());
|
||||
}
|
||||
|
||||
/*
|
||||
* Wait for element to not be visible
|
||||
*/
|
||||
static waitUntilElementIsStale(elementToCheck, waitTimeout: number = DEFAULT_TIMEOUT) {
|
||||
static waitUntilElementIsStale(elementToCheck: ElementFinder, waitTimeout: number = DEFAULT_TIMEOUT) {
|
||||
return browser.wait(until.stalenessOf(elementToCheck), waitTimeout, 'Element is not in stale ' + elementToCheck.locator());
|
||||
}
|
||||
|
||||
/*
|
||||
* Wait for element to not be visible
|
||||
*/
|
||||
static waitUntilElementIsNotVisible(elementToCheck, waitTimeout: number = DEFAULT_TIMEOUT) {
|
||||
static waitUntilElementIsNotVisible(elementToCheck: ElementFinder, waitTimeout: number = DEFAULT_TIMEOUT) {
|
||||
let isPresent = false;
|
||||
return browser.wait(() => {
|
||||
browser.waitForAngularEnabled();
|
||||
@@ -89,31 +89,36 @@ export class BrowserVisibility {
|
||||
/*
|
||||
* Wait for element to have value
|
||||
*/
|
||||
static waitUntilElementHasValue(elementToCheck, elementValue, waitTimeout: number = DEFAULT_TIMEOUT) {
|
||||
static waitUntilElementHasValue(elementToCheck: ElementFinder, elementValue, waitTimeout: number = DEFAULT_TIMEOUT) {
|
||||
browser.waitForAngularEnabled();
|
||||
|
||||
browser.wait(until.textToBePresentInElementValue(elementToCheck, elementValue), waitTimeout, 'Element doesn\'t have a value ' + elementToCheck.locator());
|
||||
}
|
||||
|
||||
static waitUntilElementIsOnPage(elementToCheck, waitTimeout: number = DEFAULT_TIMEOUT) {
|
||||
static waitUntilElementIsOnPage(elementToCheck: ElementFinder, waitTimeout: number = DEFAULT_TIMEOUT) {
|
||||
return browser.wait(browser.wait(until.visibilityOf(elementToCheck)), waitTimeout);
|
||||
}
|
||||
|
||||
/*
|
||||
* Wait for element to not be visible
|
||||
*/
|
||||
static waitUntilElementIsNotOnPage(elementToCheck, waitTimeout: number = DEFAULT_TIMEOUT) {
|
||||
static waitUntilElementIsNotOnPage(elementToCheck: ElementFinder, waitTimeout: number = DEFAULT_TIMEOUT) {
|
||||
return browser.wait(until.not(until.visibilityOf(elementToCheck)), waitTimeout, 'Element is not in the page ' + elementToCheck.locator());
|
||||
}
|
||||
|
||||
static waitUntilElementIsPresent(elementToCheck, waitTimeout: number = DEFAULT_TIMEOUT) {
|
||||
static waitUntilElementIsPresent(elementToCheck: ElementFinder, waitTimeout: number = DEFAULT_TIMEOUT) {
|
||||
browser.waitForAngularEnabled();
|
||||
|
||||
return browser.wait(until.presenceOf(elementToCheck), waitTimeout, 'Element is not present ' + elementToCheck.locator());
|
||||
}
|
||||
|
||||
static waitUntilElementIsNotPresent(elementToCheck, waitTimeout: number = DEFAULT_TIMEOUT) {
|
||||
static waitUntilElementIsNotPresent(elementToCheck: ElementFinder, waitTimeout: number = DEFAULT_TIMEOUT) {
|
||||
return browser.wait(until.not(until.presenceOf(elementToCheck)), waitTimeout, 'Element is not in the page ' + elementToCheck.locator());
|
||||
}
|
||||
|
||||
static waitUntilDialogIsClose() {
|
||||
const dialog = element(by.css('mat-dialog-container'));
|
||||
return this.waitUntilElementIsNotPresent(dialog);
|
||||
}
|
||||
|
||||
}
|
||||
|
36
lib/testing/src/lib/core/utils/file-browser.util.ts
Normal file
36
lib/testing/src/lib/core/utils/file-browser.util.ts
Normal file
@@ -0,0 +1,36 @@
|
||||
/*!
|
||||
* @license
|
||||
* Copyright 2019 Alfresco Software, Ltd.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import * as path from 'path';
|
||||
import * as fs from 'fs';
|
||||
import { browser } from 'protractor';
|
||||
|
||||
const DEFAULT_ROOT_PATH = global['TestConfig'].main.rootPath;
|
||||
|
||||
export class FileBrowserUtil {
|
||||
|
||||
static async isFileDownloaded(fileName: string) {
|
||||
browser.driver.wait(() => {
|
||||
return fs.existsSync(path.join(DEFAULT_ROOT_PATH, 'downloads', fileName));
|
||||
}, 30000).then((file) => {
|
||||
expect(file).toBe(true);
|
||||
}, (error) => {
|
||||
throw error;
|
||||
});
|
||||
}
|
||||
|
||||
}
|
@@ -19,7 +19,7 @@ import { browser } from 'protractor';
|
||||
|
||||
export class LocalStorageUtil {
|
||||
|
||||
static async setConfigField(field: string, value: string) {
|
||||
static async setConfigField(field: string, value: string) {
|
||||
await browser.executeScript(
|
||||
'window.adf.setConfigField(`' + field + '`, `' + value + '`);'
|
||||
);
|
||||
@@ -31,6 +31,12 @@ export class LocalStorageUtil {
|
||||
);
|
||||
}
|
||||
|
||||
static async setUserPreference(field: string, value: any) {
|
||||
await browser.executeScript(
|
||||
'window.adf.setUserPreference(`' + field + '`, `' + value + '`);'
|
||||
);
|
||||
}
|
||||
|
||||
static async clearStorage() {
|
||||
await browser.executeScript(
|
||||
'window.adf.clearStorage();'
|
||||
|
@@ -16,6 +16,8 @@
|
||||
*/
|
||||
|
||||
export * from './browser-visibility';
|
||||
export * from './browser-actions';
|
||||
export * from './string.util';
|
||||
export * from './protractor.util';
|
||||
export * from './local-storage.util';
|
||||
export * from './file-browser.util';
|
||||
|
@@ -26,43 +26,68 @@ export class ProcessInstancesService {
|
||||
}
|
||||
|
||||
async createProcessInstance(processDefKey, appName, options?: any) {
|
||||
const path = '/' + appName + '/rb/v1/process-instances';
|
||||
const method = 'POST';
|
||||
try {
|
||||
const path = '/' + appName + '/rb/v1/process-instances';
|
||||
const method = 'POST';
|
||||
|
||||
const queryParams = {}, postBody = {
|
||||
'processDefinitionKey': processDefKey,
|
||||
'payloadType': 'StartProcessPayload',
|
||||
...options
|
||||
};
|
||||
const queryParams = {}, postBody = {
|
||||
'processDefinitionKey': processDefKey,
|
||||
'payloadType': 'StartProcessPayload',
|
||||
...options
|
||||
};
|
||||
|
||||
return await this.api.performBpmOperation(path, method, queryParams, postBody);
|
||||
|
||||
} catch (error) {
|
||||
// tslint:disable-next-line:no-console
|
||||
console.log('create process-instances Service not working');
|
||||
}
|
||||
|
||||
return await this.api.performBpmOperation(path, method, queryParams, postBody);
|
||||
}
|
||||
|
||||
async suspendProcessInstance(processInstanceId, appName) {
|
||||
const path = '/' + appName + '/rb/v1/process-instances/' + processInstanceId + '/suspend';
|
||||
const method = 'POST';
|
||||
try {
|
||||
const path = '/' + appName + '/rb/v1/process-instances/' + processInstanceId + '/suspend';
|
||||
const method = 'POST';
|
||||
|
||||
const queryParams = {}, postBody = {};
|
||||
const queryParams = {}, postBody = {};
|
||||
|
||||
return await this.api.performBpmOperation(path, method, queryParams, postBody);
|
||||
return await this.api.performBpmOperation(path, method, queryParams, postBody);
|
||||
|
||||
} catch (error) {
|
||||
// tslint:disable-next-line:no-console
|
||||
console.log('suspend process-instances Service not working');
|
||||
}
|
||||
}
|
||||
|
||||
async deleteProcessInstance(processInstanceId, appName) {
|
||||
const path = '/' + appName + '/rb/v1/process-instances/' + processInstanceId;
|
||||
const method = 'DELETE';
|
||||
try {
|
||||
const path = '/' + appName + '/rb/v1/process-instances/' + processInstanceId;
|
||||
const method = 'DELETE';
|
||||
|
||||
const queryParams = {}, postBody = {};
|
||||
const queryParams = {}, postBody = {};
|
||||
|
||||
return await this.api.performBpmOperation(path, method, queryParams, postBody);
|
||||
return await this.api.performBpmOperation(path, method, queryParams, postBody);
|
||||
|
||||
} catch (error) {
|
||||
// tslint:disable-next-line:no-console
|
||||
console.log('delete process-instances Service not working');
|
||||
}
|
||||
}
|
||||
|
||||
async completeProcessInstance(processInstanceId, appName) {
|
||||
const path = '/' + appName + '/rb/v1/process-instances/' + processInstanceId + '/complete';
|
||||
try {
|
||||
const path = '/' + appName + '/rb/v1/process-instances/' + processInstanceId + '/complete';
|
||||
|
||||
const method = 'POST';
|
||||
const method = 'POST';
|
||||
|
||||
const queryParams = {}, postBody = {};
|
||||
const queryParams = {}, postBody = {};
|
||||
|
||||
return await this.api.performBpmOperation(path, method, queryParams, postBody);
|
||||
return await this.api.performBpmOperation(path, method, queryParams, postBody);
|
||||
|
||||
} catch (error) {
|
||||
// tslint:disable-next-line:no-console
|
||||
console.log('complete process-instances Service not working');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -17,6 +17,7 @@
|
||||
|
||||
import { element, by } from 'protractor';
|
||||
import { BrowserVisibility } from '../../core/utils/browser-visibility';
|
||||
import { BrowserActions } from '../../core/utils/browser-actions';
|
||||
|
||||
export class AppListCloudPage {
|
||||
|
||||
@@ -27,9 +28,7 @@ export class AppListCloudPage {
|
||||
}
|
||||
|
||||
goToApp(applicationName) {
|
||||
const app = element(by.css('mat-card[title="' + applicationName + '"]'));
|
||||
BrowserVisibility.waitUntilElementIsVisible(app);
|
||||
app.click();
|
||||
BrowserActions.clickExecuteScript('mat-card[title="' + applicationName + '"]');
|
||||
}
|
||||
|
||||
checkAppIsNotDisplayed(applicationName) {
|
||||
|
@@ -17,6 +17,7 @@
|
||||
|
||||
import { by, element, protractor } from 'protractor';
|
||||
import { BrowserVisibility } from '../../../core/utils/browser-visibility';
|
||||
import { BrowserActions } from '../../../core/utils/browser-actions';
|
||||
|
||||
export class EditProcessFilterDialogPage {
|
||||
|
||||
@@ -41,8 +42,7 @@ export class EditProcessFilterDialogPage {
|
||||
|
||||
clickOnCancelButton() {
|
||||
const cancelButton = this.componentElement.element(this.cancelButtonLocator);
|
||||
BrowserVisibility.waitUntilElementIsVisible(cancelButton);
|
||||
cancelButton.click();
|
||||
BrowserActions.click(cancelButton);
|
||||
BrowserVisibility.waitUntilElementIsNotVisible(this.componentElement);
|
||||
return this;
|
||||
}
|
||||
@@ -64,8 +64,7 @@ export class EditProcessFilterDialogPage {
|
||||
}
|
||||
|
||||
clearFilterName() {
|
||||
BrowserVisibility.waitUntilElementIsVisible(this.filterNameInput);
|
||||
this.filterNameInput.click();
|
||||
BrowserActions.click(this.filterNameInput);
|
||||
this.filterNameInput.getAttribute('value').then((value) => {
|
||||
for (let i = value.length; i >= 0; i--) {
|
||||
this.filterNameInput.sendKeys(protractor.Key.BACK_SPACE);
|
||||
@@ -75,8 +74,7 @@ export class EditProcessFilterDialogPage {
|
||||
}
|
||||
|
||||
getTitle() {
|
||||
BrowserVisibility.waitUntilElementIsVisible(this.title);
|
||||
return this.title.getText();
|
||||
return BrowserActions.getText(this.title);
|
||||
}
|
||||
|
||||
}
|
||||
|
@@ -17,6 +17,7 @@
|
||||
|
||||
import { by, element, protractor } from 'protractor';
|
||||
import { BrowserVisibility } from '../../../core/utils/browser-visibility';
|
||||
import { BrowserActions } from '../../../core/utils/browser-actions';
|
||||
|
||||
export class EditTaskFilterDialogPage {
|
||||
|
||||
@@ -28,8 +29,7 @@ export class EditTaskFilterDialogPage {
|
||||
|
||||
clickOnSaveButton() {
|
||||
const saveButton = this.componentElement.element(this.saveButtonLocator);
|
||||
BrowserVisibility.waitUntilElementIsVisible(saveButton);
|
||||
saveButton.click();
|
||||
BrowserActions.click(saveButton);
|
||||
BrowserVisibility.waitUntilElementIsNotVisible(this.componentElement);
|
||||
return this;
|
||||
}
|
||||
@@ -41,8 +41,7 @@ export class EditTaskFilterDialogPage {
|
||||
|
||||
clickOnCancelButton() {
|
||||
const cancelButton = this.componentElement.element(this.cancelButtonLocator);
|
||||
BrowserVisibility.waitUntilElementIsVisible(cancelButton);
|
||||
cancelButton.click();
|
||||
BrowserActions.click(cancelButton);
|
||||
BrowserVisibility.waitUntilElementIsNotVisible(this.componentElement);
|
||||
return this;
|
||||
}
|
||||
@@ -64,8 +63,7 @@ export class EditTaskFilterDialogPage {
|
||||
}
|
||||
|
||||
clearFilterName() {
|
||||
BrowserVisibility.waitUntilElementIsVisible(this.filterNameInput);
|
||||
this.filterNameInput.click();
|
||||
BrowserActions.click(this.filterNameInput);
|
||||
this.filterNameInput.getAttribute('value').then((value) => {
|
||||
for (let i = value.length; i >= 0; i--) {
|
||||
this.filterNameInput.sendKeys(protractor.Key.BACK_SPACE);
|
||||
@@ -75,8 +73,7 @@ export class EditTaskFilterDialogPage {
|
||||
}
|
||||
|
||||
getTitle() {
|
||||
BrowserVisibility.waitUntilElementIsVisible(this.title);
|
||||
return this.title.getText();
|
||||
return BrowserActions.getText(this.title);
|
||||
}
|
||||
|
||||
}
|
||||
|
@@ -17,6 +17,7 @@
|
||||
import { by, element, protractor } from 'protractor';
|
||||
import { EditProcessFilterDialogPage } from './dialog/edit-process-filter-dialog.page';
|
||||
import { BrowserVisibility } from '../../core/utils/browser-visibility';
|
||||
import { BrowserActions } from '../../core/utils/browser-actions';
|
||||
|
||||
export class EditProcessFilterCloudComponentPage {
|
||||
|
||||
@@ -33,8 +34,7 @@ export class EditProcessFilterCloudComponentPage {
|
||||
}
|
||||
|
||||
clickCustomiseFilterHeader() {
|
||||
BrowserVisibility.waitUntilElementIsVisible(this.customiseFilter);
|
||||
this.customiseFilter.click();
|
||||
BrowserActions.click(this.customiseFilter);
|
||||
return this;
|
||||
}
|
||||
|
||||
@@ -50,51 +50,43 @@ export class EditProcessFilterCloudComponentPage {
|
||||
this.clickOnDropDownArrow('status');
|
||||
|
||||
const statusElement = element.all(by.cssContainingText('mat-option span', option)).first();
|
||||
BrowserVisibility.waitUntilElementIsClickable(statusElement);
|
||||
BrowserVisibility.waitUntilElementIsVisible(statusElement);
|
||||
statusElement.click();
|
||||
BrowserActions.click(statusElement);
|
||||
return this;
|
||||
}
|
||||
|
||||
getStateFilterDropDownValue() {
|
||||
return element(by.css("mat-form-field[data-automation-id='status'] span")).getText();
|
||||
return BrowserActions.getText(element(by.css("mat-form-field[data-automation-id='status'] span")));
|
||||
}
|
||||
|
||||
setSortFilterDropDown(option) {
|
||||
this.clickOnDropDownArrow('sort');
|
||||
|
||||
const sortElement = element.all(by.cssContainingText('mat-option span', option)).first();
|
||||
BrowserVisibility.waitUntilElementIsClickable(sortElement);
|
||||
BrowserVisibility.waitUntilElementIsVisible(sortElement);
|
||||
sortElement.click();
|
||||
BrowserActions.click(sortElement);
|
||||
return this;
|
||||
}
|
||||
|
||||
getSortFilterDropDownValue() {
|
||||
const sortLocator = element.all(by.css("mat-form-field[data-automation-id='sort'] span")).first();
|
||||
BrowserVisibility.waitUntilElementIsVisible(sortLocator);
|
||||
return sortLocator.getText();
|
||||
return BrowserActions.getText(sortLocator);
|
||||
}
|
||||
|
||||
setOrderFilterDropDown(option) {
|
||||
this.clickOnDropDownArrow('order');
|
||||
|
||||
const orderElement = element.all(by.cssContainingText('mat-option span', option)).first();
|
||||
BrowserVisibility.waitUntilElementIsClickable(orderElement);
|
||||
BrowserVisibility.waitUntilElementIsVisible(orderElement);
|
||||
orderElement.click();
|
||||
BrowserActions.click(orderElement);
|
||||
return this;
|
||||
}
|
||||
|
||||
getOrderFilterDropDownValue() {
|
||||
return element(by.css("mat-form-field[data-automation-id='order'] span")).getText();
|
||||
return BrowserActions.getText(element(by.css("mat-form-field[data-automation-id='order'] span")));
|
||||
}
|
||||
|
||||
clickOnDropDownArrow(option) {
|
||||
const dropDownArrow = element.all(by.css("mat-form-field[data-automation-id='" + option + "'] div[class='mat-select-arrow-wrapper']")).first();
|
||||
BrowserVisibility.waitUntilElementIsVisible(dropDownArrow);
|
||||
BrowserVisibility.waitUntilElementIsClickable(dropDownArrow);
|
||||
dropDownArrow.click();
|
||||
BrowserActions.click(dropDownArrow);
|
||||
BrowserVisibility.waitUntilElementIsVisible(this.selectedOption);
|
||||
}
|
||||
|
||||
|
@@ -18,6 +18,7 @@
|
||||
import { by, element, protractor } from 'protractor';
|
||||
import { EditTaskFilterDialogPage } from './dialog/edit-task-filter-dialog.page';
|
||||
import { BrowserVisibility } from '../../core/utils/browser-visibility';
|
||||
import { BrowserActions } from '../../core/utils/browser-actions';
|
||||
|
||||
export class EditTaskFilterCloudComponentPage {
|
||||
|
||||
@@ -44,8 +45,7 @@ export class EditTaskFilterCloudComponentPage {
|
||||
}
|
||||
|
||||
clickCustomiseFilterHeader() {
|
||||
BrowserVisibility.waitUntilElementIsVisible(this.customiseFilter);
|
||||
this.customiseFilter.click();
|
||||
BrowserActions.click(this.customiseFilter);
|
||||
return this;
|
||||
}
|
||||
|
||||
@@ -53,9 +53,7 @@ export class EditTaskFilterCloudComponentPage {
|
||||
this.clickOnDropDownArrow('status');
|
||||
|
||||
const statusElement = element.all(by.cssContainingText('mat-option span', option)).first();
|
||||
BrowserVisibility.waitUntilElementIsVisible(statusElement);
|
||||
BrowserVisibility.waitUntilElementIsClickable(statusElement);
|
||||
statusElement.click();
|
||||
BrowserActions.click(statusElement);
|
||||
return this;
|
||||
}
|
||||
|
||||
@@ -67,25 +65,20 @@ export class EditTaskFilterCloudComponentPage {
|
||||
this.clickOnDropDownArrow('sort');
|
||||
|
||||
const sortElement = element.all(by.cssContainingText('mat-option span', option)).first();
|
||||
BrowserVisibility.waitUntilElementIsClickable(sortElement);
|
||||
BrowserVisibility.waitUntilElementIsVisible(sortElement);
|
||||
sortElement.click();
|
||||
BrowserActions.click(sortElement);
|
||||
return this;
|
||||
}
|
||||
|
||||
getSortFilterDropDownValue() {
|
||||
const elementSort = element.all(by.css("mat-select[data-automation-id='adf-cloud-edit-task-property-sort'] span")).first();
|
||||
BrowserVisibility.waitUntilElementIsVisible(elementSort);
|
||||
return elementSort.getText();
|
||||
return BrowserActions.getText(elementSort);
|
||||
}
|
||||
|
||||
setOrderFilterDropDown(option) {
|
||||
this.clickOnDropDownArrow('order');
|
||||
|
||||
const orderElement = element.all(by.cssContainingText('mat-option span', option)).first();
|
||||
BrowserVisibility.waitUntilElementIsClickable(orderElement);
|
||||
BrowserVisibility.waitUntilElementIsVisible(orderElement);
|
||||
orderElement.click();
|
||||
BrowserActions.click(orderElement);
|
||||
return this;
|
||||
}
|
||||
|
||||
@@ -105,7 +98,7 @@ export class EditTaskFilterCloudComponentPage {
|
||||
}
|
||||
|
||||
getAssignee() {
|
||||
return this.assignee.getText();
|
||||
return BrowserActions.getText(this.assignee);
|
||||
}
|
||||
|
||||
setPriority(option) {
|
||||
@@ -113,7 +106,7 @@ export class EditTaskFilterCloudComponentPage {
|
||||
}
|
||||
|
||||
getPriority() {
|
||||
return this.priority.getText();
|
||||
return BrowserActions.getText(this.priority);
|
||||
}
|
||||
|
||||
setParentTaskId(option) {
|
||||
@@ -121,7 +114,7 @@ export class EditTaskFilterCloudComponentPage {
|
||||
}
|
||||
|
||||
getParentTaskId() {
|
||||
return this.parentTaskId.getText();
|
||||
return BrowserActions.getText(this.parentTaskId);
|
||||
}
|
||||
|
||||
setOwner(option) {
|
||||
@@ -129,7 +122,7 @@ export class EditTaskFilterCloudComponentPage {
|
||||
}
|
||||
|
||||
getOwner() {
|
||||
return this.owner.getText();
|
||||
return BrowserActions.getText(this.owner);
|
||||
}
|
||||
|
||||
setLastModifiedFrom(option) {
|
||||
@@ -138,7 +131,7 @@ export class EditTaskFilterCloudComponentPage {
|
||||
}
|
||||
|
||||
getLastModifiedFrom() {
|
||||
return this.lastModifiedFrom.getText();
|
||||
return BrowserActions.getText(this.lastModifiedFrom);
|
||||
}
|
||||
|
||||
setLastModifiedTo(option) {
|
||||
@@ -147,7 +140,7 @@ export class EditTaskFilterCloudComponentPage {
|
||||
}
|
||||
|
||||
getLastModifiedTo() {
|
||||
return this.lastModifiedTo.getText();
|
||||
return BrowserActions.getText(this.lastModifiedTo);
|
||||
}
|
||||
|
||||
checkSaveButtonIsDisplayed() {
|
||||
@@ -182,22 +175,18 @@ export class EditTaskFilterCloudComponentPage {
|
||||
|
||||
clickSaveAsButton() {
|
||||
const disabledButton = element(by.css(("button[data-automation-id='adf-filter-action-saveAs'][disabled]")));
|
||||
BrowserVisibility.waitUntilElementIsClickable(this.saveAsButton);
|
||||
BrowserVisibility.waitUntilElementIsVisible(this.saveAsButton);
|
||||
BrowserVisibility.waitUntilElementIsNotVisible(disabledButton);
|
||||
this.saveAsButton.click();
|
||||
BrowserActions.click(this.saveAsButton);
|
||||
return this.editTaskFilterDialogPage;
|
||||
}
|
||||
|
||||
clickDeleteButton() {
|
||||
BrowserVisibility.waitUntilElementIsVisible(this.deleteButton);
|
||||
this.deleteButton.click();
|
||||
BrowserActions.click(this.deleteButton);
|
||||
return this;
|
||||
}
|
||||
|
||||
clickSaveButton() {
|
||||
BrowserVisibility.waitUntilElementIsVisible(this.saveButton);
|
||||
this.saveButton.click();
|
||||
BrowserActions.click(this.saveButton);
|
||||
return this;
|
||||
}
|
||||
|
||||
@@ -207,28 +196,20 @@ export class EditTaskFilterCloudComponentPage {
|
||||
}
|
||||
|
||||
clearField(locator) {
|
||||
BrowserVisibility.waitUntilElementIsVisible(locator);
|
||||
locator.getAttribute('value').then((result) => {
|
||||
for (let i = result.length; i >= 0; i--) {
|
||||
locator.sendKeys(protractor.Key.BACK_SPACE);
|
||||
}
|
||||
});
|
||||
BrowserActions.clearSendKeys(locator, '');
|
||||
}
|
||||
|
||||
setAppNameDropDown(option) {
|
||||
this.clickOnDropDownArrow('appName');
|
||||
|
||||
const appNameElement = element.all(by.cssContainingText('mat-option span', option)).first();
|
||||
BrowserVisibility.waitUntilElementIsClickable(appNameElement);
|
||||
BrowserVisibility.waitUntilElementIsVisible(appNameElement);
|
||||
appNameElement.click();
|
||||
BrowserActions.click(appNameElement);
|
||||
return this;
|
||||
}
|
||||
|
||||
getAppNameDropDownValue() {
|
||||
const locator = element.all(by.css("mat-select[data-automation-id='adf-cloud-edit-task-property-appName'] span")).first();
|
||||
BrowserVisibility.waitUntilElementIsVisible(locator);
|
||||
return locator.getText();
|
||||
return BrowserActions.getText(locator);
|
||||
}
|
||||
|
||||
setId(option) {
|
||||
|
@@ -17,6 +17,7 @@
|
||||
|
||||
import { browser, by, element, protractor } from 'protractor';
|
||||
import { BrowserVisibility } from '../../core/utils/browser-visibility';
|
||||
import { BrowserActions } from '../../core/utils/browser-actions';
|
||||
|
||||
export class GroupCloudComponentPage {
|
||||
|
||||
@@ -53,9 +54,8 @@ export class GroupCloudComponentPage {
|
||||
|
||||
selectGroupFromList(name) {
|
||||
const groupRow = element.all(by.cssContainingText('mat-option span', name)).first();
|
||||
BrowserVisibility.waitUntilElementIsVisible(groupRow);
|
||||
browser.sleep(1000);
|
||||
groupRow.click();
|
||||
BrowserActions.click(groupRow);
|
||||
BrowserVisibility.waitUntilElementIsNotVisible(groupRow);
|
||||
return this;
|
||||
}
|
||||
|
@@ -17,6 +17,7 @@
|
||||
|
||||
import { browser, by, element, protractor } from 'protractor';
|
||||
import { BrowserVisibility } from '../../core/utils/browser-visibility';
|
||||
import { BrowserActions } from '../../core/utils/browser-actions';
|
||||
|
||||
export class PeopleCloudComponentPage {
|
||||
|
||||
@@ -25,8 +26,7 @@ export class PeopleCloudComponentPage {
|
||||
|
||||
searchAssigneeAndSelect(name) {
|
||||
BrowserVisibility.waitUntilElementIsVisible(this.peopleCloudSearch);
|
||||
this.peopleCloudSearch.clear();
|
||||
this.peopleCloudSearch.sendKeys(name);
|
||||
BrowserActions.clearSendKeys(this.peopleCloudSearch, name),
|
||||
this.selectAssigneeFromList(name);
|
||||
return this;
|
||||
}
|
||||
@@ -35,13 +35,7 @@ export class PeopleCloudComponentPage {
|
||||
BrowserVisibility.waitUntilElementIsVisible(this.peopleCloudSearch);
|
||||
BrowserVisibility.waitUntilElementIsClickable(this.peopleCloudSearch);
|
||||
browser.sleep(1000);
|
||||
this.peopleCloudSearch.clear().then(() => {
|
||||
for (let i = 0; i < name.length; i++) {
|
||||
this.peopleCloudSearch.sendKeys(name[i]);
|
||||
}
|
||||
this.peopleCloudSearch.sendKeys(protractor.Key.BACK_SPACE);
|
||||
this.peopleCloudSearch.sendKeys(name[name.length - 1]);
|
||||
});
|
||||
BrowserActions.clearSendKeys(this.peopleCloudSearch, name);
|
||||
return this;
|
||||
}
|
||||
|
||||
@@ -58,7 +52,7 @@ export class PeopleCloudComponentPage {
|
||||
selectAssigneeFromList(name) {
|
||||
const assigneeRow = element(by.cssContainingText('mat-option span.adf-people-label-name', name));
|
||||
BrowserVisibility.waitUntilElementIsVisible(assigneeRow);
|
||||
browser.sleep(1000);
|
||||
browser.sleep(2000);
|
||||
assigneeRow.click();
|
||||
BrowserVisibility.waitUntilElementIsNotVisible(assigneeRow);
|
||||
return this;
|
||||
|
@@ -17,6 +17,7 @@
|
||||
|
||||
import { by } from 'protractor';
|
||||
import { BrowserVisibility } from '../../core/utils/browser-visibility';
|
||||
import { BrowserActions } from '../../core/utils/browser-actions';
|
||||
|
||||
export class ProcessFiltersCloudComponentPage {
|
||||
|
||||
@@ -45,9 +46,8 @@ export class ProcessFiltersCloudComponentPage {
|
||||
}
|
||||
|
||||
clickProcessFilter() {
|
||||
BrowserVisibility.waitUntilElementIsVisible(this.filter);
|
||||
BrowserVisibility.waitUntilElementIsClickable(this.filter);
|
||||
return this.filter.click();
|
||||
return BrowserActions.click(this.filter);
|
||||
|
||||
}
|
||||
|
||||
checkProcessFilterNotDisplayed() {
|
||||
|
@@ -16,7 +16,7 @@
|
||||
*/
|
||||
|
||||
import { element, by } from 'protractor';
|
||||
import { BrowserVisibility } from '../../core/utils/browser-visibility';
|
||||
import { BrowserActions } from '../../core/utils/browser-actions';
|
||||
|
||||
export class ProcessHeaderCloudPage {
|
||||
|
||||
@@ -30,43 +30,35 @@ export class ProcessHeaderCloudPage {
|
||||
businessKeyField = element.all(by.css('span[data-automation-id*="businessKey"] span')).first();
|
||||
|
||||
getId() {
|
||||
BrowserVisibility.waitUntilElementIsVisible(this.idField);
|
||||
return this.idField.getText();
|
||||
return BrowserActions.getText(this.idField);
|
||||
}
|
||||
|
||||
getName() {
|
||||
BrowserVisibility.waitUntilElementIsVisible(this.nameField);
|
||||
return this.nameField.getText();
|
||||
return BrowserActions.getText(this.nameField);
|
||||
}
|
||||
|
||||
getStatus() {
|
||||
BrowserVisibility.waitUntilElementIsVisible(this.statusField);
|
||||
return this.statusField.getText();
|
||||
return BrowserActions.getText(this.statusField);
|
||||
}
|
||||
|
||||
getInitiator() {
|
||||
BrowserVisibility.waitUntilElementIsVisible(this.initiatorField);
|
||||
return this.initiatorField.getText();
|
||||
return BrowserActions.getText(this.initiatorField);
|
||||
}
|
||||
|
||||
getStartDate() {
|
||||
BrowserVisibility.waitUntilElementIsVisible(this.startDateField);
|
||||
return this.startDateField.getText();
|
||||
return BrowserActions.getText(this.startDateField);
|
||||
}
|
||||
|
||||
getLastModified() {
|
||||
BrowserVisibility.waitUntilElementIsVisible(this.lastModifiedField);
|
||||
return this.lastModifiedField.getText();
|
||||
return BrowserActions.getText(this.lastModifiedField);
|
||||
}
|
||||
|
||||
getParentId() {
|
||||
BrowserVisibility.waitUntilElementIsVisible(this.parentIdField);
|
||||
return this.parentIdField.getText();
|
||||
return BrowserActions.getText(this.parentIdField);
|
||||
}
|
||||
|
||||
getBusinessKey() {
|
||||
BrowserVisibility.waitUntilElementIsVisible(this.businessKeyField);
|
||||
return this.businessKeyField.getText();
|
||||
return BrowserActions.getText(this.businessKeyField);
|
||||
}
|
||||
|
||||
}
|
||||
|
@@ -18,6 +18,7 @@
|
||||
import { BrowserVisibility } from '../../core/utils/browser-visibility';
|
||||
import { DataTableComponentPage } from '../../core/pages/data-table-component.page';
|
||||
import { element, by } from 'protractor';
|
||||
import { BrowserActions } from '../../core/utils/browser-actions';
|
||||
|
||||
export class ProcessListCloudComponentPage {
|
||||
|
||||
@@ -89,8 +90,7 @@ export class ProcessListCloudComponentPage {
|
||||
}
|
||||
|
||||
getNoProcessFoundMessage() {
|
||||
BrowserVisibility.waitUntilElementIsVisible(this.noProcessFound);
|
||||
return this.noProcessFound.getText();
|
||||
return BrowserActions.getText(this.noProcessFound);
|
||||
}
|
||||
|
||||
getAllRowsByColumn(column) {
|
||||
|
@@ -17,6 +17,7 @@
|
||||
|
||||
import { by, element, Key, protractor, browser } from 'protractor';
|
||||
import { BrowserVisibility } from '../../core/utils/browser-visibility';
|
||||
import { BrowserActions } from '../../core/utils/browser-actions';
|
||||
|
||||
export class StartProcessCloudPage {
|
||||
|
||||
@@ -60,9 +61,7 @@ export class StartProcessCloudPage {
|
||||
}
|
||||
|
||||
clickProcessDropdownArrow() {
|
||||
BrowserVisibility.waitUntilElementIsVisible(this.selectProcessDropdownArrow);
|
||||
BrowserVisibility.waitUntilElementIsClickable(this.selectProcessDropdownArrow);
|
||||
this.selectProcessDropdownArrow.click();
|
||||
BrowserActions.click(this.selectProcessDropdownArrow);
|
||||
}
|
||||
|
||||
checkOptionIsDisplayed(name) {
|
||||
@@ -74,15 +73,12 @@ export class StartProcessCloudPage {
|
||||
|
||||
selectOption(name) {
|
||||
const selectProcessDropdown = element(by.cssContainingText('.mat-option-text', name));
|
||||
BrowserVisibility.waitUntilElementIsVisible(selectProcessDropdown);
|
||||
BrowserVisibility.waitUntilElementIsClickable(selectProcessDropdown);
|
||||
selectProcessDropdown.click();
|
||||
BrowserActions.click(selectProcessDropdown);
|
||||
return this;
|
||||
}
|
||||
|
||||
clickCancelProcessButton() {
|
||||
BrowserVisibility.waitUntilElementIsVisible(this.cancelProcessButton);
|
||||
this.cancelProcessButton.click();
|
||||
BrowserActions.click(this.cancelProcessButton);
|
||||
}
|
||||
|
||||
checkStartProcessButtonIsEnabled() {
|
||||
@@ -95,8 +91,7 @@ export class StartProcessCloudPage {
|
||||
}
|
||||
|
||||
clickStartProcessButton() {
|
||||
BrowserVisibility.waitUntilElementIsClickable(this.startProcessButton);
|
||||
return this.startProcessButton.click();
|
||||
return BrowserActions.click(this.startProcessButton);
|
||||
}
|
||||
|
||||
checkValidationErrorIsDisplayed(error, elementRef = 'mat-error') {
|
||||
|
@@ -15,8 +15,9 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { element, by, Key, protractor } from 'protractor';
|
||||
import { element, by, Key } from 'protractor';
|
||||
import { BrowserVisibility } from '../../core/utils/browser-visibility';
|
||||
import { BrowserActions } from '../../core/utils/browser-actions';
|
||||
|
||||
export class StartTasksCloudPage {
|
||||
|
||||
@@ -35,21 +36,17 @@ export class StartTasksCloudPage {
|
||||
}
|
||||
|
||||
addName(userName) {
|
||||
BrowserVisibility.waitUntilElementIsVisible(this.name);
|
||||
this.name.clear();
|
||||
this.name.sendKeys(userName);
|
||||
BrowserActions.clearSendKeys(this.name, userName);
|
||||
return this;
|
||||
}
|
||||
|
||||
addDescription(userDescription) {
|
||||
BrowserVisibility.waitUntilElementIsVisible(this.description);
|
||||
this.description.sendKeys(userDescription);
|
||||
BrowserActions.clearSendKeys(this.description, userDescription);
|
||||
return this;
|
||||
}
|
||||
|
||||
addPriority(userPriority) {
|
||||
BrowserVisibility.waitUntilElementIsVisible(this.priority);
|
||||
this.priority.sendKeys(userPriority);
|
||||
BrowserActions.clearSendKeys(this.priority, userPriority);
|
||||
return this;
|
||||
}
|
||||
|
||||
@@ -61,9 +58,7 @@ export class StartTasksCloudPage {
|
||||
}
|
||||
|
||||
clickStartButton() {
|
||||
BrowserVisibility.waitUntilElementIsVisible(this.startButton);
|
||||
BrowserVisibility.waitUntilElementIsClickable(this.startButton);
|
||||
return this.startButton.click();
|
||||
return BrowserActions.click(this.startButton);
|
||||
}
|
||||
|
||||
checkStartButtonIsEnabled() {
|
||||
@@ -72,17 +67,17 @@ export class StartTasksCloudPage {
|
||||
}
|
||||
|
||||
checkStartButtonIsDisabled() {
|
||||
BrowserVisibility.waitUntilElementIsVisible(this.startButton.getAttribute('disabled'));
|
||||
BrowserVisibility.waitUntilElementIsVisible(element(by.css('button[id="button-start"]:disabled')));
|
||||
return this;
|
||||
}
|
||||
|
||||
clickCancelButton() {
|
||||
BrowserVisibility.waitUntilElementIsVisible(this.cancelButton);
|
||||
BrowserVisibility.waitUntilElementIsClickable(this.cancelButton);
|
||||
return this.cancelButton.click();
|
||||
return BrowserActions.click(this.cancelButton);
|
||||
}
|
||||
|
||||
blur(locator) {
|
||||
BrowserVisibility.waitUntilElementIsVisible(locator);
|
||||
BrowserVisibility.waitUntilElementIsClickable(locator);
|
||||
locator.click();
|
||||
locator.sendKeys(Key.TAB);
|
||||
return this;
|
||||
@@ -105,12 +100,6 @@ export class StartTasksCloudPage {
|
||||
}
|
||||
|
||||
clearField(locator) {
|
||||
BrowserVisibility.waitUntilElementIsVisible(locator);
|
||||
BrowserVisibility.waitUntilElementIsClickable(locator);
|
||||
locator.getAttribute('value').then((result) => {
|
||||
for (let i = result.length; i >= 0; i--) {
|
||||
locator.sendKeys(protractor.Key.BACK_SPACE);
|
||||
}
|
||||
});
|
||||
BrowserActions.clearSendKeys(locator, '');
|
||||
}
|
||||
}
|
||||
|
@@ -17,6 +17,7 @@
|
||||
|
||||
import { by } from 'protractor';
|
||||
import { BrowserVisibility } from '../../core/utils/browser-visibility';
|
||||
import { BrowserActions } from '../../core/utils/browser-actions';
|
||||
|
||||
export class TaskFiltersCloudComponentPage {
|
||||
|
||||
@@ -35,8 +36,7 @@ export class TaskFiltersCloudComponentPage {
|
||||
getTaskFilterIcon() {
|
||||
BrowserVisibility.waitUntilElementIsVisible(this.filter);
|
||||
const icon = this.filter.element(this.taskIcon);
|
||||
BrowserVisibility.waitUntilElementIsVisible(icon);
|
||||
return icon.getText();
|
||||
return BrowserActions.getText(icon);
|
||||
}
|
||||
|
||||
checkTaskFilterHasNoIcon() {
|
||||
@@ -45,8 +45,7 @@ export class TaskFiltersCloudComponentPage {
|
||||
}
|
||||
|
||||
clickTaskFilter() {
|
||||
BrowserVisibility.waitUntilElementIsVisible(this.filter);
|
||||
return this.filter.click();
|
||||
return BrowserActions.click(this.filter);
|
||||
}
|
||||
|
||||
checkTaskFilterNotDisplayed() {
|
||||
|
@@ -17,6 +17,7 @@
|
||||
|
||||
import { element, by } from 'protractor';
|
||||
import { BrowserVisibility } from '../../core/utils/browser-visibility';
|
||||
import { BrowserActions } from '../../core/utils/browser-actions';
|
||||
|
||||
export class TaskFormCloudComponent {
|
||||
|
||||
@@ -34,14 +35,12 @@ export class TaskFormCloudComponent {
|
||||
}
|
||||
|
||||
clickCompleteButton() {
|
||||
BrowserVisibility.waitUntilElementIsVisible(this.completeButton);
|
||||
this.completeButton.click();
|
||||
BrowserActions.click(this.completeButton);
|
||||
return this;
|
||||
}
|
||||
|
||||
clickCancelButton() {
|
||||
BrowserVisibility.waitUntilElementIsVisible(this.cancelButton);
|
||||
this.cancelButton.click();
|
||||
BrowserActions.click(this.cancelButton);
|
||||
return this;
|
||||
}
|
||||
|
||||
|
@@ -16,7 +16,7 @@
|
||||
*/
|
||||
|
||||
import { element, by } from 'protractor';
|
||||
import { BrowserVisibility } from '../../core/utils/browser-visibility';
|
||||
import { BrowserActions } from '../../core/utils/browser-actions';
|
||||
|
||||
export class TaskHeaderCloudPage {
|
||||
|
||||
@@ -34,58 +34,47 @@ export class TaskHeaderCloudPage {
|
||||
taskPropertyList = element(by.css('adf-cloud-task-header adf-card-view div[class="adf-property-list"]'));
|
||||
|
||||
getAssignee() {
|
||||
BrowserVisibility.waitUntilElementIsVisible(this.assigneeField);
|
||||
return this.assigneeField.getText();
|
||||
return BrowserActions.getText(this.assigneeField);
|
||||
}
|
||||
|
||||
getStatus() {
|
||||
BrowserVisibility.waitUntilElementIsVisible(this.statusField);
|
||||
return this.statusField.getText();
|
||||
return BrowserActions.getText(this.statusField);
|
||||
}
|
||||
|
||||
getPriority() {
|
||||
BrowserVisibility.waitUntilElementIsVisible(this.priorityField);
|
||||
return this.priorityField.getText();
|
||||
return BrowserActions.getText(this.priorityField);
|
||||
}
|
||||
|
||||
getCategory() {
|
||||
BrowserVisibility.waitUntilElementIsVisible(this.categoryField);
|
||||
return this.categoryField.getText();
|
||||
return BrowserActions.getText(this.categoryField);
|
||||
}
|
||||
|
||||
getParentName() {
|
||||
BrowserVisibility.waitUntilElementIsVisible(this.parentNameField);
|
||||
return this.parentNameField.getText();
|
||||
return BrowserActions.getText(this.parentNameField);
|
||||
}
|
||||
|
||||
getParentTaskId() {
|
||||
BrowserVisibility.waitUntilElementIsVisible(this.parentTaskIdField);
|
||||
return this.parentTaskIdField.getText();
|
||||
return BrowserActions.getText(this.parentTaskIdField);
|
||||
}
|
||||
|
||||
getEndDate() {
|
||||
BrowserVisibility.waitUntilElementIsVisible(this.endDateField);
|
||||
return this.endDateField.getText();
|
||||
return BrowserActions.getText(this.endDateField);
|
||||
}
|
||||
|
||||
getCreated() {
|
||||
BrowserVisibility.waitUntilElementIsVisible(this.createdField);
|
||||
return this.createdField.getText();
|
||||
return BrowserActions.getText(this.createdField);
|
||||
}
|
||||
|
||||
getId() {
|
||||
BrowserVisibility.waitUntilElementIsVisible(this.idField);
|
||||
return this.idField.getText();
|
||||
return BrowserActions.getText(this.idField);
|
||||
}
|
||||
|
||||
getDescription() {
|
||||
BrowserVisibility.waitUntilElementIsVisible(this.descriptionField);
|
||||
return this.descriptionField.getText();
|
||||
return BrowserActions.getText(this.descriptionField);
|
||||
}
|
||||
|
||||
getDueDate() {
|
||||
BrowserVisibility.waitUntilElementIsVisible(this.dueDateField);
|
||||
return this.dueDateField.getText();
|
||||
return BrowserActions.getText(this.dueDateField);
|
||||
}
|
||||
|
||||
}
|
||||
|
@@ -18,6 +18,7 @@
|
||||
import { BrowserVisibility } from '../../core/utils/browser-visibility';
|
||||
import { DataTableComponentPage } from '../../core/pages/data-table-component.page';
|
||||
import { element, by } from 'protractor';
|
||||
import { BrowserActions } from '../../core/utils/browser-actions';
|
||||
|
||||
const column = {
|
||||
id: 'Id',
|
||||
@@ -104,8 +105,7 @@ export class TaskListCloudComponentPage {
|
||||
}
|
||||
|
||||
getNoTasksFoundMessage() {
|
||||
BrowserVisibility.waitUntilElementIsVisible(this.noTasksFound);
|
||||
return this.noTasksFound.getText();
|
||||
return BrowserActions.getText(this.noTasksFound);
|
||||
}
|
||||
|
||||
getAllRowsNameColumn() {
|
||||
@@ -146,8 +146,7 @@ export class TaskListCloudComponentPage {
|
||||
|
||||
getIdCellValue(rowName) {
|
||||
const locator = new DataTableComponentPage().getCellByRowContentAndColumn(column.name, rowName, column.id);
|
||||
BrowserVisibility.waitUntilElementIsVisible(locator);
|
||||
return locator.getText();
|
||||
return BrowserActions.getText(locator);
|
||||
}
|
||||
|
||||
}
|
||||
|
@@ -17,6 +17,7 @@
|
||||
|
||||
import { BrowserVisibility } from '../../core/utils/browser-visibility';
|
||||
import { by, element } from 'protractor';
|
||||
import { BrowserActions } from '../../core/utils/browser-actions';
|
||||
|
||||
export class FormFieldsPage {
|
||||
|
||||
@@ -64,25 +65,23 @@ export class FormFieldsPage {
|
||||
|
||||
getFieldLabel(fieldId, labelLocatorParam) {
|
||||
const label = this.getWidget(fieldId).all(labelLocatorParam || this.labelLocator).first();
|
||||
BrowserVisibility.waitUntilElementIsVisible(label);
|
||||
return label.getText();
|
||||
return BrowserActions.getText(label);
|
||||
}
|
||||
|
||||
getFieldErrorMessage(fieldId) {
|
||||
const error = this.getWidget(fieldId).element(this.errorMessage);
|
||||
return error.getText();
|
||||
return BrowserActions.getText(error);
|
||||
}
|
||||
|
||||
getFieldText(fieldId, labelLocatorParam) {
|
||||
const label = this.getWidget(fieldId).element(labelLocatorParam || this.labelLocator);
|
||||
BrowserVisibility.waitUntilElementIsVisible(label);
|
||||
return label.getText();
|
||||
return BrowserActions.getText(label);
|
||||
}
|
||||
|
||||
getFieldPlaceHolder(fieldId, locator = 'input') {
|
||||
const placeHolderLocator = element(by.css(`${locator}#${fieldId}`)).getAttribute('placeholder');
|
||||
const placeHolderLocator = element(by.css(`${locator}#${fieldId}`));
|
||||
BrowserVisibility.waitUntilElementIsVisible(placeHolderLocator);
|
||||
return placeHolderLocator;
|
||||
return placeHolderLocator.getAttribute('placeholder');
|
||||
}
|
||||
|
||||
checkFieldValue(locator, field, val) {
|
||||
@@ -91,15 +90,12 @@ export class FormFieldsPage {
|
||||
}
|
||||
|
||||
refreshForm() {
|
||||
BrowserVisibility.waitUntilElementIsVisible(this.refreshButton);
|
||||
this.refreshButton.click();
|
||||
BrowserActions.click(this.refreshButton);
|
||||
return this;
|
||||
}
|
||||
|
||||
saveForm() {
|
||||
BrowserVisibility.waitUntilElementIsVisible(this.saveButton);
|
||||
BrowserVisibility.waitUntilElementIsClickable(this.saveButton);
|
||||
this.saveButton.click();
|
||||
BrowserActions.click(this.saveButton);
|
||||
return this;
|
||||
}
|
||||
|
||||
@@ -114,24 +110,20 @@ export class FormFieldsPage {
|
||||
}
|
||||
|
||||
getNoFormMessage() {
|
||||
BrowserVisibility.waitUntilElementIsVisible(this.noFormMessage);
|
||||
return this.noFormMessage.getText();
|
||||
return BrowserActions.getText(this.noFormMessage);
|
||||
}
|
||||
|
||||
getCompletedTaskNoFormMessage() {
|
||||
BrowserVisibility.waitUntilElementIsVisible(this.completedTaskNoFormMessage);
|
||||
return this.completedTaskNoFormMessage.getText();
|
||||
return BrowserActions.getText(this.completedTaskNoFormMessage);
|
||||
}
|
||||
|
||||
clickOnAttachFormButton() {
|
||||
BrowserVisibility.waitUntilElementIsVisible(this.attachFormButton);
|
||||
this.attachFormButton.click();
|
||||
BrowserActions.click(this.attachFormButton);
|
||||
return this;
|
||||
}
|
||||
|
||||
selectForm(formName) {
|
||||
BrowserVisibility.waitUntilElementIsVisible(this.selectFormDropDownArrow);
|
||||
this.selectFormDropDownArrow.click();
|
||||
BrowserActions.click(this.selectFormDropDownArrow);
|
||||
BrowserVisibility.waitUntilElementIsVisible(this.selectFormContent);
|
||||
this.selectFormFromDropDown(formName);
|
||||
return this;
|
||||
@@ -139,8 +131,7 @@ export class FormFieldsPage {
|
||||
|
||||
selectFormFromDropDown(formName) {
|
||||
const formNameElement = element(by.cssContainingText('span', formName));
|
||||
BrowserVisibility.waitUntilElementIsVisible(formNameElement);
|
||||
formNameElement.click();
|
||||
BrowserActions.click(formNameElement);
|
||||
}
|
||||
|
||||
checkWidgetIsReadOnlyMode(fieldId) {
|
||||
@@ -151,8 +142,7 @@ export class FormFieldsPage {
|
||||
}
|
||||
|
||||
completeForm() {
|
||||
BrowserVisibility.waitUntilElementIsVisible(this.completeButton);
|
||||
return this.completeButton.click();
|
||||
return BrowserActions.click(this.completeButton);
|
||||
}
|
||||
|
||||
setValueInInputById(fieldId, value) {
|
||||
|
Reference in New Issue
Block a user