mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-24 17:32:15 +00:00
[ADF-4149] - Moved the StartTasksCloudComponent/TaskDetailsCloudComponent pages (#4407)
* moved the taskDetailsCloudComponent page and startTaskCloudComponent page * update the import and fix tests * update import and tests * update exports * update imports * remove comment and index.ts * update imports and class name * remove comment * Modify task-details-cloud-component page name in task-header-cloud-component * update method * remove user-info-dialog * remove task details page * revert task details changes * revert changes
This commit is contained in:
committed by
Eugenio Romano
parent
2e9c57cf45
commit
5f17ee0b01
@@ -5,3 +5,5 @@
|
||||
export * from './login-sso.page';
|
||||
export * from '../../core/pages/user-info.page';
|
||||
export * from '../app/app-list-cloud.page';
|
||||
export * from './start-tasks-cloud-component.page';
|
||||
export * from './task-header-cloud-component.page';
|
||||
|
@@ -0,0 +1,115 @@
|
||||
/*!
|
||||
* @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 { element, by, Key, protractor } from 'protractor';
|
||||
import { BrowserVisibility } from '../../core/browser-visibility';
|
||||
|
||||
export class StartTasksCloudPage {
|
||||
|
||||
name = element(by.css('input[id="name_id"]'));
|
||||
dueDate = element(by.css('input[id="date_id"]'));
|
||||
description = element(by.css('textarea[id="description_id"]'));
|
||||
priority = element(by.css('input[formcontrolname="priority"]'));
|
||||
startButton = element(by.css('button[id="button-start"]'));
|
||||
startButtonEnabled = element(by.css('button[id="button-start"]:not(disabled)'));
|
||||
cancelButton = element(by.css('button[id="button-cancel"]'));
|
||||
form = element(by.css('adf-cloud-start-task form'));
|
||||
|
||||
checkFormIsDisplayed() {
|
||||
BrowserVisibility.waitUntilElementIsVisible(this.form);
|
||||
return this;
|
||||
}
|
||||
|
||||
addName(userName) {
|
||||
BrowserVisibility.waitUntilElementIsVisible(this.name);
|
||||
this.name.clear();
|
||||
this.name.sendKeys(userName);
|
||||
return this;
|
||||
}
|
||||
|
||||
addDescription(userDescription) {
|
||||
BrowserVisibility.waitUntilElementIsVisible(this.description);
|
||||
this.description.sendKeys(userDescription);
|
||||
return this;
|
||||
}
|
||||
|
||||
addPriority(userPriority) {
|
||||
BrowserVisibility.waitUntilElementIsVisible(this.priority);
|
||||
this.priority.sendKeys(userPriority);
|
||||
return this;
|
||||
}
|
||||
|
||||
addDueDate(date) {
|
||||
BrowserVisibility.waitUntilElementIsVisible(this.dueDate);
|
||||
this.clearField(this.dueDate);
|
||||
this.dueDate.sendKeys(date);
|
||||
return this;
|
||||
}
|
||||
|
||||
clickStartButton() {
|
||||
BrowserVisibility.waitUntilElementIsVisible(this.startButton);
|
||||
BrowserVisibility.waitUntilElementIsClickable(this.startButton);
|
||||
return this.startButton.click();
|
||||
}
|
||||
|
||||
checkStartButtonIsEnabled() {
|
||||
BrowserVisibility.waitUntilElementIsVisible(this.startButtonEnabled);
|
||||
return this;
|
||||
}
|
||||
|
||||
checkStartButtonIsDisabled() {
|
||||
BrowserVisibility.waitUntilElementIsVisible(this.startButton.getAttribute('disabled'));
|
||||
return this;
|
||||
}
|
||||
|
||||
clickCancelButton() {
|
||||
BrowserVisibility.waitUntilElementIsVisible(this.cancelButton);
|
||||
BrowserVisibility.waitUntilElementIsClickable(this.cancelButton);
|
||||
return this.cancelButton.click();
|
||||
}
|
||||
|
||||
blur(locator) {
|
||||
locator.click();
|
||||
locator.sendKeys(Key.TAB);
|
||||
return this;
|
||||
}
|
||||
|
||||
checkValidationErrorIsDisplayed(error, elementRef = 'mat-error') {
|
||||
const errorElement = element(by.cssContainingText(elementRef, error));
|
||||
BrowserVisibility.waitUntilElementIsVisible(errorElement);
|
||||
return this;
|
||||
}
|
||||
|
||||
validateAssignee(error) {
|
||||
this.checkValidationErrorIsDisplayed(error, '.adf-start-task-cloud-error');
|
||||
return this;
|
||||
}
|
||||
|
||||
validateDate(error) {
|
||||
this.checkValidationErrorIsDisplayed(error, '.adf-error-text');
|
||||
return this;
|
||||
}
|
||||
|
||||
clearField(locator) {
|
||||
BrowserVisibility.waitUntilElementIsVisible(locator);
|
||||
locator.getAttribute('value').then((result) => {
|
||||
for (let i = result.length; i >= 0; i--) {
|
||||
locator.sendKeys(protractor.Key.BACK_SPACE);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
@@ -0,0 +1,97 @@
|
||||
/*!
|
||||
* @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 { element, by } from 'protractor';
|
||||
import { BrowserVisibility } from '../../core/browser-visibility';
|
||||
|
||||
export class TaskHeaderCloudPage {
|
||||
|
||||
assigneeField = element(by.css('span[data-automation-id*="assignee"] span'));
|
||||
statusField = element(by.css('span[data-automation-id*="status"] span'));
|
||||
priorityField = element(by.css('span[data-automation-id*="priority"] span'));
|
||||
dueDateField = element(by.css('span[data-automation-id*="dueDate"] span'));
|
||||
categoryField = element(by.css('span[data-automation-id*="category"] span'));
|
||||
createdField = element(by.css('span[data-automation-id="card-dateitem-created"] span'));
|
||||
parentNameField = element(by.css('span[data-automation-id*="parentName"] span'));
|
||||
parentTaskIdField = element(by.css('span[data-automation-id*="parentTaskId"] span'));
|
||||
endDateField = element.all(by.css('span[data-automation-id*="endDate"] span')).first();
|
||||
idField = element.all(by.css('span[data-automation-id*="id"] span')).first();
|
||||
descriptionField = element(by.css('span[data-automation-id*="description"] span'));
|
||||
taskDetailsHeader = element(by.css(`h4[data-automation-id='task-details-header']`));
|
||||
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();
|
||||
}
|
||||
|
||||
getStatus() {
|
||||
BrowserVisibility.waitUntilElementIsVisible(this.statusField);
|
||||
return this.statusField.getText();
|
||||
}
|
||||
|
||||
getPriority() {
|
||||
BrowserVisibility.waitUntilElementIsVisible(this.priorityField);
|
||||
return this.priorityField.getText();
|
||||
}
|
||||
|
||||
getCategory() {
|
||||
BrowserVisibility.waitUntilElementIsVisible(this.categoryField);
|
||||
return this.categoryField.getText();
|
||||
}
|
||||
|
||||
getParentName() {
|
||||
BrowserVisibility.waitUntilElementIsVisible(this.parentNameField);
|
||||
return this.parentNameField.getText();
|
||||
}
|
||||
|
||||
getParentTaskId() {
|
||||
BrowserVisibility.waitUntilElementIsVisible(this.parentTaskIdField);
|
||||
return this.parentTaskIdField.getText();
|
||||
}
|
||||
|
||||
getEndDate() {
|
||||
BrowserVisibility.waitUntilElementIsVisible(this.endDateField);
|
||||
return this.endDateField.getText();
|
||||
}
|
||||
|
||||
getCreated() {
|
||||
BrowserVisibility.waitUntilElementIsVisible(this.createdField);
|
||||
return this.createdField.getText();
|
||||
}
|
||||
|
||||
getId() {
|
||||
BrowserVisibility.waitUntilElementIsVisible(this.idField);
|
||||
return this.idField.getText();
|
||||
}
|
||||
|
||||
getDescription() {
|
||||
BrowserVisibility.waitUntilElementIsVisible(this.descriptionField);
|
||||
return this.descriptionField.getText();
|
||||
}
|
||||
|
||||
getDueDate() {
|
||||
BrowserVisibility.waitUntilElementIsVisible(this.dueDateField);
|
||||
return this.dueDateField.getText();
|
||||
}
|
||||
|
||||
getTaskDetailsHeader() {
|
||||
BrowserVisibility.waitUntilElementIsVisible(this.taskPropertyList);
|
||||
return this.taskDetailsHeader.getText();
|
||||
}
|
||||
|
||||
}
|
Reference in New Issue
Block a user