mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-05-19 17:14:57 +00:00
[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:
parent
32ba281b70
commit
db4d10137e
@ -70,21 +70,13 @@ export class TasksCloudDemoPage {
|
|||||||
return new TaskFiltersCloudComponentPage(this.completedTasks);
|
return new TaskFiltersCloudComponentPage(this.completedTasks);
|
||||||
}
|
}
|
||||||
|
|
||||||
customTaskFilter(filterName) {
|
|
||||||
return new TaskFiltersCloudComponentPage(element(by.css(`span[data-automation-id="${filterName}-filter"]`)));
|
|
||||||
}
|
|
||||||
|
|
||||||
getActiveFilterName() {
|
getActiveFilterName() {
|
||||||
BrowserVisibility.waitUntilElementIsVisible(this.activeFilter);
|
BrowserVisibility.waitUntilElementIsVisible(this.activeFilter);
|
||||||
return this.activeFilter.getText();
|
return this.activeFilter.getText();
|
||||||
}
|
}
|
||||||
|
|
||||||
getAllRowsByIdColumn() {
|
customTaskFilter(filterName) {
|
||||||
return new TaskListCloudComponentPage().getAllRowsByColumn('Id');
|
return new TaskFiltersCloudComponentPage(element(by.css(`span[data-automation-id="${filterName}-filter"]`)));
|
||||||
}
|
|
||||||
|
|
||||||
getAllRowsByProcessDefIdColumn() {
|
|
||||||
return new TaskListCloudComponentPage().getAllRowsByColumn('Process Definition Id');
|
|
||||||
}
|
}
|
||||||
|
|
||||||
clickOnTaskFilters() {
|
clickOnTaskFilters() {
|
||||||
|
@ -21,7 +21,7 @@ import {
|
|||||||
StringUtil, TasksService,
|
StringUtil, TasksService,
|
||||||
ProcessDefinitionsService, ProcessInstancesService,
|
ProcessDefinitionsService, ProcessInstancesService,
|
||||||
LoginSSOPage, ApiService,
|
LoginSSOPage, ApiService,
|
||||||
SettingsPage, AppListCloudPage, LocalStorageUtil
|
SettingsPage, AppListCloudPage, LocalStorageUtil, IdentityService, RolesService
|
||||||
} from '@alfresco/adf-testing';
|
} from '@alfresco/adf-testing';
|
||||||
import { NavigationBarPage } from '../pages/adf/navigationBarPage';
|
import { NavigationBarPage } from '../pages/adf/navigationBarPage';
|
||||||
import { TasksCloudDemoPage } from '../pages/adf/demo-shell/process-services/tasksCloudDemoPage';
|
import { TasksCloudDemoPage } from '../pages/adf/demo-shell/process-services/tasksCloudDemoPage';
|
||||||
@ -31,10 +31,10 @@ import moment = require('moment');
|
|||||||
import { DateUtil } from '../util/dateUtil';
|
import { DateUtil } from '../util/dateUtil';
|
||||||
|
|
||||||
import resources = require('../util/resources');
|
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', () => {
|
||||||
|
|
||||||
describe('Edit task filters and task list properties', () => {
|
|
||||||
const settingsPage = new SettingsPage();
|
const settingsPage = new SettingsPage();
|
||||||
const loginSSOPage = new LoginSSOPage();
|
const loginSSOPage = new LoginSSOPage();
|
||||||
const navigationBarPage = new NavigationBarPage();
|
const navigationBarPage = new NavigationBarPage();
|
||||||
@ -45,13 +45,14 @@ describe('Edit task filters and task list properties', () => {
|
|||||||
let tasksService: TasksService;
|
let tasksService: TasksService;
|
||||||
let processDefinitionService: ProcessDefinitionsService;
|
let processDefinitionService: ProcessDefinitionsService;
|
||||||
let processInstancesService: ProcessInstancesService;
|
let processInstancesService: ProcessInstancesService;
|
||||||
|
let identityService: IdentityService;
|
||||||
|
let rolesService: RolesService;
|
||||||
|
|
||||||
const simpleApp = resources.ACTIVITI7_APPS.SIMPLE_APP.name;
|
const simpleApp = resources.ACTIVITI7_APPS.SIMPLE_APP.name;
|
||||||
const candidateUserApp = resources.ACTIVITI7_APPS.CANDIDATE_USER_APP.name;
|
const candidateUserApp = resources.ACTIVITI7_APPS.CANDIDATE_USER_APP.name;
|
||||||
|
|
||||||
const noTasksFoundMessage = 'No Tasks Found';
|
const noTasksFoundMessage = 'No Tasks Found';
|
||||||
const user = TestConfig.adf.adminEmail, password = TestConfig.adf.adminPassword;
|
const user = TestConfig.adf.adminEmail, password = TestConfig.adf.adminPassword;
|
||||||
let createdTask, notAssigned, notDisplayedTask, processDefinition, processInstance, priorityTask, subTask;
|
let createdTask, notAssigned, notDisplayedTask, processDefinition, processInstance, priorityTask, subTask, otherOwnerTask;
|
||||||
const priority = 30;
|
const priority = 30;
|
||||||
|
|
||||||
const beforeDate = moment().add(-1, 'days').format('DD/MM/YYYY');
|
const beforeDate = moment().add(-1, 'days').format('DD/MM/YYYY');
|
||||||
@ -86,7 +87,13 @@ describe('Edit task filters and task list properties', () => {
|
|||||||
'name',
|
'name',
|
||||||
'createdDate',
|
'createdDate',
|
||||||
'priority',
|
'priority',
|
||||||
'processDefinitionId'
|
'processDefinitionId',
|
||||||
|
'processInstanceId',
|
||||||
|
'parentTaskId',
|
||||||
|
'priority',
|
||||||
|
'standAlone',
|
||||||
|
'owner',
|
||||||
|
'assignee'
|
||||||
],
|
],
|
||||||
'actions': [
|
'actions': [
|
||||||
'save',
|
'save',
|
||||||
@ -97,12 +104,23 @@ describe('Edit task filters and task list properties', () => {
|
|||||||
|
|
||||||
const apiService = new ApiService('activiti', TestConfig.adf.hostBPM, TestConfig.adf.hostSso, 'BPM');
|
const apiService = new ApiService('activiti', TestConfig.adf.hostBPM, TestConfig.adf.hostSso, 'BPM');
|
||||||
await apiService.login(TestConfig.adf.adminEmail, TestConfig.adf.adminPassword);
|
await apiService.login(TestConfig.adf.adminEmail, TestConfig.adf.adminPassword);
|
||||||
|
identityService = new IdentityService(apiService);
|
||||||
|
rolesService = new RolesService(apiService);
|
||||||
tasksService = new TasksService(apiService);
|
tasksService = new TasksService(apiService);
|
||||||
|
|
||||||
|
const apsUser = await identityService.createIdentityUser();
|
||||||
|
const apsUserRoleId = await rolesService.getRoleIdByRoleName(CONSTANTS.ROLES.APS_USER);
|
||||||
|
await identityService.assignRole(apsUser.idIdentityService, apsUserRoleId, CONSTANTS.ROLES.APS_USER);
|
||||||
|
|
||||||
|
await apiService.login(apsUser.email, apsUser.password);
|
||||||
|
otherOwnerTask = await tasksService.createStandaloneTask(StringUtil.generateRandomString(), simpleApp);
|
||||||
|
await tasksService.claimTask(otherOwnerTask.entry.id, simpleApp);
|
||||||
|
|
||||||
|
await apiService.login(TestConfig.adf.adminEmail, TestConfig.adf.adminPassword);
|
||||||
createdTask = await tasksService.createStandaloneTask(StringUtil.generateRandomString(), simpleApp);
|
createdTask = await tasksService.createStandaloneTask(StringUtil.generateRandomString(), simpleApp);
|
||||||
await tasksService.claimTask(createdTask.entry.id, simpleApp);
|
await tasksService.claimTask(createdTask.entry.id, simpleApp);
|
||||||
notAssigned = await tasksService.createStandaloneTask(StringUtil.generateRandomString(), simpleApp);
|
notAssigned = await tasksService.createStandaloneTask(StringUtil.generateRandomString(), simpleApp);
|
||||||
priorityTask = await tasksService.createStandaloneTask(StringUtil.generateRandomString(), simpleApp, { priority: priority });
|
priorityTask = await tasksService.createStandaloneTask(StringUtil.generateRandomString(), simpleApp, {priority: priority});
|
||||||
await tasksService.claimTask(priorityTask.entry.id, simpleApp);
|
await tasksService.claimTask(priorityTask.entry.id, simpleApp);
|
||||||
notDisplayedTask = await tasksService.createStandaloneTask(StringUtil.generateRandomString(), candidateUserApp);
|
notDisplayedTask = await tasksService.createStandaloneTask(StringUtil.generateRandomString(), candidateUserApp);
|
||||||
await tasksService.claimTask(notDisplayedTask.entry.id, candidateUserApp);
|
await tasksService.claimTask(notDisplayedTask.entry.id, candidateUserApp);
|
||||||
@ -118,6 +136,8 @@ describe('Edit task filters and task list properties', () => {
|
|||||||
done();
|
done();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
describe('Edit task filters and task list properties - filter properties', () => {
|
||||||
|
|
||||||
beforeEach((done) => {
|
beforeEach((done) => {
|
||||||
navigationBarPage.navigateToProcessServicesCloudPage();
|
navigationBarPage.navigateToProcessServicesCloudPage();
|
||||||
appListCloudComponent.checkApsContainer();
|
appListCloudComponent.checkApsContainer();
|
||||||
@ -298,7 +318,7 @@ describe('Edit task filters and task list properties', () => {
|
|||||||
expect(tasksCloudDemoPage.taskListCloudComponent().getNoTasksFoundMessage()).toEqual(noTasksFoundMessage);
|
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', () => {
|
'and into lastModifiedTo a date after', () => {
|
||||||
|
|
||||||
tasksCloudDemoPage.myTasksFilter().checkTaskFilterIsDisplayed();
|
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);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
});
|
});
|
||||||
|
@ -76,6 +76,36 @@ export class TaskListCloudConfiguration {
|
|||||||
'title': 'ADF_CLOUD_TASK_LIST.PROPERTIES.LAST_MODIFIED',
|
'title': 'ADF_CLOUD_TASK_LIST.PROPERTIES.LAST_MODIFIED',
|
||||||
'sortable': true,
|
'sortable': true,
|
||||||
'format': 'timeAgo'
|
'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
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
@ -137,58 +137,5 @@ describe('Task filters cloud', () => {
|
|||||||
tasksCloudDemoPage.taskListCloudComponent().checkContentIsNotDisplayedByName(completedTaskName);
|
tasksCloudDemoPage.taskListCloudComponent().checkContentIsNotDisplayedByName(completedTaskName);
|
||||||
tasksCloudDemoPage.taskListCloudComponent().checkContentIsNotDisplayedByName(deletedTaskName);
|
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);
|
|
||||||
});
|
|
||||||
});
|
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
@ -20,7 +20,15 @@ import { DataTableComponentPage } from '../../core/pages/data-table-component.pa
|
|||||||
import { element, by } from 'protractor';
|
import { element, by } from 'protractor';
|
||||||
|
|
||||||
const column = {
|
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 {
|
export class TaskListCloudComponentPage {
|
||||||
@ -35,55 +43,55 @@ export class TaskListCloudComponentPage {
|
|||||||
}
|
}
|
||||||
|
|
||||||
clickCheckbox(taskName) {
|
clickCheckbox(taskName) {
|
||||||
return this.dataTable.clickCheckbox('Name', taskName);
|
return this.dataTable.clickCheckbox(column.name, taskName);
|
||||||
}
|
}
|
||||||
|
|
||||||
checkRowIsNotChecked(taskName) {
|
checkRowIsNotChecked(taskName) {
|
||||||
return this.dataTable.checkRowIsNotChecked('Name', taskName);
|
return this.dataTable.checkRowIsNotChecked(column.name, taskName);
|
||||||
}
|
}
|
||||||
|
|
||||||
checkRowIsChecked(taskName) {
|
checkRowIsChecked(taskName) {
|
||||||
return this.dataTable.checkRowIsChecked('Name', taskName);
|
return this.dataTable.checkRowIsChecked(column.name, taskName);
|
||||||
}
|
}
|
||||||
|
|
||||||
getRowsWithSameName(taskName) {
|
getRowsWithSameName(taskName) {
|
||||||
return this.dataTable.getRowsWithSameColumnValues('Name', taskName);
|
return this.dataTable.getRowsWithSameColumnValues(column.name, taskName);
|
||||||
}
|
}
|
||||||
|
|
||||||
checkRowIsSelected(taskName) {
|
checkRowIsSelected(taskName) {
|
||||||
return this.dataTable.checkRowIsSelected('Name', taskName);
|
return this.dataTable.checkRowIsSelected(column.name, taskName);
|
||||||
}
|
}
|
||||||
|
|
||||||
checkRowIsNotSelected(taskName) {
|
checkRowIsNotSelected(taskName) {
|
||||||
return this.dataTable.checkRowIsNotSelected('Name', taskName);
|
return this.dataTable.checkRowIsNotSelected(column.name, taskName);
|
||||||
}
|
}
|
||||||
|
|
||||||
selectRowWithKeyboard(taskName) {
|
selectRowWithKeyboard(taskName) {
|
||||||
return this.dataTable.selectRowWithKeyboard('Name', taskName);
|
return this.dataTable.selectRowWithKeyboard(column.name, taskName);
|
||||||
}
|
}
|
||||||
|
|
||||||
selectRow(taskName) {
|
selectRow(taskName) {
|
||||||
return this.dataTable.selectRow('Name', taskName);
|
return this.dataTable.selectRow(column.name, taskName);
|
||||||
}
|
}
|
||||||
|
|
||||||
getRow(taskName) {
|
getRow(taskName) {
|
||||||
return this.dataTable.getCellElementByValue('Name', taskName);
|
return this.dataTable.getCellElementByValue(column.name, taskName);
|
||||||
}
|
}
|
||||||
|
|
||||||
checkContentIsDisplayedByProcessInstanceId(taskName) {
|
checkContentIsDisplayedByProcessInstanceId(taskName) {
|
||||||
return this.dataTable.checkContentIsDisplayed('ProcessInstanceId', taskName);
|
return this.dataTable.checkContentIsDisplayed(column.processInstanceId, taskName);
|
||||||
}
|
}
|
||||||
|
|
||||||
checkContentIsDisplayedById(taskName) {
|
checkContentIsDisplayedById(taskName) {
|
||||||
return this.dataTable.checkContentIsDisplayed('Id', taskName);
|
return this.dataTable.checkContentIsDisplayed(column.id, taskName);
|
||||||
}
|
}
|
||||||
|
|
||||||
checkContentIsDisplayedByName(taskName) {
|
checkContentIsDisplayedByName(taskName) {
|
||||||
return this.dataTable.checkContentIsDisplayed('Name', taskName);
|
return this.dataTable.checkContentIsDisplayed(column.name, taskName);
|
||||||
}
|
}
|
||||||
|
|
||||||
checkContentIsNotDisplayedByName(taskName) {
|
checkContentIsNotDisplayedByName(taskName) {
|
||||||
return this.dataTable.checkContentIsNotDisplayed('Name', taskName);
|
return this.dataTable.checkContentIsNotDisplayed(column.name, taskName);
|
||||||
}
|
}
|
||||||
|
|
||||||
checkTaskListIsLoaded() {
|
checkTaskListIsLoaded() {
|
||||||
@ -97,15 +105,43 @@ export class TaskListCloudComponentPage {
|
|||||||
}
|
}
|
||||||
|
|
||||||
getAllRowsNameColumn() {
|
getAllRowsNameColumn() {
|
||||||
return this.dataTable.getAllRowsColumnValues('Name');
|
return this.dataTable.getAllRowsColumnValues(column.name);
|
||||||
}
|
}
|
||||||
|
|
||||||
getAllRowsByColumn(columnName) {
|
getAllRowsByIdColumn() {
|
||||||
return this.dataTable.getAllRowsColumnValues(columnName);
|
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) {
|
getIdCellValue(rowName) {
|
||||||
const locator = new DataTableComponentPage().getCellByRowContentAndColumn('Name', rowName, column.id);
|
const locator = new DataTableComponentPage().getCellByRowContentAndColumn(column.name, rowName, column.id);
|
||||||
BrowserVisibility.waitUntilElementIsVisible(locator);
|
BrowserVisibility.waitUntilElementIsVisible(locator);
|
||||||
return locator.getText();
|
return locator.getText();
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user