[ADF-4310]Added sort tests for edit task filter cloud component (#4584)

* Added some tests

* Fix tests

* Add missing tests for sort properties.
This commit is contained in:
cristinaj 2019-04-24 15:50:00 +03:00 committed by Eugenio Romano
parent 32ba281b70
commit db4d10137e
5 changed files with 433 additions and 154 deletions

View File

@ -70,21 +70,13 @@ export class TasksCloudDemoPage {
return new TaskFiltersCloudComponentPage(this.completedTasks);
}
customTaskFilter(filterName) {
return new TaskFiltersCloudComponentPage(element(by.css(`span[data-automation-id="${filterName}-filter"]`)));
}
getActiveFilterName() {
BrowserVisibility.waitUntilElementIsVisible(this.activeFilter);
return this.activeFilter.getText();
}
getAllRowsByIdColumn() {
return new TaskListCloudComponentPage().getAllRowsByColumn('Id');
}
getAllRowsByProcessDefIdColumn() {
return new TaskListCloudComponentPage().getAllRowsByColumn('Process Definition Id');
customTaskFilter(filterName) {
return new TaskFiltersCloudComponentPage(element(by.css(`span[data-automation-id="${filterName}-filter"]`)));
}
clickOnTaskFilters() {

View File

@ -21,7 +21,7 @@ import {
StringUtil, TasksService,
ProcessDefinitionsService, ProcessInstancesService,
LoginSSOPage, ApiService,
SettingsPage, AppListCloudPage, LocalStorageUtil
SettingsPage, AppListCloudPage, LocalStorageUtil, IdentityService, RolesService
} from '@alfresco/adf-testing';
import { NavigationBarPage } from '../pages/adf/navigationBarPage';
import { TasksCloudDemoPage } from '../pages/adf/demo-shell/process-services/tasksCloudDemoPage';
@ -31,92 +31,112 @@ import moment = require('moment');
import { DateUtil } from '../util/dateUtil';
import resources = require('../util/resources');
import CONSTANTS = require('../util/constants');
describe('Edit task filters and task list properties', () => {
describe('Edit task filters and task list properties', () => {
const settingsPage = new SettingsPage();
const loginSSOPage = new LoginSSOPage();
const navigationBarPage = new NavigationBarPage();
const settingsPage = new SettingsPage();
const loginSSOPage = new LoginSSOPage();
const navigationBarPage = new NavigationBarPage();
const appListCloudComponent = new AppListCloudPage();
const tasksCloudDemoPage = new TasksCloudDemoPage();
const appListCloudComponent = new AppListCloudPage();
const tasksCloudDemoPage = new TasksCloudDemoPage();
let tasksService: TasksService;
let processDefinitionService: ProcessDefinitionsService;
let processInstancesService: ProcessInstancesService;
let tasksService: TasksService;
let processDefinitionService: ProcessDefinitionsService;
let processInstancesService: ProcessInstancesService;
let identityService: IdentityService;
let rolesService: RolesService;
const simpleApp = resources.ACTIVITI7_APPS.SIMPLE_APP.name;
const candidateUserApp = resources.ACTIVITI7_APPS.CANDIDATE_USER_APP.name;
const simpleApp = resources.ACTIVITI7_APPS.SIMPLE_APP.name;
const candidateUserApp = resources.ACTIVITI7_APPS.CANDIDATE_USER_APP.name;
const noTasksFoundMessage = 'No Tasks Found';
const user = TestConfig.adf.adminEmail, password = TestConfig.adf.adminPassword;
let createdTask, notAssigned, notDisplayedTask, processDefinition, processInstance, priorityTask, subTask, otherOwnerTask;
const priority = 30;
const noTasksFoundMessage = 'No Tasks Found';
const user = TestConfig.adf.adminEmail, password = TestConfig.adf.adminPassword;
let createdTask, notAssigned, notDisplayedTask, processDefinition, processInstance, priorityTask, subTask;
const priority = 30;
const beforeDate = moment().add(-1, 'days').format('DD/MM/YYYY');
const currentDate = DateUtil.formatDate('DD/MM/YYYY');
const afterDate = moment().add(1, 'days').format('DD/MM/YYYY');
const beforeDate = moment().add(-1, 'days').format('DD/MM/YYYY');
const currentDate = DateUtil.formatDate('DD/MM/YYYY');
const afterDate = moment().add(1, 'days').format('DD/MM/YYYY');
beforeAll(async (done) => {
const jsonFile = new TaskListCloudConfiguration().getConfiguration();
settingsPage.setProviderBpmSso(TestConfig.adf.hostBPM, TestConfig.adf.hostSso, TestConfig.adf.hostIdentity, false);
loginSSOPage.clickOnSSOButton();
loginSSOPage.loginSSOIdentityService(user, password);
beforeAll(async (done) => {
const jsonFile = new TaskListCloudConfiguration().getConfiguration();
settingsPage.setProviderBpmSso(TestConfig.adf.hostBPM, TestConfig.adf.hostSso, TestConfig.adf.hostIdentity, false);
loginSSOPage.clickOnSSOButton();
loginSSOPage.loginSSOIdentityService(user, password);
await LocalStorageUtil.setConfigField('adf-cloud-task-list', JSON.stringify(jsonFile));
await LocalStorageUtil.setConfigField('adf-edit-task-filter', JSON.stringify({
'filterProperties': [
'appName',
'status',
'assignee',
'taskName',
'parentTaskId',
'priority',
'standAlone',
'owner',
'processDefinitionId',
'processInstanceId',
'lastModified',
'sort',
'order'
],
'sortProperties': [
'id',
'name',
'createdDate',
'priority',
'processDefinitionId',
'processInstanceId',
'parentTaskId',
'priority',
'standAlone',
'owner',
'assignee'
],
'actions': [
'save',
'saveAs',
'delete'
]
}));
await LocalStorageUtil.setConfigField('adf-cloud-task-list', JSON.stringify(jsonFile));
await LocalStorageUtil.setConfigField('adf-edit-task-filter', JSON.stringify({
'filterProperties': [
'appName',
'status',
'assignee',
'taskName',
'parentTaskId',
'priority',
'standAlone',
'owner',
'processDefinitionId',
'processInstanceId',
'lastModified',
'sort',
'order'
],
'sortProperties': [
'id',
'name',
'createdDate',
'priority',
'processDefinitionId'
],
'actions': [
'save',
'saveAs',
'delete'
]
}));
const apiService = new ApiService('activiti', TestConfig.adf.hostBPM, TestConfig.adf.hostSso, 'BPM');
await apiService.login(TestConfig.adf.adminEmail, TestConfig.adf.adminPassword);
identityService = new IdentityService(apiService);
rolesService = new RolesService(apiService);
tasksService = new TasksService(apiService);
const apiService = new ApiService('activiti', TestConfig.adf.hostBPM, TestConfig.adf.hostSso, 'BPM');
await apiService.login(TestConfig.adf.adminEmail, TestConfig.adf.adminPassword);
const apsUser = await identityService.createIdentityUser();
const apsUserRoleId = await rolesService.getRoleIdByRoleName(CONSTANTS.ROLES.APS_USER);
await identityService.assignRole(apsUser.idIdentityService, apsUserRoleId, CONSTANTS.ROLES.APS_USER);
tasksService = new TasksService(apiService);
createdTask = await tasksService.createStandaloneTask(StringUtil.generateRandomString(), simpleApp);
await tasksService.claimTask(createdTask.entry.id, simpleApp);
notAssigned = await tasksService.createStandaloneTask(StringUtil.generateRandomString(), simpleApp);
priorityTask = await tasksService.createStandaloneTask(StringUtil.generateRandomString(), simpleApp, { priority: priority });
await tasksService.claimTask(priorityTask.entry.id, simpleApp);
notDisplayedTask = await tasksService.createStandaloneTask(StringUtil.generateRandomString(), candidateUserApp);
await tasksService.claimTask(notDisplayedTask.entry.id, candidateUserApp);
await apiService.login(apsUser.email, apsUser.password);
otherOwnerTask = await tasksService.createStandaloneTask(StringUtil.generateRandomString(), simpleApp);
await tasksService.claimTask(otherOwnerTask.entry.id, simpleApp);
processDefinitionService = new ProcessDefinitionsService(apiService);
processDefinition = await processDefinitionService.getProcessDefinitions(simpleApp);
processInstancesService = new ProcessInstancesService(apiService);
processInstance = await processInstancesService.createProcessInstance(processDefinition.list.entries[0].entry.key, simpleApp);
await apiService.login(TestConfig.adf.adminEmail, TestConfig.adf.adminPassword);
createdTask = await tasksService.createStandaloneTask(StringUtil.generateRandomString(), simpleApp);
await tasksService.claimTask(createdTask.entry.id, simpleApp);
notAssigned = await tasksService.createStandaloneTask(StringUtil.generateRandomString(), simpleApp);
priorityTask = await tasksService.createStandaloneTask(StringUtil.generateRandomString(), simpleApp, {priority: priority});
await tasksService.claimTask(priorityTask.entry.id, simpleApp);
notDisplayedTask = await tasksService.createStandaloneTask(StringUtil.generateRandomString(), candidateUserApp);
await tasksService.claimTask(notDisplayedTask.entry.id, candidateUserApp);
subTask = await tasksService.createStandaloneSubtask(createdTask.entry.id, simpleApp, StringUtil.generateRandomString());
await tasksService.claimTask(subTask.entry.id, simpleApp);
processDefinitionService = new ProcessDefinitionsService(apiService);
processDefinition = await processDefinitionService.getProcessDefinitions(simpleApp);
processInstancesService = new ProcessInstancesService(apiService);
processInstance = await processInstancesService.createProcessInstance(processDefinition.list.entries[0].entry.key, simpleApp);
done();
});
subTask = await tasksService.createStandaloneSubtask(createdTask.entry.id, simpleApp, StringUtil.generateRandomString());
await tasksService.claimTask(subTask.entry.id, simpleApp);
done();
});
describe('Edit task filters and task list properties - filter properties', () => {
beforeEach((done) => {
navigationBarPage.navigateToProcessServicesCloudPage();
@ -298,7 +318,7 @@ describe('Edit task filters and task list properties', () => {
expect(tasksCloudDemoPage.taskListCloudComponent().getNoTasksFoundMessage()).toEqual(noTasksFoundMessage);
});
xit('[C297692] Task is displayed when typing into lastModifiedFrom field a date before the tasks due date ' +
it('[C297692] Task is displayed when typing into lastModifiedFrom field a date before the tasks due date ' +
'and into lastModifiedTo a date after', () => {
tasksCloudDemoPage.myTasksFilter().checkTaskFilterIsDisplayed();
@ -322,4 +342,258 @@ describe('Edit task filters and task list properties', () => {
});
describe('Edit task filters and task list properties - sort properties', () => {
beforeEach((done) => {
navigationBarPage.navigateToProcessServicesCloudPage();
appListCloudComponent.checkApsContainer();
appListCloudComponent.goToApp(simpleApp);
tasksCloudDemoPage.editTaskFilterCloudComponent().clickCustomiseFilterHeader();
tasksCloudDemoPage.myTasksFilter().checkTaskFilterIsDisplayed();
done();
});
it('[C306901] Should display tasks sorted by task name when taskName is selected from sort dropdown', () => {
tasksCloudDemoPage.editTaskFilterCloudComponent().setStatusFilterDropDown('ASSIGNED')
.setSortFilterDropDown('Name').setOrderFilterDropDown('ASC');
tasksCloudDemoPage.taskListCloudComponent().getDataTable().checkSpinnerIsDisplayed();
tasksCloudDemoPage.taskListCloudComponent().getDataTable().checkSpinnerIsNotDisplayed();
tasksCloudDemoPage.taskListCloudComponent().getAllRowsNameColumn().then( (list) => {
const initialList = list.slice(0);
list.sort(function (firstStr, secondStr) {
return firstStr.localeCompare(secondStr);
});
expect(JSON.stringify(initialList) === JSON.stringify(list)).toEqual(true);
});
tasksCloudDemoPage.editTaskFilterCloudComponent().setOrderFilterDropDown('DESC');
tasksCloudDemoPage.taskListCloudComponent().getDataTable().checkSpinnerIsDisplayed();
tasksCloudDemoPage.taskListCloudComponent().getDataTable().checkSpinnerIsNotDisplayed();
tasksCloudDemoPage.taskListCloudComponent().getAllRowsNameColumn().then( (list) => {
const initialList = list.slice(0);
list.sort(function (firstStr, secondStr) {
return firstStr.localeCompare(secondStr);
});
list.reverse();
expect(JSON.stringify(initialList) === JSON.stringify(list)).toEqual(true);
});
});
it('[C290156] Should display tasks ordered by id when Id is selected from sort dropdown', () => {
tasksCloudDemoPage.editTaskFilterCloudComponent().setStatusFilterDropDown('ASSIGNED')
.setSortFilterDropDown('Id').setOrderFilterDropDown('ASC');
tasksCloudDemoPage.taskListCloudComponent().getDataTable().checkSpinnerIsDisplayed();
tasksCloudDemoPage.taskListCloudComponent().getDataTable().checkSpinnerIsNotDisplayed();
tasksCloudDemoPage.taskListCloudComponent().getAllRowsByIdColumn().then((list) => {
const initialList = list.slice(0);
list.sort(function (firstStr, secondStr) {
return firstStr.localeCompare(secondStr);
});
expect(JSON.stringify(initialList) === JSON.stringify(list)).toEqual(true);
});
tasksCloudDemoPage.editTaskFilterCloudComponent().setOrderFilterDropDown('DESC');
tasksCloudDemoPage.taskListCloudComponent().getDataTable().checkSpinnerIsDisplayed();
tasksCloudDemoPage.taskListCloudComponent().getDataTable().checkSpinnerIsNotDisplayed();
tasksCloudDemoPage.taskListCloudComponent().getAllRowsByIdColumn().then((list) => {
const initialList = list.slice(0);
list.sort(function (firstStr, secondStr) {
return firstStr.localeCompare(secondStr);
});
list.reverse();
expect(JSON.stringify(initialList) === JSON.stringify(list)).toEqual(true);
});
});
it('[C306903] Should display tasks sorted by processDefinitionId when processDefinitionId is selected from sort dropdown', () => {
tasksCloudDemoPage.editTaskFilterCloudComponent().setStatusFilterDropDown('ASSIGNED')
.setSortFilterDropDown('ProcessDefinitionId').setOrderFilterDropDown('ASC');
tasksCloudDemoPage.taskListCloudComponent().getDataTable().checkSpinnerIsDisplayed();
tasksCloudDemoPage.taskListCloudComponent().getDataTable().checkSpinnerIsNotDisplayed();
tasksCloudDemoPage.taskListCloudComponent().getAllRowsByProcessDefIdColumn().then((list) => {
const initialList = list.slice(0);
list.sort(function (firstStr, secondStr) {
return firstStr.localeCompare(secondStr);
});
expect(JSON.stringify(initialList) === JSON.stringify(list)).toEqual(true);
});
tasksCloudDemoPage.editTaskFilterCloudComponent().setOrderFilterDropDown('DESC');
tasksCloudDemoPage.taskListCloudComponent().getDataTable().checkSpinnerIsDisplayed();
tasksCloudDemoPage.taskListCloudComponent().getDataTable().checkSpinnerIsNotDisplayed();
tasksCloudDemoPage.taskListCloudComponent().getAllRowsByProcessDefIdColumn().then((list) => {
const initialList = list.slice(0);
list.sort(function (firstStr, secondStr) {
return firstStr.localeCompare(secondStr);
});
list.reverse();
expect(JSON.stringify(initialList) === JSON.stringify(list)).toEqual(true);
});
});
it('[C306905] Should display tasks sorted by processInstanceId when processInstanceId is selected from sort dropdown', () => {
tasksCloudDemoPage.editTaskFilterCloudComponent().setStatusFilterDropDown('ASSIGNED')
.setSortFilterDropDown('ProcessInstanceId').setOrderFilterDropDown('ASC');
tasksCloudDemoPage.taskListCloudComponent().getDataTable().checkSpinnerIsDisplayed();
tasksCloudDemoPage.taskListCloudComponent().getDataTable().checkSpinnerIsNotDisplayed();
tasksCloudDemoPage.taskListCloudComponent().getAllRowsByProcessInstanceIdColumn().then((list) => {
const initialList = list.slice(0);
list.sort(function (firstStr, secondStr) {
return firstStr.localeCompare(secondStr);
});
expect(JSON.stringify(initialList) === JSON.stringify(list)).toEqual(true);
});
tasksCloudDemoPage.editTaskFilterCloudComponent().setOrderFilterDropDown('DESC');
tasksCloudDemoPage.taskListCloudComponent().getDataTable().checkSpinnerIsDisplayed();
tasksCloudDemoPage.taskListCloudComponent().getDataTable().checkSpinnerIsNotDisplayed();
tasksCloudDemoPage.taskListCloudComponent().getAllRowsByProcessInstanceIdColumn().then((list) => {
const initialList = list.slice(0);
list.sort(function (firstStr, secondStr) {
return firstStr.localeCompare(secondStr);
});
list.reverse();
expect(JSON.stringify(initialList) === JSON.stringify(list)).toEqual(true);
});
});
it('[C306907] Should display tasks sorted by assignee when assignee is selected from sort dropdown', () => {
tasksCloudDemoPage.editTaskFilterCloudComponent().clearAssignee().setStatusFilterDropDown('ALL')
.setSortFilterDropDown('Assignee').setOrderFilterDropDown('ASC');
tasksCloudDemoPage.taskListCloudComponent().getDataTable().checkSpinnerIsDisplayed();
tasksCloudDemoPage.taskListCloudComponent().getDataTable().checkSpinnerIsNotDisplayed();
tasksCloudDemoPage.taskListCloudComponent().getAllRowsByAssigneeColumn().then((list) => {
const initialList = list.slice(0);
list.sort(function (firstStr, secondStr) {
return firstStr.localeCompare(secondStr);
});
expect(JSON.stringify(initialList) === JSON.stringify(list)).toEqual(true);
});
tasksCloudDemoPage.editTaskFilterCloudComponent().setOrderFilterDropDown('DESC');
tasksCloudDemoPage.taskListCloudComponent().getDataTable().checkSpinnerIsDisplayed();
tasksCloudDemoPage.taskListCloudComponent().getDataTable().checkSpinnerIsNotDisplayed();
tasksCloudDemoPage.taskListCloudComponent().getAllRowsByAssigneeColumn().then((list) => {
const initialList = list.slice(0);
list.sort(function (firstStr, secondStr) {
return firstStr.localeCompare(secondStr);
});
list.reverse();
expect(JSON.stringify(initialList) === JSON.stringify(list)).toEqual(true);
});
});
it('[C306911] Should display tasks sorted by parentTaskId when parentTaskId is selected from sort dropdown', () => {
tasksCloudDemoPage.editTaskFilterCloudComponent().clearAssignee().setStatusFilterDropDown('ALL')
.setSortFilterDropDown('ParentTaskId').setOrderFilterDropDown('ASC');
tasksCloudDemoPage.taskListCloudComponent().getDataTable().checkSpinnerIsDisplayed();
tasksCloudDemoPage.taskListCloudComponent().getDataTable().checkSpinnerIsNotDisplayed();
tasksCloudDemoPage.taskListCloudComponent().getAllRowsByParentTaskIdColumn().then((list) => {
const initialList = list.slice(0);
list.sort(function (firstStr, secondStr) {
return firstStr.localeCompare(secondStr);
});
expect(JSON.stringify(initialList) === JSON.stringify(list)).toEqual(true);
});
tasksCloudDemoPage.editTaskFilterCloudComponent().setOrderFilterDropDown('DESC');
tasksCloudDemoPage.taskListCloudComponent().getDataTable().checkSpinnerIsDisplayed();
tasksCloudDemoPage.taskListCloudComponent().getDataTable().checkSpinnerIsNotDisplayed();
tasksCloudDemoPage.taskListCloudComponent().getAllRowsByParentTaskIdColumn().then((list) => {
const initialList = list.slice(0);
list.sort(function (firstStr, secondStr) {
return firstStr.localeCompare(secondStr);
});
list.reverse();
expect(JSON.stringify(initialList) === JSON.stringify(list)).toEqual(true);
});
});
it('[C306909] Should display tasks sorted by priority when priority is selected from sort dropdown', () => {
tasksCloudDemoPage.editTaskFilterCloudComponent().clearAssignee().setStatusFilterDropDown('ALL')
.setSortFilterDropDown('Priority').setOrderFilterDropDown('ASC');
tasksCloudDemoPage.taskListCloudComponent().getDataTable().checkSpinnerIsDisplayed();
tasksCloudDemoPage.taskListCloudComponent().getDataTable().checkSpinnerIsNotDisplayed();
tasksCloudDemoPage.taskListCloudComponent().getAllRowsByPriorityColumn().then((list) => {
const initialList = list.slice(0);
list.sort(function (firstStr, secondStr) {
return firstStr.localeCompare(secondStr);
});
expect(JSON.stringify(initialList) === JSON.stringify(list)).toEqual(true);
});
tasksCloudDemoPage.editTaskFilterCloudComponent().setOrderFilterDropDown('DESC');
tasksCloudDemoPage.taskListCloudComponent().getDataTable().checkSpinnerIsDisplayed();
tasksCloudDemoPage.taskListCloudComponent().getDataTable().checkSpinnerIsNotDisplayed();
tasksCloudDemoPage.taskListCloudComponent().getAllRowsByPriorityColumn().then((list) => {
const initialList = list.slice(0);
list.sort(function (firstStr, secondStr) {
return firstStr.localeCompare(secondStr);
});
list.reverse();
expect(JSON.stringify(initialList) === JSON.stringify(list)).toEqual(true);
});
});
it('[C307114] Should display tasks sorted by standAlone when standAlone is selected from sort dropdown', () => {
tasksCloudDemoPage.editTaskFilterCloudComponent().clearAssignee().setStatusFilterDropDown('ALL')
.setSortFilterDropDown('StandAlone').setOrderFilterDropDown('ASC');
tasksCloudDemoPage.taskListCloudComponent().getDataTable().checkSpinnerIsDisplayed();
tasksCloudDemoPage.taskListCloudComponent().getDataTable().checkSpinnerIsNotDisplayed();
tasksCloudDemoPage.taskListCloudComponent().getAllRowsByStandAloneColumn().then((list) => {
const initialList = list.slice(0);
list.sort(function (firstStr, secondStr) {
return firstStr.localeCompare(secondStr);
});
expect(JSON.stringify(initialList) === JSON.stringify(list)).toEqual(true);
});
tasksCloudDemoPage.editTaskFilterCloudComponent().setOrderFilterDropDown('DESC');
tasksCloudDemoPage.taskListCloudComponent().getDataTable().checkSpinnerIsDisplayed();
tasksCloudDemoPage.taskListCloudComponent().getDataTable().checkSpinnerIsNotDisplayed();
tasksCloudDemoPage.taskListCloudComponent().getAllRowsByStandAloneColumn().then((list) => {
const initialList = list.slice(0);
list.sort(function (firstStr, secondStr) {
return firstStr.localeCompare(secondStr);
});
list.reverse();
expect(JSON.stringify(initialList) === JSON.stringify(list)).toEqual(true);
});
});
it('[C307115] Should display tasks sorted by owner when owner is selected from sort dropdown', () => {
tasksCloudDemoPage.editTaskFilterCloudComponent().clearAssignee().setStatusFilterDropDown('ALL')
.setSortFilterDropDown('Owner').setOrderFilterDropDown('ASC');
tasksCloudDemoPage.taskListCloudComponent().getDataTable().checkSpinnerIsDisplayed();
tasksCloudDemoPage.taskListCloudComponent().getDataTable().checkSpinnerIsNotDisplayed();
tasksCloudDemoPage.taskListCloudComponent().getAllRowsByOwnerColumn().then((list) => {
const initialList = list.slice(0);
list.sort(function (firstStr, secondStr) {
return firstStr.localeCompare(secondStr);
});
expect(JSON.stringify(initialList) === JSON.stringify(list)).toEqual(true);
});
tasksCloudDemoPage.editTaskFilterCloudComponent().setOrderFilterDropDown('DESC');
tasksCloudDemoPage.taskListCloudComponent().getDataTable().checkSpinnerIsDisplayed();
tasksCloudDemoPage.taskListCloudComponent().getDataTable().checkSpinnerIsNotDisplayed();
tasksCloudDemoPage.taskListCloudComponent().getAllRowsByOwnerColumn().then((list) => {
const initialList = list.slice(0);
list.sort(function (firstStr, secondStr) {
return firstStr.localeCompare(secondStr);
});
list.reverse();
expect(JSON.stringify(initialList) === JSON.stringify(list)).toEqual(true);
});
});
});
});

View File

@ -76,6 +76,36 @@ export class TaskListCloudConfiguration {
'title': 'ADF_CLOUD_TASK_LIST.PROPERTIES.LAST_MODIFIED',
'sortable': true,
'format': 'timeAgo'
},
{
'key': 'entry.assignee',
'type': 'text',
'title': 'ADF_CLOUD_TASK_LIST.PROPERTIES.ASSIGNEE',
'sortable': true
},
{
'key': 'entry.parentTaskId',
'type': 'text',
'title': 'ADF_CLOUD_EDIT_TASK_FILTER.LABEL.PARENT_TASK_ID',
'sortable': true
},
{
'key': 'entry.priority',
'type': 'text',
'title': 'ADF_CLOUD_EDIT_TASK_FILTER.LABEL.PRIORITY',
'sortable': true
},
{
'key': 'entry.standAlone',
'type': 'text',
'title': 'ADF_CLOUD_EDIT_TASK_FILTER.LABEL.STAND_ALONE',
'sortable': true
},
{
'key': 'entry.owner',
'type': 'text',
'title': 'ADF_CLOUD_EDIT_TASK_FILTER.LABEL.OWNER',
'sortable': true
}
]
}

View File

@ -137,58 +137,5 @@ describe('Task filters cloud', () => {
tasksCloudDemoPage.taskListCloudComponent().checkContentIsNotDisplayedByName(completedTaskName);
tasksCloudDemoPage.taskListCloudComponent().checkContentIsNotDisplayedByName(deletedTaskName);
});
it('[C290069] Should display tasks ordered by name when Name is selected from sort dropdown', () => {
tasksCloudDemoPage.editTaskFilterCloudComponent().clickCustomiseFilterHeader().setStatusFilterDropDown('ASSIGNED')
.setSortFilterDropDown('Name').setOrderFilterDropDown('ASC');
tasksCloudDemoPage.taskListCloudComponent().getDataTable().checkSpinnerIsDisplayed();
tasksCloudDemoPage.taskListCloudComponent().getDataTable().checkSpinnerIsNotDisplayed();
tasksCloudDemoPage.taskListCloudComponent().getAllRowsNameColumn().then( (list) => {
const initialList = list.slice(0);
list.sort(function (firstStr, secondStr) {
return firstStr.localeCompare(secondStr);
});
expect(JSON.stringify(initialList) === JSON.stringify(list)).toEqual(true);
});
tasksCloudDemoPage.editTaskFilterCloudComponent().setOrderFilterDropDown('DESC');
tasksCloudDemoPage.taskListCloudComponent().getDataTable().checkSpinnerIsDisplayed();
tasksCloudDemoPage.taskListCloudComponent().getDataTable().checkSpinnerIsNotDisplayed();
tasksCloudDemoPage.taskListCloudComponent().getAllRowsNameColumn().then( (list) => {
const initialList = list.slice(0);
list.sort(function (firstStr, secondStr) {
return firstStr.localeCompare(secondStr);
});
list.reverse();
expect(JSON.stringify(initialList) === JSON.stringify(list)).toEqual(true);
});
});
it('[C290156] Should display tasks ordered by id when Id is selected from sort dropdown', () => {
tasksCloudDemoPage.editTaskFilterCloudComponent().clickCustomiseFilterHeader().setStatusFilterDropDown('ASSIGNED')
.setSortFilterDropDown('Id').setOrderFilterDropDown('ASC');
tasksCloudDemoPage.taskListCloudComponent().getDataTable().checkSpinnerIsDisplayed();
tasksCloudDemoPage.taskListCloudComponent().getDataTable().checkSpinnerIsNotDisplayed();
tasksCloudDemoPage.getAllRowsByIdColumn().then((list) => {
const initialList = list.slice(0);
list.sort(function (firstStr, secondStr) {
return firstStr.localeCompare(secondStr);
});
expect(JSON.stringify(initialList) === JSON.stringify(list)).toEqual(true);
});
tasksCloudDemoPage.editTaskFilterCloudComponent().setOrderFilterDropDown('DESC');
tasksCloudDemoPage.taskListCloudComponent().getDataTable().checkSpinnerIsDisplayed();
tasksCloudDemoPage.taskListCloudComponent().getDataTable().checkSpinnerIsNotDisplayed();
tasksCloudDemoPage.getAllRowsByIdColumn().then((list) => {
const initialList = list.slice(0);
list.sort(function (firstStr, secondStr) {
return firstStr.localeCompare(secondStr);
});
list.reverse();
expect(JSON.stringify(initialList) === JSON.stringify(list)).toEqual(true);
});
});
});
});

View File

@ -20,7 +20,15 @@ import { DataTableComponentPage } from '../../core/pages/data-table-component.pa
import { element, by } from 'protractor';
const column = {
id: 'Id'
id: 'Id',
name: 'Name',
processInstanceId: 'ProcessInstanceId',
processDefinitionId: 'ProcessDefinitionId',
assignee: 'Assignee',
parentTaskId: 'ParentTaskId',
priority: 'Priority',
standAlone: 'StandAlone',
owner: 'Owner'
};
export class TaskListCloudComponentPage {
@ -35,55 +43,55 @@ export class TaskListCloudComponentPage {
}
clickCheckbox(taskName) {
return this.dataTable.clickCheckbox('Name', taskName);
return this.dataTable.clickCheckbox(column.name, taskName);
}
checkRowIsNotChecked(taskName) {
return this.dataTable.checkRowIsNotChecked('Name', taskName);
return this.dataTable.checkRowIsNotChecked(column.name, taskName);
}
checkRowIsChecked(taskName) {
return this.dataTable.checkRowIsChecked('Name', taskName);
return this.dataTable.checkRowIsChecked(column.name, taskName);
}
getRowsWithSameName(taskName) {
return this.dataTable.getRowsWithSameColumnValues('Name', taskName);
return this.dataTable.getRowsWithSameColumnValues(column.name, taskName);
}
checkRowIsSelected(taskName) {
return this.dataTable.checkRowIsSelected('Name', taskName);
return this.dataTable.checkRowIsSelected(column.name, taskName);
}
checkRowIsNotSelected(taskName) {
return this.dataTable.checkRowIsNotSelected('Name', taskName);
return this.dataTable.checkRowIsNotSelected(column.name, taskName);
}
selectRowWithKeyboard(taskName) {
return this.dataTable.selectRowWithKeyboard('Name', taskName);
return this.dataTable.selectRowWithKeyboard(column.name, taskName);
}
selectRow(taskName) {
return this.dataTable.selectRow('Name', taskName);
return this.dataTable.selectRow(column.name, taskName);
}
getRow(taskName) {
return this.dataTable.getCellElementByValue('Name', taskName);
return this.dataTable.getCellElementByValue(column.name, taskName);
}
checkContentIsDisplayedByProcessInstanceId(taskName) {
return this.dataTable.checkContentIsDisplayed('ProcessInstanceId', taskName);
return this.dataTable.checkContentIsDisplayed(column.processInstanceId, taskName);
}
checkContentIsDisplayedById(taskName) {
return this.dataTable.checkContentIsDisplayed('Id', taskName);
return this.dataTable.checkContentIsDisplayed(column.id, taskName);
}
checkContentIsDisplayedByName(taskName) {
return this.dataTable.checkContentIsDisplayed('Name', taskName);
return this.dataTable.checkContentIsDisplayed(column.name, taskName);
}
checkContentIsNotDisplayedByName(taskName) {
return this.dataTable.checkContentIsNotDisplayed('Name', taskName);
return this.dataTable.checkContentIsNotDisplayed(column.name, taskName);
}
checkTaskListIsLoaded() {
@ -97,15 +105,43 @@ export class TaskListCloudComponentPage {
}
getAllRowsNameColumn() {
return this.dataTable.getAllRowsColumnValues('Name');
return this.dataTable.getAllRowsColumnValues(column.name);
}
getAllRowsByColumn(columnName) {
return this.dataTable.getAllRowsColumnValues(columnName);
getAllRowsByIdColumn() {
return this.dataTable.getAllRowsColumnValues(column.id);
}
getAllRowsByProcessDefIdColumn() {
return this.dataTable.getAllRowsColumnValues(column.processDefinitionId);
}
getAllRowsByProcessInstanceIdColumn() {
return this.dataTable.getAllRowsColumnValues(column.processInstanceId);
}
getAllRowsByAssigneeColumn() {
return this.dataTable.getAllRowsColumnValues(column.assignee);
}
getAllRowsByParentTaskIdColumn() {
return this.dataTable.getAllRowsColumnValues(column.parentTaskId);
}
getAllRowsByPriorityColumn() {
return this.dataTable.getAllRowsColumnValues(column.priority);
}
getAllRowsByStandAloneColumn() {
return this.dataTable.getAllRowsColumnValues(column.standAlone);
}
getAllRowsByOwnerColumn() {
return this.dataTable.getAllRowsColumnValues(column.owner);
}
getIdCellValue(rowName) {
const locator = new DataTableComponentPage().getCellByRowContentAndColumn('Name', rowName, column.id);
const locator = new DataTableComponentPage().getCellByRowContentAndColumn(column.name, rowName, column.id);
BrowserVisibility.waitUntilElementIsVisible(locator);
return locator.getText();
}