mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-31 17:38:48 +00:00
[ADF-3652][ADF-3653] Automated tests for people widget (#3880)
* [ADF-3652] Automated test for starting a process with people widget * Fixing failing tests * [ADF-3653] Automated test for people widget in completed task
This commit is contained in:
committed by
Eugenio Romano
parent
85c022730b
commit
858584bcf0
@@ -43,6 +43,7 @@ var ProcessDetailsPage = function () {
|
||||
var cancelProcessButton = element(by.css('div[data-automation-id="header-status"] > button'));
|
||||
//Tasks
|
||||
var activeTask = element(by.css('div[data-automation-id="active-tasks"]'));
|
||||
var completedTask = element(by.css('div[data-automation-id="completed-tasks"]'));
|
||||
var taskTitle = element(by.css("h2[class='activiti-task-details__header']"));
|
||||
|
||||
this.checkProcessTitleIsDisplayed = function () {
|
||||
@@ -134,7 +135,12 @@ var ProcessDetailsPage = function () {
|
||||
|
||||
this.clickOnActiveTask = function () {
|
||||
Util.waitUntilElementIsVisible(activeTask);
|
||||
activeTask.click();
|
||||
return activeTask.click();
|
||||
};
|
||||
|
||||
this.clickOnCompletedTask = function () {
|
||||
Util.waitUntilElementIsClickable(completedTask);
|
||||
return completedTask.click();
|
||||
};
|
||||
|
||||
this.checkActiveTaskTitleIsDisplayed = function () {
|
||||
|
@@ -46,6 +46,7 @@ export class TaskDetailsPage {
|
||||
taskDetailsSection = element(by.css('div[data-automation-id="adf-tasks-details"]'));
|
||||
taskDetailsEmptySection = element(by.css('div[data-automation-id="adf-tasks-details--empty"]'));
|
||||
completeTask = element(by.css('button[id="adf-no-form-complete-button"]'));
|
||||
completeFormTask = element(by.css('button[id="adf-form-complete"]'));
|
||||
taskDetailsTitle = element(by.css('h2[class="activiti-task-details__header"] span'));
|
||||
auditLogButton = element(by.css('button[adf-task-audit]'));
|
||||
noPeopleInvolved = element(by.id('no-people-label'));
|
||||
@@ -254,7 +255,6 @@ export class TaskDetailsPage {
|
||||
|
||||
checkUserIsSelected(user) {
|
||||
let row = element(by.cssContainingText('div[class*="search-list-container"] div[class*="people-full-name"]', user));
|
||||
let selectedRow = this.getRowsUser(user).element(by.css('ancestor::tr[class*="is-selected"]'));
|
||||
Util.waitUntilElementIsVisible(row);
|
||||
return this;
|
||||
}
|
||||
@@ -383,4 +383,14 @@ export class TaskDetailsPage {
|
||||
return this.completeTask.click();
|
||||
}
|
||||
|
||||
checkCompleteFormButtonIsDisplayed() {
|
||||
Util.waitUntilElementIsVisible(this.completeFormTask);
|
||||
return this.completeFormTask;
|
||||
}
|
||||
|
||||
clickCompleteFormTask() {
|
||||
Util.waitUntilElementIsClickable(this.completeFormTask);
|
||||
return this.completeFormTask.click();
|
||||
}
|
||||
|
||||
}
|
||||
|
@@ -73,14 +73,14 @@ var TaskFiltersPage = function () {
|
||||
Util.waitUntilElementIsVisible(queuedTask);
|
||||
return queuedTask;
|
||||
};
|
||||
|
||||
|
||||
this.clickMyTaskTaskFilter = function() {
|
||||
Util.waitUntilElementIsVisible(myTasks);
|
||||
return myTasks.click();
|
||||
};
|
||||
|
||||
this.clickCompletedTaskFilter = function() {
|
||||
Util.waitUntilElementIsVisible(completedTask);
|
||||
Util.waitUntilElementIsClickable(completedTask);
|
||||
return completedTask.click();
|
||||
};
|
||||
|
||||
|
40
e2e/pages/adf/process_services/widgets/people.ts
Normal file
40
e2e/pages/adf/process_services/widgets/people.ts
Normal file
@@ -0,0 +1,40 @@
|
||||
/*!
|
||||
* @license
|
||||
* Copyright 2016 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 { element, by } from 'protractor';
|
||||
import Util = require('../../../../util/util');
|
||||
|
||||
export class People {
|
||||
|
||||
peopleField = element(by.css('input[data-automation-id="adf-people-search-input"]'));
|
||||
firstResult = element(by.id('adf-people-widget-user-0'));
|
||||
|
||||
checkPeopleFieldIsDisplayed() {
|
||||
return Util.waitUntilElementIsVisible(this.peopleField);
|
||||
}
|
||||
|
||||
fillPeopleField(value) {
|
||||
Util.waitUntilElementIsClickable(this.peopleField);
|
||||
return this.peopleField.sendKeys(value);
|
||||
}
|
||||
|
||||
selectUserFromDropdown() {
|
||||
Util.waitUntilElementIsVisible(this.firstResult);
|
||||
return this.firstResult.click();
|
||||
}
|
||||
|
||||
}
|
@@ -24,6 +24,7 @@ import { RadioButtons } from './radioButtons';
|
||||
import { Hyperlink } from './hyperlink';
|
||||
import { Dropdown } from './dropdown';
|
||||
import { DynamicTable } from './dynamicTable';
|
||||
import { People } from './people';
|
||||
|
||||
export class Widget {
|
||||
|
||||
@@ -63,4 +64,8 @@ export class Widget {
|
||||
return new DynamicTable();
|
||||
}
|
||||
|
||||
peopleWidget() {
|
||||
return new People();
|
||||
}
|
||||
|
||||
}
|
||||
|
Reference in New Issue
Block a user