mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-24 17:32:15 +00:00
[AAE-3638] - implement priority drodpown widget (#6351)
* [AAE-3638] - implement priority drodpown widget * refactor task cloud service function * fix remove value on card view text item and move priorities values in app.config.json * revert app config unnecary changes * PR changes * fix unit test * fix more unit tests * PR changes * create task cloud response model * remove commented code * fix e2e * fix start task e2e and add return type
This commit is contained in:
@@ -151,7 +151,7 @@ describe('Start Task', () => {
|
||||
await startTask.addName(standaloneTaskName);
|
||||
await startTask.addDescription('descriptions');
|
||||
await startTask.addDueDate('12/12/2018');
|
||||
await startTask.addPriority('50');
|
||||
await startTask.addPriority('Normal');
|
||||
await startTask.clickStartButton();
|
||||
await tasksCloudDemoPage.taskListCloudComponent().checkContentIsDisplayedByName(standaloneTaskName);
|
||||
});
|
||||
|
@@ -26,7 +26,6 @@ import {
|
||||
StringUtil,
|
||||
TaskHeaderCloudPage,
|
||||
TasksService,
|
||||
StartTasksCloudPage,
|
||||
PeopleCloudComponentPage
|
||||
} from '@alfresco/adf-testing';
|
||||
import { browser } from 'protractor';
|
||||
@@ -46,7 +45,6 @@ describe('Task Header cloud component', () => {
|
||||
const navigationBarPage = new NavigationBarPage();
|
||||
const appListCloudComponent = new AppListCloudPage();
|
||||
const tasksCloudDemoPage = new TasksCloudDemoPage();
|
||||
const startTaskCloudPage = new StartTasksCloudPage();
|
||||
const peopleCloudComponentPage = new PeopleCloudComponentPage();
|
||||
const taskHeaderCloudPage = new TaskHeaderCloudPage();
|
||||
|
||||
@@ -70,7 +68,7 @@ describe('Task Header cloud component', () => {
|
||||
let groupInfo: any;
|
||||
let testUser: any;
|
||||
let unclaimedTask: any;
|
||||
const priority = 30;
|
||||
const priority = 0; // Not set
|
||||
const description = 'descriptionTask';
|
||||
const formatDate = 'MMM D, YYYY';
|
||||
const dateTimeFormat = 'MMM D, Y, H:mm';
|
||||
@@ -148,7 +146,7 @@ describe('Task Header cloud component', () => {
|
||||
await expect(await taskHeaderCloudPage.getDescription())
|
||||
.toEqual(isValueInvalid(basicCreatedTask.entry.description) ? CONSTANTS.TASK_DETAILS.NO_DESCRIPTION : basicCreatedTask.entry.description);
|
||||
await expect(await taskHeaderCloudPage.getStatus()).toEqual('ASSIGNED');
|
||||
await expect(await taskHeaderCloudPage.getPriority()).toEqual(basicCreatedTask.entry.priority.toString());
|
||||
await expect(await taskHeaderCloudPage.getPriority()).toEqual('Not set');
|
||||
await expect(await taskHeaderCloudPage.getCategory()).toEqual(!basicCreatedTask.entry.category ?
|
||||
CONSTANTS.TASK_DETAILS.NO_CATEGORY : basicCreatedTask.entry.category);
|
||||
await expect(await taskHeaderCloudPage.getDueDate()).toEqual(isValueInvalid(basicCreatedTask.entry.dueDate) ?
|
||||
@@ -172,7 +170,7 @@ describe('Task Header cloud component', () => {
|
||||
await expect(await taskHeaderCloudPage.getDescription())
|
||||
.toEqual(isValueInvalid(completedTask.entry.description) ? CONSTANTS.TASK_DETAILS.NO_DESCRIPTION : completedTask.entry.description);
|
||||
await expect(await taskHeaderCloudPage.getStatus()).toEqual('COMPLETED');
|
||||
await expect(await taskHeaderCloudPage.getPriority()).toEqual(completedTask.entry.priority.toString());
|
||||
await expect(await taskHeaderCloudPage.getReadonlyPriority()).toEqual('Not set');
|
||||
await expect(await taskHeaderCloudPage.getCategory()).toEqual(!completedTask.entry.category ?
|
||||
CONSTANTS.TASK_DETAILS.NO_CATEGORY : completedTask.entry.category);
|
||||
await expect(await taskHeaderCloudPage.getDueDate()).toEqual(isValueInvalid(completedTask.entry.dueDate) ?
|
||||
@@ -196,7 +194,7 @@ describe('Task Header cloud component', () => {
|
||||
await expect(await taskHeaderCloudPage.getDescription())
|
||||
.toEqual(isValueInvalid(subTask.entry.description) ? CONSTANTS.TASK_DETAILS.NO_DESCRIPTION : subTask.entry.description);
|
||||
await expect(await taskHeaderCloudPage.getStatus()).toEqual('ASSIGNED');
|
||||
await expect(await taskHeaderCloudPage.getPriority()).toEqual(subTask.entry.priority.toString());
|
||||
await expect(await taskHeaderCloudPage.getPriority()).toEqual('Not set');
|
||||
await expect(await taskHeaderCloudPage.getCategory()).toEqual(!subTask.entry.category ?
|
||||
CONSTANTS.TASK_DETAILS.NO_CATEGORY : subTask.entry.category);
|
||||
await expect(await taskHeaderCloudPage.getDueDate()).toEqual(isValueInvalid(subTask.entry.dueDate) ? CONSTANTS.TASK_DETAILS.NO_DATE : subTaskCreatedDate);
|
||||
@@ -208,30 +206,6 @@ describe('Task Header cloud component', () => {
|
||||
.toEqual(isValueInvalid(subTask.entry.parentTaskId) ? '' : subTask.entry.parentTaskId);
|
||||
});
|
||||
|
||||
it('[C309698] Should validate the Priority field', async () => {
|
||||
const myTaskName = `Test_C309698_${StringUtil.generateRandomString()}`;
|
||||
await tasksCloudDemoPage.clickStartNewTaskButton();
|
||||
await startTaskCloudPage.addName(myTaskName);
|
||||
await startTaskCloudPage.typePriorityOf('50');
|
||||
await startTaskCloudPage.clickStartButton();
|
||||
await tasksCloudDemoPage.taskFilterCloudComponent.clickTaskFilter('my-tasks');
|
||||
await tasksCloudDemoPage.taskListCloudComponent().getDataTable().waitTillContentLoaded();
|
||||
|
||||
await tasksCloudDemoPage.taskListCloudComponent().checkContentIsDisplayedByName(myTaskName);
|
||||
await tasksCloudDemoPage.taskListCloudComponent().selectRow(myTaskName);
|
||||
await tasksCloudDemoPage.waitTillContentLoaded();
|
||||
|
||||
await taskHeaderCloudPage.checkTaskPropertyListIsDisplayed();
|
||||
|
||||
await taskHeaderCloudPage.priorityCardTextItem.enterTextField('$$%£W21');
|
||||
const errorMessage = await taskHeaderCloudPage.priorityCardTextItem.getErrorMessage();
|
||||
await expect(errorMessage).toBe('Enter a different value');
|
||||
|
||||
await taskHeaderCloudPage.priorityCardTextItem.enterTextField('600');
|
||||
const currentValue = await taskHeaderCloudPage.priorityCardTextItem.getFieldValue();
|
||||
await expect(currentValue).toBe('600');
|
||||
});
|
||||
|
||||
it('[C309698] Should validate the Priority field', async () => {
|
||||
await tasksCloudDemoPage.editTaskFilterCloud.openFilter();
|
||||
await tasksCloudDemoPage.editTaskFilterCloud.setStatusFilterDropDown('ALL');
|
||||
@@ -246,7 +220,7 @@ describe('Task Header cloud component', () => {
|
||||
const currentAssignee = await taskHeaderCloudPage.assigneeCardTextItem.getFieldValue();
|
||||
await expect(currentAssignee).toBe('No assignee');
|
||||
|
||||
await taskHeaderCloudPage.priorityCardTextItem.checkElementIsReadonly();
|
||||
await taskHeaderCloudPage.priorityCardSelectItem.checkElementIsReadonly();
|
||||
await taskHeaderCloudPage.statusCardTextItem.checkElementIsReadonly();
|
||||
});
|
||||
|
||||
|
@@ -41,7 +41,7 @@ describe('Edit task filters and task list properties', () => {
|
||||
const candidateBaseApp = browser.params.resources.ACTIVITI_CLOUD_APPS.CANDIDATE_BASE_APP.name;
|
||||
let createdTask, notDisplayedTask, priorityTask, subTask,
|
||||
otherOwnerTask, testUser, groupInfo;
|
||||
const priority = 30;
|
||||
const priority = 1;
|
||||
|
||||
beforeAll(async () => {
|
||||
await apiService.loginWithProfile('identityAdmin');
|
||||
|
@@ -48,7 +48,7 @@ describe('Edit task filters and task list properties', () => {
|
||||
const noTasksFoundMessage = 'No Tasks Found';
|
||||
let createdTask, notAssigned, notDisplayedTask, processDefinition, processInstance, priorityTask, subTask,
|
||||
otherOwnerTask, testUser, groupInfo, simpleTask;
|
||||
const priority = 30;
|
||||
const priority = 1;
|
||||
|
||||
const beforeDate = moment().add(-1, 'days').format('DD/MM/YYYY');
|
||||
const currentDate = DateUtil.formatDate('DD/MM/YYYY');
|
||||
@@ -184,14 +184,14 @@ describe('Edit task filters and task list properties', () => {
|
||||
});
|
||||
|
||||
it('[C297482] Should be able to see only tasks with specific priority when priority is set', async () => {
|
||||
await tasksCloudDemoPage.editTaskFilterCloudComponent().setPriority(priority);
|
||||
await tasksCloudDemoPage.editTaskFilterCloudComponent().setPriority('Low');
|
||||
|
||||
await tasksCloudDemoPage.taskListCloudComponent().checkContentIsDisplayedByName(priorityTask.entry.name);
|
||||
await tasksCloudDemoPage.taskListCloudComponent().checkContentIsNotDisplayedByName(createdTask.entry.name);
|
||||
});
|
||||
|
||||
it('[C297687] Should be able to see No tasks found when typing unused value for priority field', async () => {
|
||||
await tasksCloudDemoPage.editTaskFilterCloudComponent().setPriority('87650');
|
||||
await tasksCloudDemoPage.editTaskFilterCloudComponent().setPriority('Normal');
|
||||
|
||||
await expect(await tasksCloudDemoPage.taskListCloudComponent().getNoTasksFoundMessage()).toEqual(noTasksFoundMessage);
|
||||
});
|
||||
|
Reference in New Issue
Block a user