mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-24 17:32:15 +00:00
ESLint: cleanup await expect
from protractor tests (#9630)
This commit is contained in:
@@ -15,12 +15,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { createApiService,
|
||||
AppListCloudPage,
|
||||
GroupIdentityService,
|
||||
IdentityService,
|
||||
LoginPage
|
||||
} from '@alfresco/adf-testing';
|
||||
import { createApiService, AppListCloudPage, GroupIdentityService, IdentityService, LoginPage } from '@alfresco/adf-testing';
|
||||
import { browser } from 'protractor';
|
||||
import { ProcessCloudDemoPage } from '../pages/process-cloud-demo.page';
|
||||
import { TasksCloudDemoPage } from '../pages/tasks-cloud-demo.page';
|
||||
@@ -28,7 +23,6 @@ import { NavigationBarPage } from '../../core/pages/navigation-bar.page';
|
||||
import CONSTANTS = require('../../util/constants');
|
||||
|
||||
describe('Edit process filters cloud', () => {
|
||||
|
||||
const simpleApp = browser.params.resources.ACTIVITI_CLOUD_APPS.SIMPLE_APP.name;
|
||||
|
||||
const loginSSOPage = new LoginPage();
|
||||
@@ -43,7 +37,8 @@ describe('Edit process filters cloud', () => {
|
||||
const identityService = new IdentityService(apiService);
|
||||
const groupIdentityService = new GroupIdentityService(apiService);
|
||||
|
||||
let testUser; let groupInfo;
|
||||
let testUser;
|
||||
let groupInfo;
|
||||
|
||||
const PROCESSES = CONSTANTS.PROCESS_FILTERS;
|
||||
|
||||
@@ -75,7 +70,7 @@ describe('Edit process filters cloud', () => {
|
||||
|
||||
it('[C291804] Delete Save and Save as actions should be displayed when clicking on default filter header', async () => {
|
||||
await processFilter.clickAllProcessesFilter();
|
||||
await expect(await processFilter.getActiveFilterName()).toBe('All');
|
||||
expect(await processFilter.getActiveFilterName()).toBe('All');
|
||||
await editProcessFilter.checkSaveButtonIsDisplayed();
|
||||
await editProcessFilter.checkSaveAsButtonIsDisplayed();
|
||||
await editProcessFilter.checkDeleteButtonIsDisplayed();
|
||||
@@ -83,59 +78,59 @@ describe('Edit process filters cloud', () => {
|
||||
|
||||
it('[C586757] Delete Save and Save as actions should be displayed and enabled when clicking on custom filter header', async () => {
|
||||
await createNewProcessCustomFilter('New');
|
||||
await expect(await processFilter.getActiveFilterName()).toBe('New');
|
||||
expect(await processFilter.getActiveFilterName()).toBe('New');
|
||||
await processFilter.clickProcessFilter('custom-new');
|
||||
await editProcessFilter.setSortFilterDropDown('Start Date');
|
||||
await expect(await editProcessFilter.getSortFilterDropDownValue()).toEqual('Start Date');
|
||||
await expect(await editProcessFilter.getOrderFilterDropDownValue()).toEqual('Descending');
|
||||
await expect(await editProcessFilter.getStateFilterDropDownValue()).toEqual('All');
|
||||
expect(await editProcessFilter.getSortFilterDropDownValue()).toEqual('Start Date');
|
||||
expect(await editProcessFilter.getOrderFilterDropDownValue()).toEqual('Descending');
|
||||
expect(await editProcessFilter.getStateFilterDropDownValue()).toEqual('All');
|
||||
|
||||
await editProcessFilter.checkSaveButtonIsDisplayed();
|
||||
await editProcessFilter.checkSaveAsButtonIsDisplayed();
|
||||
await editProcessFilter.checkDeleteButtonIsDisplayed();
|
||||
|
||||
await expect(await editProcessFilter.isCustomFilterNameDisplayed('New')).toEqual(true);
|
||||
await expect(await editProcessFilter.checkSaveButtonIsEnabled()).toEqual(true);
|
||||
await expect(await editProcessFilter.checkSaveAsButtonIsEnabled()).toEqual(true);
|
||||
await expect(await editProcessFilter.checkDeleteButtonIsEnabled()).toEqual(true);
|
||||
expect(await editProcessFilter.isCustomFilterNameDisplayed('New')).toEqual(true);
|
||||
expect(await editProcessFilter.checkSaveButtonIsEnabled()).toEqual(true);
|
||||
expect(await editProcessFilter.checkSaveAsButtonIsEnabled()).toEqual(true);
|
||||
expect(await editProcessFilter.checkDeleteButtonIsEnabled()).toEqual(true);
|
||||
});
|
||||
|
||||
it('[C291805] New process filter is added when clicking Save As button', async () => {
|
||||
await createNewProcessCustomFilter('New');
|
||||
|
||||
await expect(await processFilter.getActiveFilterName()).toBe('New');
|
||||
expect(await processFilter.getActiveFilterName()).toBe('New');
|
||||
|
||||
await expect(await editProcessFilter.getSortFilterDropDownValue()).toEqual('Id');
|
||||
expect(await editProcessFilter.getSortFilterDropDownValue()).toEqual('Id');
|
||||
await processFilter.clickAllProcessesFilter();
|
||||
await expect(await editProcessFilter.getSortFilterDropDownValue()).toEqual('Start Date');
|
||||
expect(await editProcessFilter.getSortFilterDropDownValue()).toEqual('Start Date');
|
||||
await processFilter.clickProcessFilter('custom-new');
|
||||
await expect(await editProcessFilter.getSortFilterDropDownValue()).toEqual('Id');
|
||||
expect(await editProcessFilter.getSortFilterDropDownValue()).toEqual('Id');
|
||||
await editProcessFilter.clickDeleteButton();
|
||||
});
|
||||
|
||||
it('[C291807] A process filter is updated when clicking on save button', async () => {
|
||||
await createNewProcessCustomFilter('New');
|
||||
|
||||
await expect(await processFilter.getActiveFilterName()).toBe('New');
|
||||
expect(await processFilter.getActiveFilterName()).toBe('New');
|
||||
await editProcessFilter.setSortFilterDropDown('Process Name');
|
||||
await expect(await editProcessFilter.getSortFilterDropDownValue()).toEqual('Process Name');
|
||||
expect(await editProcessFilter.getSortFilterDropDownValue()).toEqual('Process Name');
|
||||
await editProcessFilter.clickSaveButton();
|
||||
|
||||
await expect(await processFilter.getActiveFilterName()).toBe('New');
|
||||
await expect(await editProcessFilter.getSortFilterDropDownValue()).toEqual('Process Name');
|
||||
expect(await processFilter.getActiveFilterName()).toBe('New');
|
||||
expect(await editProcessFilter.getSortFilterDropDownValue()).toEqual('Process Name');
|
||||
await editProcessFilter.clickDeleteButton();
|
||||
});
|
||||
|
||||
it('[C291808] A process filter is deleted when clicking on delete button', async () => {
|
||||
await createNewProcessCustomFilter('New');
|
||||
|
||||
await expect(await processFilter.getActiveFilterName()).toBe('New');
|
||||
await expect(await editProcessFilter.getSortFilterDropDownValue()).toEqual('Id');
|
||||
expect(await processFilter.getActiveFilterName()).toBe('New');
|
||||
expect(await editProcessFilter.getSortFilterDropDownValue()).toEqual('Id');
|
||||
await editProcessFilter.clickDeleteButton();
|
||||
|
||||
await browser.driver.sleep(1000);
|
||||
|
||||
await expect(await processFilter.getActiveFilterName()).toBe(CONSTANTS.PROCESS_FILTERS.RUNNING);
|
||||
expect(await processFilter.getActiveFilterName()).toBe(CONSTANTS.PROCESS_FILTERS.RUNNING);
|
||||
await processFilter.checkProcessFilterNotDisplayed('New');
|
||||
});
|
||||
|
||||
@@ -143,15 +138,15 @@ describe('Edit process filters cloud', () => {
|
||||
await editProcessFilter.setSortFilterDropDown('Id');
|
||||
await editProcessFilter.clickSaveAsButton();
|
||||
await editProcessFilter.editProcessFilterDialog().setFilterName('Cancel');
|
||||
await expect(await editProcessFilter.editProcessFilterDialog().getFilterName()).toEqual('Cancel');
|
||||
expect(await editProcessFilter.editProcessFilterDialog().getFilterName()).toEqual('Cancel');
|
||||
await editProcessFilter.editProcessFilterDialog().clickOnCancelButton();
|
||||
await processFilter.checkProcessFilterNotDisplayed('Cancel');
|
||||
await expect(await processFilter.getActiveFilterName()).toEqual(PROCESSES.ALL);
|
||||
expect(await processFilter.getActiveFilterName()).toEqual(PROCESSES.ALL);
|
||||
await processFilter.clickRunningProcessesFilter();
|
||||
await expect(await processFilter.getActiveFilterName()).toEqual(PROCESSES.RUNNING);
|
||||
expect(await processFilter.getActiveFilterName()).toEqual(PROCESSES.RUNNING);
|
||||
await processFilter.clickAllProcessesFilter();
|
||||
await expect(await processFilter.getActiveFilterName()).toEqual(PROCESSES.ALL);
|
||||
await expect(await editProcessFilter.getSortFilterDropDownValue()).toEqual('Start Date');
|
||||
expect(await processFilter.getActiveFilterName()).toEqual(PROCESSES.ALL);
|
||||
expect(await editProcessFilter.getSortFilterDropDownValue()).toEqual('Start Date');
|
||||
await editProcessFilter.closeFilter();
|
||||
});
|
||||
|
||||
@@ -162,9 +157,9 @@ describe('Edit process filters cloud', () => {
|
||||
const dialog = editProcessFilter.editProcessFilterDialog();
|
||||
await dialog.clearFilterName();
|
||||
|
||||
await expect(await dialog.getFilterName()).toEqual('');
|
||||
await expect(await dialog.checkSaveButtonIsEnabled()).toEqual(false);
|
||||
await expect(await dialog.checkCancelButtonIsEnabled()).toEqual(true);
|
||||
expect(await dialog.getFilterName()).toEqual('');
|
||||
expect(await dialog.checkSaveButtonIsEnabled()).toEqual(false);
|
||||
expect(await dialog.checkCancelButtonIsEnabled()).toEqual(true);
|
||||
await dialog.clickOnCancelButton();
|
||||
});
|
||||
|
||||
@@ -175,13 +170,19 @@ describe('Edit process filters cloud', () => {
|
||||
const dialog = editProcessFilter.editProcessFilterDialog();
|
||||
await dialog.clearFilterName();
|
||||
|
||||
await expect(await dialog.checkCancelButtonIsEnabled()).toEqual(true);
|
||||
await expect(await dialog.checkSaveButtonIsEnabled()).toEqual(false);
|
||||
await expect(await dialog.getTitle()).toEqual('Save filter as');
|
||||
await expect(await dialog.getFilterName()).toEqual('');
|
||||
expect(await dialog.checkCancelButtonIsEnabled()).toEqual(true);
|
||||
expect(await dialog.checkSaveButtonIsEnabled()).toEqual(false);
|
||||
expect(await dialog.getTitle()).toEqual('Save filter as');
|
||||
expect(await dialog.getFilterName()).toEqual('');
|
||||
await dialog.clickOnCancelButton();
|
||||
});
|
||||
|
||||
/**
|
||||
* Create a new process custom filter
|
||||
*
|
||||
* @param name Filter name
|
||||
* @param sort Sort value
|
||||
*/
|
||||
async function createNewProcessCustomFilter(name: string, sort = 'Id'): Promise<void> {
|
||||
await processFilter.clickAllProcessesFilter();
|
||||
await editProcessFilter.setSortFilterDropDown(sort);
|
||||
|
@@ -18,7 +18,8 @@
|
||||
import { browser } from 'protractor';
|
||||
import {
|
||||
AppListCloudPage,
|
||||
StringUtil, createApiService,
|
||||
StringUtil,
|
||||
createApiService,
|
||||
LoginPage,
|
||||
TasksService,
|
||||
IdentityService,
|
||||
@@ -29,7 +30,6 @@ import { NavigationBarPage } from '../../core/pages/navigation-bar.page';
|
||||
import { TasksCloudDemoPage } from './../pages/tasks-cloud-demo.page';
|
||||
|
||||
describe('Edit task filters cloud', () => {
|
||||
|
||||
const simpleApp = browser.params.resources.ACTIVITI_CLOUD_APPS.SIMPLE_APP.name;
|
||||
|
||||
const loginSSOPage = new LoginPage();
|
||||
@@ -46,10 +46,11 @@ describe('Edit task filters cloud', () => {
|
||||
const groupIdentityService = new GroupIdentityService(apiService);
|
||||
const tasksService = new TasksService(apiService);
|
||||
|
||||
let testUser; let groupInfo;
|
||||
let testUser;
|
||||
let groupInfo;
|
||||
|
||||
const completedTaskName = StringUtil.generateRandomString();
|
||||
const assignedTaskName = StringUtil.generateRandomString();
|
||||
const assignedTaskName = StringUtil.generateRandomString();
|
||||
|
||||
/**
|
||||
* Click on the specified task filter
|
||||
@@ -103,10 +104,10 @@ describe('Edit task filters cloud', () => {
|
||||
await clickTaskFilter('my-tasks');
|
||||
await waitTillContentLoaded();
|
||||
|
||||
await expect(await taskFilter.getActiveFilterName()).toBe('My Tasks');
|
||||
await expect(await editTaskFilter.getStatusFilterDropDownValue()).toEqual('Assigned', `Status is no 'Assigned'`);
|
||||
await expect(await editTaskFilter.getSortFilterDropDownValue()).toEqual('createdDate', `Sort filter is not 'createdDate'`);
|
||||
await expect(await editTaskFilter.getOrderFilterDropDownValue()).toEqual('Descending', `Order is not 'Descending'`);
|
||||
expect(await taskFilter.getActiveFilterName()).toBe('My Tasks');
|
||||
expect(await editTaskFilter.getStatusFilterDropDownValue()).toEqual('Assigned');
|
||||
expect(await editTaskFilter.getSortFilterDropDownValue()).toEqual('createdDate');
|
||||
expect(await editTaskFilter.getOrderFilterDropDownValue()).toEqual('Descending');
|
||||
|
||||
await tasksCloudDemoPage.taskListCloudComponent().checkContentIsDisplayedByName(assignedTaskName);
|
||||
await tasksCloudDemoPage.taskListCloudComponent().checkContentIsNotDisplayedByName(completedTaskName);
|
||||
@@ -114,10 +115,10 @@ describe('Edit task filters cloud', () => {
|
||||
await clickTaskFilter('completed-tasks');
|
||||
await waitTillContentLoaded();
|
||||
|
||||
await expect(await taskFilter.getActiveFilterName()).toBe('Completed Tasks');
|
||||
await expect(await editTaskFilter.getStatusFilterDropDownValue()).toEqual('Completed', `Status is not 'Completed'`);
|
||||
await expect(await editTaskFilter.getSortFilterDropDownValue()).toEqual('createdDate', `Sort filter is not 'createdDate'`);
|
||||
await expect(await editTaskFilter.getOrderFilterDropDownValue()).toEqual('Descending', `Order is not 'Descending'`);
|
||||
expect(await taskFilter.getActiveFilterName()).toBe('Completed Tasks');
|
||||
expect(await editTaskFilter.getStatusFilterDropDownValue()).toEqual('Completed');
|
||||
expect(await editTaskFilter.getSortFilterDropDownValue()).toEqual('createdDate');
|
||||
expect(await editTaskFilter.getOrderFilterDropDownValue()).toEqual('Descending');
|
||||
|
||||
await tasksCloudDemoPage.taskListCloudComponent().checkContentIsNotDisplayedByName(assignedTaskName);
|
||||
await tasksCloudDemoPage.taskListCloudComponent().checkContentIsDisplayedByName(completedTaskName);
|
||||
@@ -132,15 +133,15 @@ describe('Edit task filters cloud', () => {
|
||||
await clickTaskFilter('my-tasks');
|
||||
await waitTillContentLoaded();
|
||||
|
||||
await expect(await taskFilter.getActiveFilterName()).toBe('My Tasks');
|
||||
expect(await taskFilter.getActiveFilterName()).toBe('My Tasks');
|
||||
|
||||
await editTaskFilter.checkSaveButtonIsDisplayed();
|
||||
await editTaskFilter.checkSaveAsButtonIsDisplayed();
|
||||
await editTaskFilter.checkDeleteButtonIsDisplayed();
|
||||
|
||||
await expect(await editTaskFilter.checkSaveButtonIsEnabled()).toEqual(false);
|
||||
await expect(await editTaskFilter.checkSaveAsButtonIsEnabled()).toEqual(false);
|
||||
await expect(await editTaskFilter.checkDeleteButtonIsEnabled()).toEqual(false);
|
||||
expect(await editTaskFilter.checkSaveButtonIsEnabled()).toEqual(false);
|
||||
expect(await editTaskFilter.checkSaveAsButtonIsEnabled()).toEqual(false);
|
||||
expect(await editTaskFilter.checkDeleteButtonIsEnabled()).toEqual(false);
|
||||
await editTaskFilter.closeFilter();
|
||||
});
|
||||
|
||||
@@ -154,34 +155,34 @@ describe('Edit task filters cloud', () => {
|
||||
await clickTaskFilter('custom-new');
|
||||
await waitTillContentLoaded();
|
||||
|
||||
await expect(await taskFilter.getActiveFilterName()).toBe('New');
|
||||
expect(await taskFilter.getActiveFilterName()).toBe('New');
|
||||
|
||||
await editTaskFilter.setSortFilterDropDown('priority');
|
||||
await editTaskFilter.checkSaveButtonIsDisplayed();
|
||||
await editTaskFilter.checkSaveAsButtonIsDisplayed();
|
||||
await editTaskFilter.checkDeleteButtonIsDisplayed();
|
||||
|
||||
await expect(await editTaskFilter.checkSaveButtonIsEnabled()).toEqual(true);
|
||||
await expect(await editTaskFilter.checkSaveAsButtonIsEnabled()).toEqual(true);
|
||||
await expect(await editTaskFilter.checkDeleteButtonIsEnabled()).toEqual(true);
|
||||
expect(await editTaskFilter.checkSaveButtonIsEnabled()).toEqual(true);
|
||||
expect(await editTaskFilter.checkSaveAsButtonIsEnabled()).toEqual(true);
|
||||
expect(await editTaskFilter.checkDeleteButtonIsEnabled()).toEqual(true);
|
||||
});
|
||||
|
||||
it('[C291795] New filter is added when clicking Save As button', async () => {
|
||||
await createNewCustomFilter('New');
|
||||
await expect(await taskFilter.getActiveFilterName()).toBe('New');
|
||||
expect(await taskFilter.getActiveFilterName()).toBe('New');
|
||||
await editTaskFilter.openFilter();
|
||||
await expect(await editTaskFilter.checkSaveButtonIsEnabled()).toEqual(false);
|
||||
await expect(await editTaskFilter.getSortFilterDropDownValue()).toEqual('id');
|
||||
await expect(await editTaskFilter.checkSaveAsButtonIsEnabled()).toEqual(false);
|
||||
await expect(await editTaskFilter.checkDeleteButtonIsEnabled()).toEqual(true);
|
||||
expect(await editTaskFilter.checkSaveButtonIsEnabled()).toEqual(false);
|
||||
expect(await editTaskFilter.getSortFilterDropDownValue()).toEqual('id');
|
||||
expect(await editTaskFilter.checkSaveAsButtonIsEnabled()).toEqual(false);
|
||||
expect(await editTaskFilter.checkDeleteButtonIsEnabled()).toEqual(true);
|
||||
await clickTaskFilter('my-tasks');
|
||||
await waitTillContentLoaded();
|
||||
|
||||
await expect(await editTaskFilter.getSortFilterDropDownValue()).toEqual('createdDate');
|
||||
expect(await editTaskFilter.getSortFilterDropDownValue()).toEqual('createdDate');
|
||||
await clickTaskFilter('custom-new');
|
||||
await waitTillContentLoaded();
|
||||
|
||||
await expect(await editTaskFilter.getSortFilterDropDownValue()).toEqual('id');
|
||||
expect(await editTaskFilter.getSortFilterDropDownValue()).toEqual('id');
|
||||
await editTaskFilter.clickDeleteButton();
|
||||
});
|
||||
|
||||
@@ -200,24 +201,24 @@ describe('Edit task filters cloud', () => {
|
||||
await editTaskFilterDialog.setFilterName('New');
|
||||
await editTaskFilterDialog.clickOnSaveButton();
|
||||
|
||||
await expect(await taskFilter.getActiveFilterName()).toBe('New');
|
||||
expect(await taskFilter.getActiveFilterName()).toBe('New');
|
||||
await editTaskFilter.openFilter();
|
||||
|
||||
await expect(await editTaskFilter.getSortFilterDropDownValue()).toEqual('id');
|
||||
expect(await editTaskFilter.getSortFilterDropDownValue()).toEqual('id');
|
||||
await editTaskFilter.setSortFilterDropDown('priority');
|
||||
await editTaskFilter.clickSaveAsButton();
|
||||
await editTaskFilterDialog.setFilterName('New');
|
||||
await editTaskFilterDialog.clickOnSaveButton();
|
||||
|
||||
await expect(await taskFilter.getActiveFilterName()).toBe('New');
|
||||
expect(await taskFilter.getActiveFilterName()).toBe('New');
|
||||
await editTaskFilter.openFilter();
|
||||
await expect(await editTaskFilter.getSortFilterDropDownValue()).toEqual('priority');
|
||||
expect(await editTaskFilter.getSortFilterDropDownValue()).toEqual('priority');
|
||||
await editTaskFilter.clickDeleteButton();
|
||||
await clickTaskFilter('custom-new');
|
||||
await waitTillContentLoaded();
|
||||
|
||||
await editTaskFilter.openFilter();
|
||||
await expect(await editTaskFilter.getSortFilterDropDownValue()).toEqual('id');
|
||||
expect(await editTaskFilter.getSortFilterDropDownValue()).toEqual('id');
|
||||
await editTaskFilter.clickDeleteButton();
|
||||
});
|
||||
|
||||
@@ -236,15 +237,15 @@ describe('Edit task filters cloud', () => {
|
||||
await editTaskFilterDialog.setFilterName('New');
|
||||
await editTaskFilterDialog.clickOnSaveButton();
|
||||
|
||||
await expect(await taskFilter.getActiveFilterName()).toBe('New');
|
||||
expect(await taskFilter.getActiveFilterName()).toBe('New');
|
||||
await editTaskFilter.openFilter();
|
||||
await expect(await editTaskFilter.getSortFilterDropDownValue()).toEqual('id');
|
||||
expect(await editTaskFilter.getSortFilterDropDownValue()).toEqual('id');
|
||||
await editTaskFilter.setSortFilterDropDown('name');
|
||||
await editTaskFilter.clickSaveButton();
|
||||
await editTaskFilter.openFilter();
|
||||
|
||||
await expect(await taskFilter.getActiveFilterName()).toBe('New');
|
||||
await expect(await editTaskFilter.getSortFilterDropDownValue()).toEqual('name');
|
||||
expect(await taskFilter.getActiveFilterName()).toBe('New');
|
||||
expect(await editTaskFilter.getSortFilterDropDownValue()).toEqual('name');
|
||||
await editTaskFilter.clickDeleteButton();
|
||||
});
|
||||
|
||||
@@ -263,12 +264,12 @@ describe('Edit task filters cloud', () => {
|
||||
await editTaskFilterDialog.setFilterName('New');
|
||||
await editTaskFilterDialog.clickOnSaveButton();
|
||||
|
||||
await expect(await taskFilter.getActiveFilterName()).toBe('New');
|
||||
expect(await taskFilter.getActiveFilterName()).toBe('New');
|
||||
await editTaskFilter.openFilter();
|
||||
await expect(await editTaskFilter.getSortFilterDropDownValue()).toEqual('id');
|
||||
expect(await editTaskFilter.getSortFilterDropDownValue()).toEqual('id');
|
||||
await editTaskFilter.clickDeleteButton();
|
||||
|
||||
await expect(await taskFilter.getActiveFilterName()).toBe('My Tasks');
|
||||
expect(await taskFilter.getActiveFilterName()).toBe('My Tasks');
|
||||
await taskFilter.checkTaskFilterNotDisplayed('New');
|
||||
});
|
||||
|
||||
@@ -279,16 +280,16 @@ describe('Edit task filters cloud', () => {
|
||||
await editTaskFilter.openFilter();
|
||||
await editTaskFilter.setSortFilterDropDown('priority');
|
||||
|
||||
await expect(await editTaskFilter.getSortFilterDropDownValue()).toEqual('priority');
|
||||
expect(await editTaskFilter.getSortFilterDropDownValue()).toEqual('priority');
|
||||
await editTaskFilter.clickSaveAsButton();
|
||||
|
||||
await expect(await editTaskFilterDialog.getFilterName()).toEqual('My Tasks');
|
||||
expect(await editTaskFilterDialog.getFilterName()).toEqual('My Tasks');
|
||||
await editTaskFilterDialog.setFilterName('Cancel');
|
||||
await expect(await editTaskFilterDialog.getFilterName()).toEqual('Cancel');
|
||||
expect(await editTaskFilterDialog.getFilterName()).toEqual('Cancel');
|
||||
await editTaskFilterDialog.clickOnCancelButton();
|
||||
|
||||
await taskFilter.checkTaskFilterNotDisplayed('Cancel');
|
||||
await expect(await taskFilter.getActiveFilterName()).toEqual('My Tasks');
|
||||
expect(await taskFilter.getActiveFilterName()).toEqual('My Tasks');
|
||||
|
||||
await clickTaskFilter('completed-tasks');
|
||||
await waitTillContentLoaded();
|
||||
@@ -296,8 +297,8 @@ describe('Edit task filters cloud', () => {
|
||||
await waitTillContentLoaded();
|
||||
await editTaskFilter.openFilter();
|
||||
|
||||
await expect(await taskFilter.getActiveFilterName()).toBe('My Tasks');
|
||||
await expect(await editTaskFilter.getSortFilterDropDownValue()).toEqual('createdDate');
|
||||
expect(await taskFilter.getActiveFilterName()).toBe('My Tasks');
|
||||
expect(await editTaskFilter.getSortFilterDropDownValue()).toEqual('createdDate');
|
||||
|
||||
await editTaskFilter.closeFilter();
|
||||
});
|
||||
@@ -309,14 +310,14 @@ describe('Edit task filters cloud', () => {
|
||||
await editTaskFilter.openFilter();
|
||||
await editTaskFilter.setSortFilterDropDown('id');
|
||||
|
||||
await expect(await editTaskFilter.getSortFilterDropDownValue()).toEqual('id');
|
||||
expect(await editTaskFilter.getSortFilterDropDownValue()).toEqual('id');
|
||||
await editTaskFilter.clickSaveAsButton();
|
||||
|
||||
await expect(await editTaskFilterDialog.getFilterName()).toEqual('My Tasks');
|
||||
expect(await editTaskFilterDialog.getFilterName()).toEqual('My Tasks');
|
||||
await editTaskFilterDialog.clearFilterName();
|
||||
await expect(await editTaskFilterDialog.getFilterName()).toEqual('');
|
||||
await expect(await editTaskFilterDialog.checkSaveButtonIsEnabled()).toEqual(false);
|
||||
await expect(await editTaskFilterDialog.checkCancelButtonIsEnabled()).toEqual(true);
|
||||
expect(await editTaskFilterDialog.getFilterName()).toEqual('');
|
||||
expect(await editTaskFilterDialog.checkSaveButtonIsEnabled()).toEqual(false);
|
||||
expect(await editTaskFilterDialog.checkCancelButtonIsEnabled()).toEqual(true);
|
||||
await editTaskFilterDialog.clickOnCancelButton();
|
||||
});
|
||||
|
||||
@@ -326,13 +327,13 @@ describe('Edit task filters cloud', () => {
|
||||
|
||||
await editTaskFilter.openFilter();
|
||||
await editTaskFilter.setSortFilterDropDown('id');
|
||||
await expect(await editTaskFilter.getSortFilterDropDownValue()).toEqual('id');
|
||||
expect(await editTaskFilter.getSortFilterDropDownValue()).toEqual('id');
|
||||
await editTaskFilter.clickSaveAsButton();
|
||||
|
||||
await expect(await editTaskFilterDialog.checkSaveButtonIsEnabled()).toEqual(true);
|
||||
await expect(await editTaskFilterDialog.checkCancelButtonIsEnabled()).toEqual(true);
|
||||
await expect(await editTaskFilterDialog.getTitle()).toEqual('Save filter as');
|
||||
await expect(await editTaskFilterDialog.getFilterName()).toEqual('My Tasks');
|
||||
expect(await editTaskFilterDialog.checkSaveButtonIsEnabled()).toEqual(true);
|
||||
expect(await editTaskFilterDialog.checkCancelButtonIsEnabled()).toEqual(true);
|
||||
expect(await editTaskFilterDialog.getTitle()).toEqual('Save filter as');
|
||||
expect(await editTaskFilterDialog.getFilterName()).toEqual('My Tasks');
|
||||
await editTaskFilterDialog.clickOnCancelButton();
|
||||
});
|
||||
|
||||
|
@@ -18,7 +18,8 @@
|
||||
import { browser } from 'protractor';
|
||||
import {
|
||||
LoginPage,
|
||||
TasksService, createApiService,
|
||||
TasksService,
|
||||
createApiService,
|
||||
AppListCloudPage,
|
||||
StringUtil,
|
||||
IdentityService,
|
||||
@@ -29,9 +30,7 @@ import { NavigationBarPage } from '../../core/pages/navigation-bar.page';
|
||||
import { TasksCloudDemoPage } from './../pages/tasks-cloud-demo.page';
|
||||
|
||||
describe('Task filters cloud', () => {
|
||||
|
||||
describe('Task Filters', () => {
|
||||
|
||||
const simpleApp = browser.params.resources.ACTIVITI_CLOUD_APPS.SIMPLE_APP.name;
|
||||
|
||||
const loginSSOPage = new LoginPage();
|
||||
@@ -47,9 +46,11 @@ describe('Task filters cloud', () => {
|
||||
const groupIdentityService = new GroupIdentityService(apiService);
|
||||
const tasksService = new TasksService(apiService);
|
||||
|
||||
let testUser; let groupInfo;
|
||||
let testUser;
|
||||
let groupInfo;
|
||||
|
||||
const newTask = StringUtil.generateRandomString(5); const completedTask = StringUtil.generateRandomString(5);
|
||||
const newTask = StringUtil.generateRandomString(5);
|
||||
const completedTask = StringUtil.generateRandomString(5);
|
||||
|
||||
beforeAll(async () => {
|
||||
await apiService.loginWithProfile('identityAdmin');
|
||||
@@ -81,13 +82,13 @@ describe('Task filters cloud', () => {
|
||||
await taskFilter.clickTaskFilter('completed-tasks');
|
||||
await taskList.getDataTable().waitTillContentLoaded();
|
||||
|
||||
await expect(await taskFilter.getActiveFilterName()).toBe('Completed Tasks');
|
||||
expect(await taskFilter.getActiveFilterName()).toBe('Completed Tasks');
|
||||
await taskList.checkContentIsNotDisplayedByName(newTask);
|
||||
|
||||
await taskFilter.clickTaskFilter('my-tasks');
|
||||
await taskList.getDataTable().waitTillContentLoaded();
|
||||
|
||||
await expect(await taskFilter.getActiveFilterName()).toBe('My Tasks');
|
||||
expect(await taskFilter.getActiveFilterName()).toBe('My Tasks');
|
||||
|
||||
await taskList.checkContentIsDisplayedByName(newTask);
|
||||
});
|
||||
@@ -101,13 +102,13 @@ describe('Task filters cloud', () => {
|
||||
await taskFilter.clickTaskFilter('my-tasks');
|
||||
await taskList.getDataTable().waitTillContentLoaded();
|
||||
|
||||
await expect(await taskFilter.getActiveFilterName()).toBe('My Tasks');
|
||||
expect(await taskFilter.getActiveFilterName()).toBe('My Tasks');
|
||||
await taskList.checkContentIsNotDisplayedByName(completedTask);
|
||||
|
||||
await taskFilter.clickTaskFilter('completed-tasks');
|
||||
await taskList.getDataTable().waitTillContentLoaded();
|
||||
|
||||
await expect(await taskFilter.getActiveFilterName()).toBe('Completed Tasks');
|
||||
expect(await taskFilter.getActiveFilterName()).toBe('Completed Tasks');
|
||||
|
||||
await taskList.checkContentIsDisplayedByName(completedTask);
|
||||
});
|
||||
|
@@ -18,20 +18,23 @@
|
||||
import { browser } from 'protractor';
|
||||
import {
|
||||
AppListCloudPage,
|
||||
StringUtil, createApiService,
|
||||
StringUtil,
|
||||
createApiService,
|
||||
LoginPage,
|
||||
TasksService,
|
||||
ProcessDefinitionsService,
|
||||
ProcessInstancesService,
|
||||
TaskHeaderCloudPage,
|
||||
TaskFormCloudComponent,
|
||||
IdentityService, GroupIdentityService, ProcessCloudWidgetPage, FormCloudService
|
||||
IdentityService,
|
||||
GroupIdentityService,
|
||||
ProcessCloudWidgetPage,
|
||||
FormCloudService
|
||||
} from '@alfresco/adf-testing';
|
||||
import { NavigationBarPage } from '../../core/pages/navigation-bar.page';
|
||||
import { TasksCloudDemoPage } from './../pages/tasks-cloud-demo.page';
|
||||
|
||||
describe('Task form cloud component', () => {
|
||||
|
||||
const loginSSOPage = new LoginPage();
|
||||
const navigationBarPage = new NavigationBarPage();
|
||||
const appListCloudComponent = new AppListCloudPage();
|
||||
@@ -46,10 +49,15 @@ describe('Task form cloud component', () => {
|
||||
let processInstancesService: ProcessInstancesService;
|
||||
let identityService: IdentityService;
|
||||
|
||||
let completedTask; let assigneeTask; let toBeCompletedTask; let formValidationsTask; let testUser;
|
||||
let completedTask;
|
||||
let assigneeTask;
|
||||
let toBeCompletedTask;
|
||||
let formValidationsTask;
|
||||
let testUser;
|
||||
const candidateBaseApp = browser.params.resources.ACTIVITI_CLOUD_APPS.CANDIDATE_BASE_APP.name;
|
||||
const simpleApp = browser.params.resources.ACTIVITI_CLOUD_APPS.SIMPLE_APP.name;
|
||||
const completedTaskName = StringUtil.generateRandomString(); const assignedTaskName = StringUtil.generateRandomString();
|
||||
const completedTaskName = StringUtil.generateRandomString();
|
||||
const assignedTaskName = StringUtil.generateRandomString();
|
||||
const apiService = createApiService();
|
||||
const apiServiceHrUser = createApiService();
|
||||
|
||||
@@ -90,7 +98,7 @@ describe('Task form cloud component', () => {
|
||||
identityService = new IdentityService(apiService);
|
||||
const groupIdentityService = new GroupIdentityService(apiService);
|
||||
|
||||
testUser = await identityService.createIdentityUserWithRole( [identityService.ROLES.ACTIVITI_USER]);
|
||||
testUser = await identityService.createIdentityUserWithRole([identityService.ROLES.ACTIVITI_USER]);
|
||||
|
||||
const groupInfo = await groupIdentityService.getGroupInfoByGroupName('hr');
|
||||
await identityService.addUserToGroup(testUser.idIdentityService, groupInfo.id);
|
||||
@@ -103,26 +111,44 @@ describe('Task form cloud component', () => {
|
||||
|
||||
const formCloudService = new FormCloudService(apiServiceHrUser);
|
||||
|
||||
const tabVisibilityFieldsId = await formCloudService.getIdByFormName(simpleApp, browser.params.resources.ACTIVITI_CLOUD_APPS.SIMPLE_APP.forms.tabVisibilityFields.name);
|
||||
const tabVisibilityFieldsId = await formCloudService.getIdByFormName(
|
||||
simpleApp,
|
||||
browser.params.resources.ACTIVITI_CLOUD_APPS.SIMPLE_APP.forms.tabVisibilityFields.name
|
||||
);
|
||||
|
||||
const tabVisibilityVarsId = await formCloudService.getIdByFormName(simpleApp, browser.params.resources.ACTIVITI_CLOUD_APPS.SIMPLE_APP.forms.tabVisibilityVars.name);
|
||||
const tabVisibilityVarsId = await formCloudService.getIdByFormName(
|
||||
simpleApp,
|
||||
browser.params.resources.ACTIVITI_CLOUD_APPS.SIMPLE_APP.forms.tabVisibilityVars.name
|
||||
);
|
||||
|
||||
for (let i = 0; i < 4; i++) {
|
||||
visibilityConditionTasks[i] = await tasksService.createStandaloneTaskWithForm(StringUtil.generateRandomString(),
|
||||
simpleApp, tabVisibilityFieldsId);
|
||||
visibilityConditionTasks[i] = await tasksService.createStandaloneTaskWithForm(
|
||||
StringUtil.generateRandomString(),
|
||||
simpleApp,
|
||||
tabVisibilityFieldsId
|
||||
);
|
||||
await tasksService.claimTask(visibilityConditionTasks[i].entry.id, simpleApp);
|
||||
}
|
||||
|
||||
for (let i = 4; i < 7; i++) {
|
||||
visibilityConditionTasks[i] = await tasksService.createStandaloneTaskWithForm(StringUtil.generateRandomString(),
|
||||
simpleApp, tabVisibilityVarsId);
|
||||
visibilityConditionTasks[i] = await tasksService.createStandaloneTaskWithForm(
|
||||
StringUtil.generateRandomString(),
|
||||
simpleApp,
|
||||
tabVisibilityVarsId
|
||||
);
|
||||
await tasksService.claimTask(visibilityConditionTasks[i].entry.id, simpleApp);
|
||||
}
|
||||
|
||||
const formToTestValidationsKey = await formCloudService.getIdByFormName(browser.params.resources.ACTIVITI_CLOUD_APPS.CANDIDATE_BASE_APP.name,
|
||||
browser.params.resources.ACTIVITI_CLOUD_APPS.CANDIDATE_BASE_APP.forms.formtotestvalidations);
|
||||
const formToTestValidationsKey = await formCloudService.getIdByFormName(
|
||||
browser.params.resources.ACTIVITI_CLOUD_APPS.CANDIDATE_BASE_APP.name,
|
||||
browser.params.resources.ACTIVITI_CLOUD_APPS.CANDIDATE_BASE_APP.forms.formtotestvalidations
|
||||
);
|
||||
|
||||
formValidationsTask = await tasksService.createStandaloneTaskWithForm(StringUtil.generateRandomString(), candidateBaseApp, formToTestValidationsKey);
|
||||
formValidationsTask = await tasksService.createStandaloneTaskWithForm(
|
||||
StringUtil.generateRandomString(),
|
||||
candidateBaseApp,
|
||||
formToTestValidationsKey
|
||||
);
|
||||
await tasksService.claimTask(formValidationsTask.entry.id, candidateBaseApp);
|
||||
|
||||
toBeCompletedTask = await tasksService.createStandaloneTask(StringUtil.generateRandomString(), candidateBaseApp);
|
||||
@@ -134,14 +160,15 @@ describe('Task form cloud component', () => {
|
||||
|
||||
processDefinitionService = new ProcessDefinitionsService(apiServiceHrUser);
|
||||
|
||||
const processDefinition = await processDefinitionService
|
||||
.getProcessDefinitionByName(browser.params.resources.ACTIVITI_CLOUD_APPS.CANDIDATE_BASE_APP.processes.candidateUserProcess, candidateBaseApp);
|
||||
const processDefinition = await processDefinitionService.getProcessDefinitionByName(
|
||||
browser.params.resources.ACTIVITI_CLOUD_APPS.CANDIDATE_BASE_APP.processes.candidateUserProcess,
|
||||
candidateBaseApp
|
||||
);
|
||||
|
||||
processInstancesService = new ProcessInstancesService(apiServiceHrUser);
|
||||
await processInstancesService.createProcessInstance(processDefinition.entry.key, candidateBaseApp);
|
||||
|
||||
await loginSSOPage.login(testUser.username, testUser.password);
|
||||
|
||||
}, 5 * 60 * 1000);
|
||||
|
||||
beforeEach(async () => {
|
||||
@@ -154,8 +181,7 @@ describe('Task form cloud component', () => {
|
||||
try {
|
||||
await apiService.loginWithProfile('identityAdmin');
|
||||
await identityService.deleteIdentityUser(testUser.idIdentityService);
|
||||
} catch (error) {
|
||||
}
|
||||
} catch (error) {}
|
||||
await browser.executeScript('window.sessionStorage.clear();');
|
||||
await browser.executeScript('window.localStorage.clear();');
|
||||
});
|
||||
@@ -175,7 +201,7 @@ describe('Task form cloud component', () => {
|
||||
|
||||
await taskFormCloudComponent.clickCompleteButton();
|
||||
|
||||
await expect(await taskFilter.getActiveFilterName()).toBe(myTasksFilterTitle);
|
||||
expect(await taskFilter.getActiveFilterName()).toBe(myTasksFilterTitle);
|
||||
await taskList.checkContentIsNotDisplayedByName(visibilityConditionTasks[0].entry.name);
|
||||
|
||||
await chooseFilterAndSelectTaskByName(completedTasksFilter, visibilityConditionTasks[0].entry.name);
|
||||
@@ -206,7 +232,7 @@ describe('Task form cloud component', () => {
|
||||
|
||||
await taskFormCloudComponent.clickCompleteButton();
|
||||
|
||||
await expect(await taskFilter.getActiveFilterName()).toBe(myTasksFilterTitle);
|
||||
expect(await taskFilter.getActiveFilterName()).toBe(myTasksFilterTitle);
|
||||
await taskList.checkContentIsNotDisplayedByName(visibilityConditionTasks[1].entry.name);
|
||||
|
||||
await chooseFilterAndSelectTaskByName(completedTasksFilter, visibilityConditionTasks[1].entry.name);
|
||||
@@ -234,7 +260,7 @@ describe('Task form cloud component', () => {
|
||||
await widget.tab().checkTabIsNotDisplayedByLabel(tab.tabFieldVar);
|
||||
await taskFormCloudComponent.clickCompleteButton();
|
||||
|
||||
await expect(await taskFilter.getActiveFilterName()).toBe(myTasksFilterTitle);
|
||||
expect(await taskFilter.getActiveFilterName()).toBe(myTasksFilterTitle);
|
||||
|
||||
await taskList.checkContentIsNotDisplayedByName(visibilityConditionTasks[2].entry.name);
|
||||
|
||||
@@ -254,7 +280,7 @@ describe('Task form cloud component', () => {
|
||||
|
||||
await taskFormCloudComponent.clickCompleteButton();
|
||||
|
||||
await expect(await taskFilter.getActiveFilterName()).toBe(myTasksFilterTitle);
|
||||
expect(await taskFilter.getActiveFilterName()).toBe(myTasksFilterTitle);
|
||||
await taskList.checkContentIsNotDisplayedByName(visibilityConditionTasks[4].entry.name);
|
||||
|
||||
await chooseFilterAndSelectTaskByName(completedTasksFilter, visibilityConditionTasks[4].entry.name);
|
||||
@@ -277,7 +303,7 @@ describe('Task form cloud component', () => {
|
||||
await widget.tab().clickTabByLabel(tab.tabVarField);
|
||||
await widget.textWidget().setValue(widgets.numberOneId, value.displayTab);
|
||||
|
||||
await expect(await taskFormCloudComponent.isCompleteButtonEnabled()).toEqual(false);
|
||||
expect(await taskFormCloudComponent.isCompleteButtonEnabled()).toEqual(false);
|
||||
});
|
||||
|
||||
it('[C315179] Should be able to complete a standalone task with visible tab with valid value for field', async () => {
|
||||
@@ -293,7 +319,7 @@ describe('Task form cloud component', () => {
|
||||
|
||||
await taskFormCloudComponent.clickCompleteButton();
|
||||
|
||||
await expect(await taskFilter.getActiveFilterName()).toBe(myTasksFilterTitle);
|
||||
expect(await taskFilter.getActiveFilterName()).toBe(myTasksFilterTitle);
|
||||
await taskList.checkContentIsNotDisplayedByName(visibilityConditionTasks[6].entry.name);
|
||||
|
||||
await chooseFilterAndSelectTaskByName(completedTasksFilter, visibilityConditionTasks[6].entry.name);
|
||||
@@ -318,7 +344,7 @@ describe('Task form cloud component', () => {
|
||||
await widget.tab().checkTabIsDisplayedByLabel(tab.tabMultipleConditions);
|
||||
await taskFormCloudComponent.clickCompleteButton();
|
||||
|
||||
await expect(await taskFilter.getActiveFilterName()).toBe(myTasksFilterTitle);
|
||||
expect(await taskFilter.getActiveFilterName()).toBe(myTasksFilterTitle);
|
||||
await taskList.checkContentIsNotDisplayedByName(visibilityConditionTasks[3].entry.name);
|
||||
|
||||
await chooseFilterAndSelectTaskByName(completedTasksFilter, visibilityConditionTasks[3].entry.name);
|
||||
@@ -326,6 +352,12 @@ describe('Task form cloud component', () => {
|
||||
await widget.tab().checkTabIsDisplayedByLabel(tab.tabMultipleConditions);
|
||||
});
|
||||
|
||||
/**
|
||||
* Choose a filter and select a task by name
|
||||
*
|
||||
* @param filterName Filter name
|
||||
* @param taskName Task name
|
||||
*/
|
||||
async function chooseFilterAndSelectTaskByName(filterName: string, taskName: string): Promise<void> {
|
||||
await taskFilter.clickTaskFilter(filterName);
|
||||
await taskList.getDataTable().waitTillContentLoaded();
|
||||
@@ -333,16 +365,27 @@ describe('Task form cloud component', () => {
|
||||
await taskList.selectRow(taskName);
|
||||
}
|
||||
|
||||
/**
|
||||
* Select a task by name
|
||||
*
|
||||
* @param taskName Task name
|
||||
*/
|
||||
async function selectTaskByName(taskName: string): Promise<void> {
|
||||
await taskList.checkContentIsDisplayedByName(taskName);
|
||||
await taskList.selectRow(taskName);
|
||||
await taskHeaderCloudPage.checkTaskPropertyListIsDisplayed();
|
||||
}
|
||||
|
||||
/**
|
||||
* Choose a filter
|
||||
*
|
||||
* @param filterName Filter name
|
||||
* @param filterTitle Filter title
|
||||
*/
|
||||
async function chooseFilter(filterName: string, filterTitle: string): Promise<void> {
|
||||
await taskFilter.clickTaskFilter(filterName);
|
||||
await taskList.getDataTable().waitTillContentLoaded();
|
||||
await expect(await taskFilter.getActiveFilterName()).toBe(filterTitle);
|
||||
expect(await taskFilter.getActiveFilterName()).toBe(filterTitle);
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
|
@@ -16,7 +16,8 @@
|
||||
*/
|
||||
|
||||
import { browser, protractor } from 'protractor';
|
||||
import { createApiService,
|
||||
import {
|
||||
createApiService,
|
||||
AppListCloudPage,
|
||||
LoginPage,
|
||||
ProcessCloudWidgetPage,
|
||||
@@ -34,7 +35,6 @@ import { NavigationBarPage } from '../../core/pages/navigation-bar.page';
|
||||
import { TasksCloudDemoPage } from './../pages/tasks-cloud-demo.page';
|
||||
|
||||
describe('Task form cloud component', () => {
|
||||
|
||||
const candidateBaseApp = browser.params.resources.ACTIVITI_CLOUD_APPS.CANDIDATE_BASE_APP.name;
|
||||
const candidateBaseAppProcesses = browser.params.resources.ACTIVITI_CLOUD_APPS.CANDIDATE_BASE_APP.processes;
|
||||
const simpleApp = browser.params.resources.ACTIVITI_CLOUD_APPS.SIMPLE_APP.name;
|
||||
@@ -61,7 +61,8 @@ describe('Task form cloud component', () => {
|
||||
const processInstancesService = new ProcessInstancesService(apiService);
|
||||
const formCloudService = new FormCloudService(apiService);
|
||||
|
||||
const completedTaskName = StringUtil.generateRandomString(); const assignedTaskName = StringUtil.generateRandomString();
|
||||
const completedTaskName = StringUtil.generateRandomString();
|
||||
const assignedTaskName = StringUtil.generateRandomString();
|
||||
const myTasksFilter = 'my-tasks';
|
||||
const completedTasksFilter = 'completed-tasks';
|
||||
const dateFieldId = 'Date0rzbb6';
|
||||
@@ -69,8 +70,20 @@ describe('Task form cloud component', () => {
|
||||
const changedDate = '2020-07-10';
|
||||
const dropdownFieldId = 'DropdownOptions';
|
||||
|
||||
let completedTask; let createdTask; let assigneeTask; let toBeCompletedTask; let formValidationsTask; let formTaskId; let assigneeTaskId; let assigneeReleaseTask; let candidateUsersTask ;
|
||||
let dateTimerTaskId; let dateTimerTask; let dateTimerChangedTaskId; let dateTimerChangedTask; let dropdownOptionsTask;
|
||||
let completedTask;
|
||||
let createdTask;
|
||||
let assigneeTask;
|
||||
let toBeCompletedTask;
|
||||
let formValidationsTask;
|
||||
let formTaskId;
|
||||
let assigneeTaskId;
|
||||
let assigneeReleaseTask;
|
||||
let candidateUsersTask;
|
||||
let dateTimerTaskId;
|
||||
let dateTimerTask;
|
||||
let dateTimerChangedTaskId;
|
||||
let dateTimerChangedTask;
|
||||
let dropdownOptionsTask;
|
||||
|
||||
beforeAll(async () => {
|
||||
try {
|
||||
@@ -80,10 +93,16 @@ describe('Task form cloud component', () => {
|
||||
assigneeTask = await tasksService.createStandaloneTask(StringUtil.generateRandomString(), candidateBaseApp);
|
||||
await tasksService.claimTask(assigneeTask.entry.id, candidateBaseApp);
|
||||
|
||||
const formToTestValidationsKey = await formCloudService.getIdByFormName(candidateBaseApp,
|
||||
browser.params.resources.ACTIVITI_CLOUD_APPS.CANDIDATE_BASE_APP.forms.formtotestvalidations);
|
||||
const formToTestValidationsKey = await formCloudService.getIdByFormName(
|
||||
candidateBaseApp,
|
||||
browser.params.resources.ACTIVITI_CLOUD_APPS.CANDIDATE_BASE_APP.forms.formtotestvalidations
|
||||
);
|
||||
|
||||
formValidationsTask = await tasksService.createStandaloneTaskWithForm(StringUtil.generateRandomString(), candidateBaseApp, formToTestValidationsKey);
|
||||
formValidationsTask = await tasksService.createStandaloneTaskWithForm(
|
||||
StringUtil.generateRandomString(),
|
||||
candidateBaseApp,
|
||||
formToTestValidationsKey
|
||||
);
|
||||
await tasksService.claimTask(formValidationsTask.entry.id, candidateBaseApp);
|
||||
|
||||
toBeCompletedTask = await tasksService.createStandaloneTask(StringUtil.generateRandomString(), candidateBaseApp);
|
||||
@@ -93,8 +112,10 @@ describe('Task form cloud component', () => {
|
||||
await tasksService.claimTask(completedTask.entry.id, candidateBaseApp);
|
||||
await tasksService.createAndCompleteTask(completedTaskName, candidateBaseApp);
|
||||
|
||||
let processDefinition = await processDefinitionService
|
||||
.getProcessDefinitionByName(candidateBaseAppProcesses.candidateUserProcess, candidateBaseApp);
|
||||
let processDefinition = await processDefinitionService.getProcessDefinitionByName(
|
||||
candidateBaseAppProcesses.candidateUserProcess,
|
||||
candidateBaseApp
|
||||
);
|
||||
|
||||
const candidateUsersProcessInstance = await processInstancesService.createProcessInstance(processDefinition.entry.key, candidateBaseApp);
|
||||
|
||||
@@ -102,26 +123,31 @@ describe('Task form cloud component', () => {
|
||||
candidateUsersTask = processInstanceTasks.list.entries[0];
|
||||
await tasksService.claimTask(candidateUsersTask.entry.id, candidateBaseApp);
|
||||
|
||||
processDefinition = await processDefinitionService
|
||||
.getProcessDefinitionByName(candidateBaseAppProcesses.candidateUserProcess, candidateBaseApp);
|
||||
processDefinition = await processDefinitionService.getProcessDefinitionByName(
|
||||
candidateBaseAppProcesses.candidateUserProcess,
|
||||
candidateBaseApp
|
||||
);
|
||||
|
||||
const formProcess = await processInstancesService.createProcessInstance(processDefinition.entry.key, candidateBaseApp);
|
||||
const formTasks = await queryService.getProcessInstanceTasks(formProcess.entry.id, candidateBaseApp);
|
||||
formTaskId = formTasks.list.entries[0].entry.id;
|
||||
|
||||
const dropdownOptionsId = await formCloudService.getIdByFormName(simpleApp, simpleAppForm.dropdownWithOptions.name);
|
||||
dropdownOptionsTask = await tasksService.createStandaloneTaskWithForm(StringUtil.generateRandomString(),
|
||||
simpleApp, dropdownOptionsId);
|
||||
dropdownOptionsTask = await tasksService.createStandaloneTaskWithForm(StringUtil.generateRandomString(), simpleApp, dropdownOptionsId);
|
||||
await tasksService.claimTask(dropdownOptionsTask.entry.id, simpleApp);
|
||||
|
||||
const timerProcessDefinition = await processDefinitionService
|
||||
.getProcessDefinitionByName(simpleAppProcess.intermediateDateProcessVarTimer, simpleApp);
|
||||
const timerProcessDefinition = await processDefinitionService.getProcessDefinitionByName(
|
||||
simpleAppProcess.intermediateDateProcessVarTimer,
|
||||
simpleApp
|
||||
);
|
||||
const dateTimerProcess = await processInstancesService.createProcessInstance(timerProcessDefinition.entry.key, simpleApp);
|
||||
dateTimerTask = await queryService.getProcessInstanceTasks(dateTimerProcess.entry.id, simpleApp);
|
||||
dateTimerTaskId = dateTimerTask.list.entries[0].entry.id;
|
||||
|
||||
const timerChangedProcessDefinition = await processDefinitionService
|
||||
.getProcessDefinitionByName(simpleAppProcess.intermediateDateProcessVarTimer, simpleApp);
|
||||
const timerChangedProcessDefinition = await processDefinitionService.getProcessDefinitionByName(
|
||||
simpleAppProcess.intermediateDateProcessVarTimer,
|
||||
simpleApp
|
||||
);
|
||||
const dateTimerChangedProcess = await processInstancesService.createProcessInstance(timerChangedProcessDefinition.entry.key, simpleApp);
|
||||
dateTimerChangedTask = await queryService.getProcessInstanceTasks(dateTimerChangedProcess.entry.id, simpleApp);
|
||||
dateTimerChangedTaskId = dateTimerChangedTask.list.entries[0].entry.id;
|
||||
@@ -136,7 +162,6 @@ describe('Task form cloud component', () => {
|
||||
} catch (error) {
|
||||
Logger.error('Error in beforeAll: ', error);
|
||||
}
|
||||
|
||||
}, 5 * 60 * 1000);
|
||||
|
||||
beforeEach(async () => {
|
||||
@@ -154,7 +179,7 @@ describe('Task form cloud component', () => {
|
||||
await taskFilter.clickTaskFilter(myTasksFilter);
|
||||
await taskList.getDataTable().waitTillContentLoaded();
|
||||
|
||||
await expect(taskFilter.getActiveFilterName()).toBe('My Tasks');
|
||||
expect(taskFilter.getActiveFilterName()).toBe('My Tasks');
|
||||
await editTaskFilter.openFilter();
|
||||
await editTaskFilter.clearAssignee();
|
||||
await editTaskFilter.setStatusFilterDropDown('Created');
|
||||
@@ -189,8 +214,8 @@ describe('Task form cloud component', () => {
|
||||
await appListCloudComponent.goToApp(simpleApp);
|
||||
await openTaskByIdFromFilters(myTasksFilter, assigneeTaskId);
|
||||
|
||||
await expect(await taskHeaderCloudPage.getAssignee()).toEqual(assigneeReleaseTask.list.entries[0].entry.assignee);
|
||||
await expect(await taskHeaderCloudPage.getStatus()).toEqual('ASSIGNED');
|
||||
expect(await taskHeaderCloudPage.getAssignee()).toEqual(assigneeReleaseTask.list.entries[0].entry.assignee);
|
||||
expect(await taskHeaderCloudPage.getStatus()).toEqual('ASSIGNED');
|
||||
await taskFormCloudComponent.checkReleaseButtonIsNotDisplayed();
|
||||
});
|
||||
|
||||
@@ -200,7 +225,7 @@ describe('Task form cloud component', () => {
|
||||
|
||||
await goToAppOpenDropdownTaskByNameFromFilters(myTasksFilter, dropdownOptionsTask.entry.name);
|
||||
await widget.dropdown().openDropdown(dropdownId);
|
||||
await widget.dropdown().selectOption(selectedOption, dropdownId );
|
||||
await widget.dropdown().selectOption(selectedOption, dropdownId);
|
||||
await taskFormCloudComponent.checkSaveButtonIsDisplayed();
|
||||
await taskFormCloudComponent.clickSaveButton();
|
||||
|
||||
@@ -208,7 +233,7 @@ describe('Task form cloud component', () => {
|
||||
await appListCloudComponent.checkApsContainer();
|
||||
await goToAppOpenDropdownTaskByNameFromFilters(myTasksFilter, dropdownOptionsTask.entry.name);
|
||||
|
||||
await expect(await widget.dropdown().getSelectedOptionText(dropdownFieldId)).toBe(selectedOption);
|
||||
expect(await widget.dropdown().getSelectedOptionText(dropdownFieldId)).toBe(selectedOption);
|
||||
});
|
||||
|
||||
it('[C313200] Should be able to complete a Task form with process date variable mapped to a Date widget in the form', async () => {
|
||||
@@ -218,10 +243,10 @@ describe('Task form cloud component', () => {
|
||||
await completeTask();
|
||||
await verifyDateCompletedTask(dateTimerTaskId, defaultDate);
|
||||
|
||||
await openTaskByIdFromFilters(myTasksFilter, dateTimerChangedTaskId );
|
||||
await openTaskByIdFromFilters(myTasksFilter, dateTimerChangedTaskId);
|
||||
await verifyDateInput(dateFieldId, defaultDate);
|
||||
await widget.dateWidget().clearDateInput(dateFieldId);
|
||||
await widget.dateWidget().setDateInput(dateFieldId, changedDate );
|
||||
await widget.dateWidget().setDateInput(dateFieldId, changedDate);
|
||||
await completeTask();
|
||||
|
||||
await verifyDateCompletedTask(dateTimerChangedTaskId, changedDate);
|
||||
@@ -234,7 +259,7 @@ describe('Task form cloud component', () => {
|
||||
|
||||
it('[C307032] Should display the appropriate title for the unclaim option of a Task', async () => {
|
||||
await openTaskByIdFromFilters(myTasksFilter, candidateUsersTask.entry.id);
|
||||
await expect(await taskFormCloudComponent.getReleaseButtonText()).toBe('RELEASE');
|
||||
expect(await taskFormCloudComponent.getReleaseButtonText()).toBe('RELEASE');
|
||||
});
|
||||
|
||||
it('[C310142] Empty content is displayed when having a task without form', async () => {
|
||||
@@ -244,10 +269,10 @@ describe('Task form cloud component', () => {
|
||||
await taskList.checkContentIsDisplayedByName(assigneeTask.entry.name);
|
||||
await taskList.selectRow(assigneeTask.entry.name);
|
||||
await taskFormCloudComponent.checkFormIsNotDisplayed();
|
||||
await expect(await taskFormCloudComponent.getFormTitle()).toBe(assigneeTask.entry.name);
|
||||
expect(await taskFormCloudComponent.getFormTitle()).toBe(assigneeTask.entry.name);
|
||||
await taskFormCloudComponent.checkFormContentIsEmpty();
|
||||
await expect(await taskFormCloudComponent.getEmptyFormContentTitle()).toBe(`No form available`);
|
||||
await expect(await taskFormCloudComponent.getEmptyFormContentSubtitle()).toBe(`Attach a form that can be viewed later`);
|
||||
expect(await taskFormCloudComponent.getEmptyFormContentTitle()).toBe(`No form available`);
|
||||
expect(await taskFormCloudComponent.getEmptyFormContentSubtitle()).toBe(`Attach a form that can be viewed later`);
|
||||
});
|
||||
|
||||
it('[C310199] Should not be able to complete a task when required field is empty or invalid data is added to a field', async () => {
|
||||
@@ -261,36 +286,36 @@ describe('Task form cloud component', () => {
|
||||
await taskFormCloudComponent.formFields().checkWidgetIsVisible('Number0klykr');
|
||||
await taskFormCloudComponent.formFields().checkWidgetIsVisible('Amount0mtp1h');
|
||||
|
||||
await expect(await taskFormCloudComponent.isCompleteButtonEnabled()).toBe(false);
|
||||
expect(await taskFormCloudComponent.isCompleteButtonEnabled()).toBe(false);
|
||||
await widget.textWidget().setValue('Text0tma8h', 'Some random text');
|
||||
await expect(await taskFormCloudComponent.isCompleteButtonEnabled()).toBe(true);
|
||||
expect(await taskFormCloudComponent.isCompleteButtonEnabled()).toBe(true);
|
||||
|
||||
await widget.dateWidget().setDateInput('Date0m1moq', 'invalid date');
|
||||
await browser.actions().sendKeys(protractor.Key.ENTER).perform();
|
||||
await expect(await taskFormCloudComponent.isCompleteButtonEnabled()).toBe(false);
|
||||
expect(await taskFormCloudComponent.isCompleteButtonEnabled()).toBe(false);
|
||||
|
||||
await widget.dateWidget().setDateInput('Date0m1moq', '20-10-2018');
|
||||
await browser.actions().sendKeys(protractor.Key.ENTER).perform();
|
||||
await expect(await taskFormCloudComponent.isCompleteButtonEnabled()).toBe(true);
|
||||
expect(await taskFormCloudComponent.isCompleteButtonEnabled()).toBe(true);
|
||||
|
||||
await widget.numberWidget().setFieldValue('Number0klykr', 'invalid number');
|
||||
await expect(await taskFormCloudComponent.isCompleteButtonEnabled()).toBe(false);
|
||||
expect(await taskFormCloudComponent.isCompleteButtonEnabled()).toBe(false);
|
||||
|
||||
await widget.numberWidget().setFieldValue('Number0klykr', '26');
|
||||
await expect(await taskFormCloudComponent.isCompleteButtonEnabled()).toBe(true);
|
||||
expect(await taskFormCloudComponent.isCompleteButtonEnabled()).toBe(true);
|
||||
|
||||
await widget.amountWidget().setFieldValue('Amount0mtp1h', 'invalid amount');
|
||||
await expect(await taskFormCloudComponent.isCompleteButtonEnabled()).toBe(false);
|
||||
expect(await taskFormCloudComponent.isCompleteButtonEnabled()).toBe(false);
|
||||
|
||||
await widget.amountWidget().setFieldValue('Amount0mtp1h', '660');
|
||||
await expect(await taskFormCloudComponent.isCompleteButtonEnabled()).toBe(true);
|
||||
expect(await taskFormCloudComponent.isCompleteButtonEnabled()).toBe(true);
|
||||
});
|
||||
|
||||
it('[C307093] Complete button is not displayed when the task is already completed', async () => {
|
||||
await taskFilter.clickTaskFilter(completedTasksFilter);
|
||||
await taskList.getDataTable().waitTillContentLoaded();
|
||||
|
||||
await expect(await taskFilter.getActiveFilterName()).toBe('Completed Tasks');
|
||||
expect(await taskFilter.getActiveFilterName()).toBe('Completed Tasks');
|
||||
await taskList.checkContentIsDisplayedByName(completedTaskName);
|
||||
await taskList.selectRow(completedTaskName);
|
||||
await taskHeaderCloudPage.checkTaskPropertyListIsDisplayed();
|
||||
@@ -301,7 +326,7 @@ describe('Task form cloud component', () => {
|
||||
await taskFilter.clickTaskFilter(myTasksFilter);
|
||||
await taskList.getDataTable().waitTillContentLoaded();
|
||||
|
||||
await expect(await taskFilter.getActiveFilterName()).toBe('My Tasks');
|
||||
expect(await taskFilter.getActiveFilterName()).toBe('My Tasks');
|
||||
await editTaskFilter.openFilter();
|
||||
|
||||
await editTaskFilter.clearAssignee();
|
||||
@@ -315,12 +340,12 @@ describe('Task form cloud component', () => {
|
||||
await taskFilter.clickTaskFilter(myTasksFilter);
|
||||
await taskList.getDataTable().waitTillContentLoaded();
|
||||
|
||||
await expect(await taskFilter.getActiveFilterName()).toBe('My Tasks');
|
||||
expect(await taskFilter.getActiveFilterName()).toBe('My Tasks');
|
||||
|
||||
await selectTaskByName(assigneeTask.entry.name);
|
||||
await taskFormCloudComponent.clickCancelButton();
|
||||
|
||||
await expect(await taskFilter.getActiveFilterName()).toBe('My Tasks');
|
||||
expect(await taskFilter.getActiveFilterName()).toBe('My Tasks');
|
||||
await taskList.checkContentIsDisplayedByName(assigneeTask.entry.name);
|
||||
});
|
||||
|
||||
@@ -328,7 +353,7 @@ describe('Task form cloud component', () => {
|
||||
await taskFilter.clickTaskFilter(myTasksFilter);
|
||||
await taskList.getDataTable().waitTillContentLoaded();
|
||||
|
||||
await expect(await taskFilter.getActiveFilterName()).toBe('My Tasks');
|
||||
expect(await taskFilter.getActiveFilterName()).toBe('My Tasks');
|
||||
|
||||
await selectTaskByName(toBeCompletedTask.entry.name);
|
||||
await completeTask();
|
||||
@@ -345,7 +370,7 @@ describe('Task form cloud component', () => {
|
||||
await taskFilter.clickTaskFilter(myTasksFilter);
|
||||
await taskList.getDataTable().waitTillContentLoaded();
|
||||
|
||||
await expect(await taskFilter.getActiveFilterName()).toBe('My Tasks');
|
||||
expect(await taskFilter.getActiveFilterName()).toBe('My Tasks');
|
||||
|
||||
await selectTaskByName(completedTask.entry.name);
|
||||
await completeTask();
|
||||
@@ -359,6 +384,12 @@ describe('Task form cloud component', () => {
|
||||
});
|
||||
});
|
||||
|
||||
/**
|
||||
* Open task by id from filters
|
||||
*
|
||||
* @param filterName Filter name
|
||||
* @param taskId Task id
|
||||
*/
|
||||
async function openTaskByIdFromFilters(filterName: string, taskId: string): Promise<void> {
|
||||
await taskFilter.clickTaskFilter(filterName);
|
||||
await taskList.getDataTable().waitTillContentLoaded();
|
||||
@@ -367,24 +398,47 @@ describe('Task form cloud component', () => {
|
||||
await taskList.selectRowByTaskId(taskId);
|
||||
}
|
||||
|
||||
/**
|
||||
* Verify date input
|
||||
*
|
||||
* @param widgetId Widget id
|
||||
* @param input input value
|
||||
*/
|
||||
async function verifyDateInput(widgetId: string, input: string): Promise<void> {
|
||||
await widget.dateWidget().checkWidgetIsVisible(widgetId);
|
||||
await expect(await widget.dateWidget().getDateInput(widgetId)).toBe(input);
|
||||
expect(await widget.dateWidget().getDateInput(widgetId)).toBe(input);
|
||||
}
|
||||
|
||||
/**
|
||||
* Select task by name
|
||||
*
|
||||
* @param taskName Task name
|
||||
*/
|
||||
async function selectTaskByName(taskName: string): Promise<void> {
|
||||
await taskList.checkContentIsDisplayedByName(taskName);
|
||||
await taskList.selectRow(taskName);
|
||||
await taskHeaderCloudPage.checkTaskPropertyListIsDisplayed();
|
||||
}
|
||||
|
||||
/**
|
||||
* Verify date completed task
|
||||
*
|
||||
* @param taskId Task id
|
||||
* @param input input value
|
||||
*/
|
||||
async function verifyDateCompletedTask(taskId: string, input: string): Promise<void> {
|
||||
await openTaskByIdFromFilters(completedTasksFilter, taskId );
|
||||
await openTaskByIdFromFilters(completedTasksFilter, taskId);
|
||||
await taskFormCloudComponent.checkFormIsReadOnly();
|
||||
await verifyDateInput(dateFieldId, input);
|
||||
await taskFormCloudComponent.clickCancelButton();
|
||||
}
|
||||
|
||||
/**
|
||||
* Go to app open dropdown task by name from filters
|
||||
*
|
||||
* @param filterName Filter name
|
||||
* @param taskName Task name
|
||||
*/
|
||||
async function goToAppOpenDropdownTaskByNameFromFilters(filterName: string, taskName: string): Promise<void> {
|
||||
await appListCloudComponent.goToApp(simpleApp);
|
||||
await taskFilter.clickTaskFilter(filterName);
|
||||
@@ -396,6 +450,9 @@ describe('Task form cloud component', () => {
|
||||
await widget.dropdown().isWidgetVisible(dropdownFieldId);
|
||||
}
|
||||
|
||||
/**
|
||||
* Complete task
|
||||
*/
|
||||
async function completeTask(): Promise<void> {
|
||||
await taskFormCloudComponent.checkCompleteButtonIsDisplayed();
|
||||
await taskFormCloudComponent.clickCompleteButton();
|
||||
|
@@ -16,7 +16,8 @@
|
||||
*/
|
||||
|
||||
import CONSTANTS = require('../../util/constants');
|
||||
import { createApiService,
|
||||
import {
|
||||
createApiService,
|
||||
AppListCloudPage,
|
||||
GroupIdentityService,
|
||||
IdentityService,
|
||||
@@ -34,7 +35,6 @@ import { DateFnsUtils } from '../../../lib/core/src/lib/common/utils/date-fns-ut
|
||||
const isValueInvalid = (value: any): boolean => value === null || value === undefined;
|
||||
|
||||
describe('Task Header cloud component', () => {
|
||||
|
||||
const simpleApp = browser.params.resources.ACTIVITI_CLOUD_APPS.SIMPLE_APP.name;
|
||||
|
||||
const loginSSOPage = new LoginPage();
|
||||
@@ -73,21 +73,24 @@ describe('Task Header cloud component', () => {
|
||||
const formatDate = 'MMM D, YYYY';
|
||||
const dateTimeFormat = 'MMM D, Y, H:mm';
|
||||
|
||||
const createCompletedTask = async function() {
|
||||
const completedTaskId = await tasksService.createStandaloneTask(completedTaskName,
|
||||
simpleApp, { priority, description, dueDate: basicCreatedTask.entry.createdDate });
|
||||
const createCompletedTask = async () => {
|
||||
const completedTaskId = await tasksService.createStandaloneTask(completedTaskName, simpleApp, {
|
||||
priority,
|
||||
description,
|
||||
dueDate: basicCreatedTask.entry.createdDate
|
||||
});
|
||||
await tasksService.claimTask(completedTaskId.entry.id, simpleApp);
|
||||
await tasksService.completeTask(completedTaskId.entry.id, simpleApp);
|
||||
return tasksService.getTask(completedTaskId.entry.id, simpleApp);
|
||||
};
|
||||
|
||||
const createSubTask = async function(createdTaskId) {
|
||||
const createSubTask = async (createdTaskId) => {
|
||||
const subTaskId = await tasksService.createStandaloneSubtask(createdTaskId.entry.id, simpleApp, StringUtil.generateRandomString());
|
||||
await tasksService.claimTask(subTaskId.entry.id, simpleApp);
|
||||
return tasksService.getTask(subTaskId.entry.id, simpleApp);
|
||||
return tasksService.getTask(subTaskId.entry.id, simpleApp);
|
||||
};
|
||||
|
||||
const createTask = async function() {
|
||||
const createTask = async () => {
|
||||
const createdTaskId = await tasksService.createStandaloneTask(basicCreatedTaskName, simpleApp);
|
||||
await tasksService.claimTask(createdTaskId.entry.id, simpleApp);
|
||||
basicCreatedTask = await tasksService.getTask(createdTaskId.entry.id, simpleApp);
|
||||
@@ -98,7 +101,7 @@ describe('Task Header cloud component', () => {
|
||||
beforeAll(async () => {
|
||||
await apiService.loginWithProfile('identityAdmin');
|
||||
|
||||
testUser = await identityService.createIdentityUserWithRole( [identityService.ROLES.ACTIVITI_USER]);
|
||||
testUser = await identityService.createIdentityUserWithRole([identityService.ROLES.ACTIVITI_USER]);
|
||||
groupInfo = await groupIdentityService.getGroupInfoByGroupName('hr');
|
||||
await identityService.addUserToGroup(testUser.idIdentityService, groupInfo.id);
|
||||
await apiService.login(testUser.username, testUser.password);
|
||||
@@ -140,19 +143,24 @@ describe('Task Header cloud component', () => {
|
||||
await tasksCloudDemoPage.waitTillContentLoaded();
|
||||
await taskHeaderCloudPage.checkTaskPropertyListIsDisplayed();
|
||||
|
||||
await expect(await taskHeaderCloudPage.getId()).toEqual(basicCreatedTask.entry.id);
|
||||
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('None');
|
||||
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) ?
|
||||
CONSTANTS.TASK_DETAILS.NO_DATE : basicCreatedDate);
|
||||
await expect(await taskHeaderCloudPage.getEndDate()).toEqual('');
|
||||
await expect(await taskHeaderCloudPage.getCreated()).toEqual(basicCreatedDate);
|
||||
await expect(await taskHeaderCloudPage.getAssignee()).toEqual(isValueInvalid(basicCreatedTask.entry.assignee) ? '' : basicCreatedTask.entry.assignee);
|
||||
await expect(await taskHeaderCloudPage.getParentName()).toEqual(CONSTANTS.TASK_DETAILS.NO_PARENT);
|
||||
expect(await taskHeaderCloudPage.getId()).toEqual(basicCreatedTask.entry.id);
|
||||
expect(await taskHeaderCloudPage.getDescription()).toEqual(
|
||||
isValueInvalid(basicCreatedTask.entry.description) ? CONSTANTS.TASK_DETAILS.NO_DESCRIPTION : basicCreatedTask.entry.description
|
||||
);
|
||||
expect(await taskHeaderCloudPage.getStatus()).toEqual('ASSIGNED');
|
||||
expect(await taskHeaderCloudPage.getPriority()).toEqual('None');
|
||||
expect(await taskHeaderCloudPage.getCategory()).toEqual(
|
||||
!basicCreatedTask.entry.category ? CONSTANTS.TASK_DETAILS.NO_CATEGORY : basicCreatedTask.entry.category
|
||||
);
|
||||
expect(await taskHeaderCloudPage.getDueDate()).toEqual(
|
||||
isValueInvalid(basicCreatedTask.entry.dueDate) ? CONSTANTS.TASK_DETAILS.NO_DATE : basicCreatedDate
|
||||
);
|
||||
expect(await taskHeaderCloudPage.getEndDate()).toEqual('');
|
||||
expect(await taskHeaderCloudPage.getCreated()).toEqual(basicCreatedDate);
|
||||
expect(await taskHeaderCloudPage.getAssignee()).toEqual(
|
||||
isValueInvalid(basicCreatedTask.entry.assignee) ? '' : basicCreatedTask.entry.assignee
|
||||
);
|
||||
expect(await taskHeaderCloudPage.getParentName()).toEqual(CONSTANTS.TASK_DETAILS.NO_PARENT);
|
||||
});
|
||||
|
||||
it('[C291944] Should display task details for completed task', async () => {
|
||||
@@ -164,19 +172,22 @@ describe('Task Header cloud component', () => {
|
||||
await tasksCloudDemoPage.waitTillContentLoaded();
|
||||
await taskHeaderCloudPage.checkTaskPropertyListIsDisplayed();
|
||||
|
||||
await expect(await taskHeaderCloudPage.getId()).toEqual(completedTask.entry.id);
|
||||
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.getReadonlyPriority()).toEqual('None');
|
||||
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) ?
|
||||
CONSTANTS.TASK_DETAILS.NO_DATE : dueDate);
|
||||
await expect(await taskHeaderCloudPage.getEndDate()).toEqual(completedEndDate);
|
||||
await expect(await taskHeaderCloudPage.getCreated()).toEqual(completedCreatedDate);
|
||||
await expect(await taskHeaderCloudPage.getAssignee()).toEqual(isValueInvalid(completedTask.entry.assignee) ? '' : completedTask.entry.assignee);
|
||||
await expect(await taskHeaderCloudPage.getParentName()).toEqual(CONSTANTS.TASK_DETAILS.NO_PARENT);
|
||||
expect(await taskHeaderCloudPage.getId()).toEqual(completedTask.entry.id);
|
||||
expect(await taskHeaderCloudPage.getDescription()).toEqual(
|
||||
isValueInvalid(completedTask.entry.description) ? CONSTANTS.TASK_DETAILS.NO_DESCRIPTION : completedTask.entry.description
|
||||
);
|
||||
expect(await taskHeaderCloudPage.getStatus()).toEqual('COMPLETED');
|
||||
expect(await taskHeaderCloudPage.getReadonlyPriority()).toEqual('None');
|
||||
expect(await taskHeaderCloudPage.getCategory()).toEqual(
|
||||
!completedTask.entry.category ? CONSTANTS.TASK_DETAILS.NO_CATEGORY : completedTask.entry.category
|
||||
);
|
||||
expect(await taskHeaderCloudPage.getDueDate()).toEqual(
|
||||
isValueInvalid(completedTask.entry.dueDate) ? CONSTANTS.TASK_DETAILS.NO_DATE : dueDate
|
||||
);
|
||||
expect(await taskHeaderCloudPage.getEndDate()).toEqual(completedEndDate);
|
||||
expect(await taskHeaderCloudPage.getCreated()).toEqual(completedCreatedDate);
|
||||
expect(await taskHeaderCloudPage.getAssignee()).toEqual(isValueInvalid(completedTask.entry.assignee) ? '' : completedTask.entry.assignee);
|
||||
expect(await taskHeaderCloudPage.getParentName()).toEqual(CONSTANTS.TASK_DETAILS.NO_PARENT);
|
||||
});
|
||||
|
||||
it('[C291945] Should Parent Name and Parent Id not be empty in task details for sub task', async () => {
|
||||
@@ -188,20 +199,23 @@ describe('Task Header cloud component', () => {
|
||||
await tasksCloudDemoPage.waitTillContentLoaded();
|
||||
await taskHeaderCloudPage.checkTaskPropertyListIsDisplayed();
|
||||
|
||||
await expect(await taskHeaderCloudPage.getId()).toEqual(subTask.entry.id);
|
||||
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('None');
|
||||
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);
|
||||
await expect(await taskHeaderCloudPage.getEndDate()).toEqual('');
|
||||
await expect(await taskHeaderCloudPage.getCreated()).toEqual(subTaskCreatedDate);
|
||||
await expect(await taskHeaderCloudPage.getAssignee()).toEqual(isValueInvalid(subTask.entry.assignee) ? '' : subTask.entry.assignee);
|
||||
await expect(await taskHeaderCloudPage.getParentName()).toEqual(basicCreatedTask.entry.name);
|
||||
await expect(await taskHeaderCloudPage.getParentTaskId())
|
||||
.toEqual(isValueInvalid(subTask.entry.parentTaskId) ? '' : subTask.entry.parentTaskId);
|
||||
expect(await taskHeaderCloudPage.getId()).toEqual(subTask.entry.id);
|
||||
expect(await taskHeaderCloudPage.getDescription()).toEqual(
|
||||
isValueInvalid(subTask.entry.description) ? CONSTANTS.TASK_DETAILS.NO_DESCRIPTION : subTask.entry.description
|
||||
);
|
||||
expect(await taskHeaderCloudPage.getStatus()).toEqual('ASSIGNED');
|
||||
expect(await taskHeaderCloudPage.getPriority()).toEqual('None');
|
||||
expect(await taskHeaderCloudPage.getCategory()).toEqual(
|
||||
!subTask.entry.category ? CONSTANTS.TASK_DETAILS.NO_CATEGORY : subTask.entry.category
|
||||
);
|
||||
expect(await taskHeaderCloudPage.getDueDate()).toEqual(
|
||||
isValueInvalid(subTask.entry.dueDate) ? CONSTANTS.TASK_DETAILS.NO_DATE : subTaskCreatedDate
|
||||
);
|
||||
expect(await taskHeaderCloudPage.getEndDate()).toEqual('');
|
||||
expect(await taskHeaderCloudPage.getCreated()).toEqual(subTaskCreatedDate);
|
||||
expect(await taskHeaderCloudPage.getAssignee()).toEqual(isValueInvalid(subTask.entry.assignee) ? '' : subTask.entry.assignee);
|
||||
expect(await taskHeaderCloudPage.getParentName()).toEqual(basicCreatedTask.entry.name);
|
||||
expect(await taskHeaderCloudPage.getParentTaskId()).toEqual(isValueInvalid(subTask.entry.parentTaskId) ? '' : subTask.entry.parentTaskId);
|
||||
});
|
||||
|
||||
it('[C309698] Should validate the Priority field', async () => {
|
||||
@@ -216,7 +230,7 @@ describe('Task Header cloud component', () => {
|
||||
await taskHeaderCloudPage.checkTaskPropertyListIsDisplayed();
|
||||
|
||||
const currentAssignee = await taskHeaderCloudPage.assigneeCardTextItem.getFieldValue();
|
||||
await expect(currentAssignee).toBe('No assignee');
|
||||
expect(currentAssignee).toBe('No assignee');
|
||||
|
||||
await taskHeaderCloudPage.priorityCardSelectItem.checkElementIsReadonly();
|
||||
await taskHeaderCloudPage.statusCardTextItem.checkElementIsReadonly();
|
||||
@@ -225,8 +239,8 @@ describe('Task Header cloud component', () => {
|
||||
it('[C291991] Should be able to assign a task only to the users that have access to the selected app', async () => {
|
||||
await tasksCloudDemoPage.clickStartNewTaskButton();
|
||||
const currentAssignee = await peopleCloudComponentPage.getChipAssignee();
|
||||
await expect(currentAssignee).toContain(testUser.firstName);
|
||||
await expect(currentAssignee).toContain(testUser.lastName);
|
||||
expect(currentAssignee).toContain(testUser.firstName);
|
||||
expect(currentAssignee).toContain(testUser.lastName);
|
||||
|
||||
await peopleCloudComponentPage.searchAssignee('hrUser');
|
||||
await peopleCloudComponentPage.selectAssigneeFromList('HR User');
|
||||
|
@@ -17,9 +17,14 @@
|
||||
|
||||
import { browser } from 'protractor';
|
||||
import {
|
||||
StringUtil, TasksService,
|
||||
LoginPage, createApiService,
|
||||
AppListCloudPage, LocalStorageUtil, IdentityService, GroupIdentityService
|
||||
StringUtil,
|
||||
TasksService,
|
||||
LoginPage,
|
||||
createApiService,
|
||||
AppListCloudPage,
|
||||
LocalStorageUtil,
|
||||
IdentityService,
|
||||
GroupIdentityService
|
||||
} from '@alfresco/adf-testing';
|
||||
import { NavigationBarPage } from '../../core/pages/navigation-bar.page';
|
||||
import { TasksCloudDemoPage } from './../pages/tasks-cloud-demo.page';
|
||||
@@ -47,13 +52,21 @@ describe('Edit task filters and task list properties', () => {
|
||||
|
||||
const simpleApp = browser.params.resources.ACTIVITI_CLOUD_APPS.SIMPLE_APP.name;
|
||||
const candidateBaseApp = browser.params.resources.ACTIVITI_CLOUD_APPS.CANDIDATE_BASE_APP.name;
|
||||
let createdTask; let notDisplayedTask; let noPriorityTask; let lowPriorityTask; let normalPriorityTask; let hightPriorityTask; let subTask;
|
||||
let otherOwnerTask; let testUser; let groupInfo;
|
||||
let createdTask;
|
||||
let notDisplayedTask;
|
||||
let noPriorityTask;
|
||||
let lowPriorityTask;
|
||||
let normalPriorityTask;
|
||||
let hightPriorityTask;
|
||||
let subTask;
|
||||
let otherOwnerTask;
|
||||
let testUser;
|
||||
let groupInfo;
|
||||
|
||||
beforeAll(async () => {
|
||||
await apiService.loginWithProfile('identityAdmin');
|
||||
|
||||
testUser = await identityService.createIdentityUserWithRole( [identityService.ROLES.ACTIVITI_USER]);
|
||||
testUser = await identityService.createIdentityUserWithRole([identityService.ROLES.ACTIVITI_USER]);
|
||||
|
||||
groupInfo = await groupIdentityService.getGroupInfoByGroupName('hr');
|
||||
await identityService.addUserToGroup(testUser.idIdentityService, groupInfo.id);
|
||||
@@ -85,42 +98,41 @@ describe('Edit task filters and task list properties', () => {
|
||||
|
||||
await loginSSOPage.login(testUser.username, testUser.password);
|
||||
await LocalStorageUtil.setConfigField('adf-cloud-task-list', JSON.stringify(jsonFile));
|
||||
await LocalStorageUtil.setConfigField('adf-edit-task-filter', JSON.stringify({
|
||||
filterProperties: [
|
||||
'taskId',
|
||||
'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-edit-task-filter',
|
||||
JSON.stringify({
|
||||
filterProperties: [
|
||||
'taskId',
|
||||
'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']
|
||||
})
|
||||
);
|
||||
}, 5 * 60 * 1000);
|
||||
|
||||
afterAll(async () => {
|
||||
@@ -142,10 +154,10 @@ describe('Edit task filters and task list properties', () => {
|
||||
await editTaskFilter.setSortFilterDropDown('name');
|
||||
await editTaskFilter.setOrderFilterDropDown(SORT_ORDER.ASC);
|
||||
|
||||
await expect(await taskList.getDataTable().checkListIsSorted(SORT_ORDER.ASC, 'Task Name')).toBe(true);
|
||||
expect(await taskList.getDataTable().checkListIsSorted(SORT_ORDER.ASC, 'Task Name')).toBe(true);
|
||||
|
||||
await editTaskFilter.setOrderFilterDropDown(SORT_ORDER.DESC);
|
||||
await expect(await taskList.getDataTable().checkListIsSorted(SORT_ORDER.DESC, 'Task Name')).toBe(true);
|
||||
expect(await taskList.getDataTable().checkListIsSorted(SORT_ORDER.DESC, 'Task Name')).toBe(true);
|
||||
});
|
||||
|
||||
it('[C290156] Should display tasks ordered by id when Id is selected from sort dropdown', async () => {
|
||||
@@ -153,20 +165,20 @@ describe('Edit task filters and task list properties', () => {
|
||||
await editTaskFilter.setSortFilterDropDown('id');
|
||||
await editTaskFilter.setOrderFilterDropDown(SORT_ORDER.ASC);
|
||||
|
||||
await expect(await taskList.getDataTable().checkListIsSorted(SORT_ORDER.ASC, 'Id')).toBe(true);
|
||||
expect(await taskList.getDataTable().checkListIsSorted(SORT_ORDER.ASC, 'Id')).toBe(true);
|
||||
|
||||
await editTaskFilter.setOrderFilterDropDown(SORT_ORDER.DESC);
|
||||
await expect(await taskList.getDataTable().checkListIsSorted(SORT_ORDER.DESC, 'Id')).toBe(true);
|
||||
expect(await taskList.getDataTable().checkListIsSorted(SORT_ORDER.DESC, 'Id')).toBe(true);
|
||||
});
|
||||
|
||||
it('[C306903] Should display tasks sorted by processDefinitionId when processDefinitionId is selected from sort dropdown', async () => {
|
||||
await editTaskFilter.setStatusFilterDropDown('Assigned');
|
||||
await editTaskFilter.setSortFilterDropDown('processDefinitionId');
|
||||
await editTaskFilter.setOrderFilterDropDown(SORT_ORDER.ASC);
|
||||
await expect(await taskList.getDataTable().checkListIsSorted(SORT_ORDER.ASC, 'ProcessDefinitionId')).toBe(true);
|
||||
expect(await taskList.getDataTable().checkListIsSorted(SORT_ORDER.ASC, 'ProcessDefinitionId')).toBe(true);
|
||||
|
||||
await editTaskFilter.setOrderFilterDropDown(SORT_ORDER.DESC);
|
||||
await expect(await taskList.getDataTable().checkListIsSorted(SORT_ORDER.DESC, 'ProcessDefinitionId')).toBe(true);
|
||||
expect(await taskList.getDataTable().checkListIsSorted(SORT_ORDER.DESC, 'ProcessDefinitionId')).toBe(true);
|
||||
});
|
||||
|
||||
it('[C306905] Should display tasks sorted by processInstanceId when processInstanceId is selected from sort dropdown', async () => {
|
||||
@@ -174,10 +186,10 @@ describe('Edit task filters and task list properties', () => {
|
||||
await editTaskFilter.setSortFilterDropDown('processInstanceId');
|
||||
await editTaskFilter.setOrderFilterDropDown(SORT_ORDER.ASC);
|
||||
|
||||
await expect(await taskList.getDataTable().checkListIsSorted(SORT_ORDER.ASC, 'ProcessInstanceId')).toBe(true);
|
||||
expect(await taskList.getDataTable().checkListIsSorted(SORT_ORDER.ASC, 'ProcessInstanceId')).toBe(true);
|
||||
|
||||
await editTaskFilter.setOrderFilterDropDown(SORT_ORDER.DESC);
|
||||
await expect(await taskList.getDataTable().checkListIsSorted(SORT_ORDER.DESC, 'ProcessInstanceId')).toBe(true);
|
||||
expect(await taskList.getDataTable().checkListIsSorted(SORT_ORDER.DESC, 'ProcessInstanceId')).toBe(true);
|
||||
});
|
||||
|
||||
it('[C306907] Should display tasks sorted by assignee when assignee is selected from sort dropdown', async () => {
|
||||
@@ -186,10 +198,10 @@ describe('Edit task filters and task list properties', () => {
|
||||
await editTaskFilter.setSortFilterDropDown('assignee');
|
||||
await editTaskFilter.setOrderFilterDropDown(SORT_ORDER.ASC);
|
||||
|
||||
await expect(await taskList.getDataTable().checkListIsSorted(SORT_ORDER.ASC, 'Assignee')).toBe(true);
|
||||
expect(await taskList.getDataTable().checkListIsSorted(SORT_ORDER.ASC, 'Assignee')).toBe(true);
|
||||
|
||||
await editTaskFilter.setOrderFilterDropDown(SORT_ORDER.DESC);
|
||||
await expect(await taskList.getDataTable().checkListIsSorted(SORT_ORDER.DESC, 'Assignee')).toBe(true);
|
||||
expect(await taskList.getDataTable().checkListIsSorted(SORT_ORDER.DESC, 'Assignee')).toBe(true);
|
||||
});
|
||||
|
||||
it('[C306911] Should display tasks sorted by parentTaskId when parentTaskId is selected from sort dropdown', async () => {
|
||||
@@ -198,10 +210,10 @@ describe('Edit task filters and task list properties', () => {
|
||||
await editTaskFilter.setSortFilterDropDown('parentTaskId');
|
||||
await editTaskFilter.setOrderFilterDropDown(SORT_ORDER.ASC);
|
||||
|
||||
await expect(await taskList.getDataTable().checkListIsSorted(SORT_ORDER.ASC, 'ParentTaskId')).toBe(true);
|
||||
expect(await taskList.getDataTable().checkListIsSorted(SORT_ORDER.ASC, 'ParentTaskId')).toBe(true);
|
||||
|
||||
await editTaskFilter.setOrderFilterDropDown(SORT_ORDER.DESC);
|
||||
await expect(await taskList.getDataTable().checkListIsSorted(SORT_ORDER.DESC, 'ParentTaskId')).toBe(true);
|
||||
expect(await taskList.getDataTable().checkListIsSorted(SORT_ORDER.DESC, 'ParentTaskId')).toBe(true);
|
||||
});
|
||||
|
||||
it('[C290087] Should display tasks ordered by priority when Priority is selected from sort dropdown', async () => {
|
||||
@@ -209,10 +221,10 @@ describe('Edit task filters and task list properties', () => {
|
||||
await editTaskFilter.setSortFilterDropDown('priority');
|
||||
await editTaskFilter.setOrderFilterDropDown(SORT_ORDER.ASC);
|
||||
|
||||
await expect(await taskList.getDataTable().checkListIsSorted(SORT_ORDER.ASC, 'Priority', 'PRIORITY')).toBe(true);
|
||||
expect(await taskList.getDataTable().checkListIsSorted(SORT_ORDER.ASC, 'Priority', 'PRIORITY')).toBe(true);
|
||||
|
||||
await editTaskFilter.setOrderFilterDropDown(SORT_ORDER.DESC);
|
||||
await expect(await taskList.getDataTable().checkListIsSorted(SORT_ORDER.DESC, 'Priority', 'PRIORITY')).toBe(true);
|
||||
expect(await taskList.getDataTable().checkListIsSorted(SORT_ORDER.DESC, 'Priority', 'PRIORITY')).toBe(true);
|
||||
});
|
||||
|
||||
it('[C307115] Should display tasks sorted by owner when owner is selected from sort dropdown', async () => {
|
||||
@@ -221,10 +233,10 @@ describe('Edit task filters and task list properties', () => {
|
||||
await editTaskFilter.setSortFilterDropDown('owner');
|
||||
await editTaskFilter.setOrderFilterDropDown(SORT_ORDER.ASC);
|
||||
|
||||
await expect(await taskList.getDataTable().checkListIsSorted(SORT_ORDER.ASC, 'Owner')).toBe(true);
|
||||
expect(await taskList.getDataTable().checkListIsSorted(SORT_ORDER.ASC, 'Owner')).toBe(true);
|
||||
|
||||
await editTaskFilter.setOrderFilterDropDown(SORT_ORDER.DESC);
|
||||
await expect(await taskList.getDataTable().checkListIsSorted(SORT_ORDER.DESC, 'Owner')).toBe(true);
|
||||
expect(await taskList.getDataTable().checkListIsSorted(SORT_ORDER.DESC, 'Owner')).toBe(true);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
@@ -17,10 +17,16 @@
|
||||
|
||||
import { browser } from 'protractor';
|
||||
import {
|
||||
StringUtil, TasksService,
|
||||
ProcessDefinitionsService, ProcessInstancesService,
|
||||
LoginPage, createApiService,
|
||||
AppListCloudPage, LocalStorageUtil, IdentityService, GroupIdentityService
|
||||
StringUtil,
|
||||
TasksService,
|
||||
ProcessDefinitionsService,
|
||||
ProcessInstancesService,
|
||||
LoginPage,
|
||||
createApiService,
|
||||
AppListCloudPage,
|
||||
LocalStorageUtil,
|
||||
IdentityService,
|
||||
GroupIdentityService
|
||||
} from '@alfresco/adf-testing';
|
||||
import { NavigationBarPage } from '../../core/pages/navigation-bar.page';
|
||||
import { TasksCloudDemoPage } from './../pages/tasks-cloud-demo.page';
|
||||
@@ -29,7 +35,6 @@ import { taskFilterConfiguration } from './../config/task-filter.config';
|
||||
import { addDays, format, subDays } from 'date-fns';
|
||||
|
||||
describe('Edit task filters and task list properties', () => {
|
||||
|
||||
const simpleApp = browser.params.resources.ACTIVITI_CLOUD_APPS.SIMPLE_APP.name;
|
||||
const candidateBaseApp = browser.params.resources.ACTIVITI_CLOUD_APPS.CANDIDATE_BASE_APP.name;
|
||||
|
||||
@@ -91,8 +96,10 @@ describe('Edit task filters and task list properties', () => {
|
||||
notDisplayedTask = await tasksService.createStandaloneTask(StringUtil.generateRandomString(), candidateBaseApp);
|
||||
await tasksService.claimTask(notDisplayedTask.entry.id, candidateBaseApp);
|
||||
|
||||
processDefinition = await processDefinitionService
|
||||
.getProcessDefinitionByName(browser.params.resources.ACTIVITI_CLOUD_APPS.SIMPLE_APP.processes.candidateUsersGroup, simpleApp);
|
||||
processDefinition = await processDefinitionService.getProcessDefinitionByName(
|
||||
browser.params.resources.ACTIVITI_CLOUD_APPS.SIMPLE_APP.processes.candidateUsersGroup,
|
||||
simpleApp
|
||||
);
|
||||
|
||||
processInstance = await processInstancesService.createProcessInstance(processDefinition.entry.key, simpleApp);
|
||||
|
||||
@@ -112,7 +119,6 @@ describe('Edit task filters and task list properties', () => {
|
||||
});
|
||||
|
||||
describe('Edit task filters and task list properties - filter properties', () => {
|
||||
|
||||
beforeEach(async () => {
|
||||
await navigationBarPage.navigateToProcessServicesCloudPage();
|
||||
await appListCloudComponent.checkApsContainer();
|
||||
@@ -122,7 +128,7 @@ describe('Edit task filters and task list properties', () => {
|
||||
});
|
||||
|
||||
it('[C292004] Filter by appName', async () => {
|
||||
await expect(await editTaskFilter.getAppNameDropDownValue()).toEqual(simpleApp);
|
||||
expect(await editTaskFilter.getAppNameDropDownValue()).toEqual(simpleApp);
|
||||
await editTaskFilter.closeFilter();
|
||||
|
||||
await taskList.checkContentIsDisplayedByName(createdTask.entry.name);
|
||||
@@ -130,7 +136,7 @@ describe('Edit task filters and task list properties', () => {
|
||||
|
||||
await editTaskFilter.openFilter();
|
||||
await editTaskFilter.setAppNameDropDown(candidateBaseApp);
|
||||
await expect(await editTaskFilter.getAppNameDropDownValue()).toEqual(candidateBaseApp);
|
||||
expect(await editTaskFilter.getAppNameDropDownValue()).toEqual(candidateBaseApp);
|
||||
|
||||
await editTaskFilter.closeFilter();
|
||||
await taskList.checkContentIsDisplayedByName(notDisplayedTask.entry.name);
|
||||
@@ -139,36 +145,36 @@ describe('Edit task filters and task list properties', () => {
|
||||
|
||||
it('[C291906] Should be able to see only the task with specific taskId when typing it in the task Id field', async () => {
|
||||
await editTaskFilter.setId(createdTask.entry.id);
|
||||
await expect(await editTaskFilter.getId()).toEqual(createdTask.entry.id);
|
||||
expect(await editTaskFilter.getId()).toEqual(createdTask.entry.id);
|
||||
await editTaskFilter.closeFilter();
|
||||
await taskList.checkContentIsDisplayedById(createdTask.entry.id);
|
||||
await taskList.getRowsWithSameId(createdTask.entry.id).then(async (list) => {
|
||||
await expect(list.length).toEqual(1);
|
||||
expect(list.length).toEqual(1);
|
||||
});
|
||||
});
|
||||
|
||||
it('[C291907] Should be able to see No tasks found when typing an invalid task id', async () => {
|
||||
await editTaskFilter.setId('invalidId');
|
||||
await expect(await editTaskFilter.getId()).toEqual('invalidId');
|
||||
expect(await editTaskFilter.getId()).toEqual('invalidId');
|
||||
|
||||
await editTaskFilter.closeFilter();
|
||||
await expect(await taskList.getNoTasksFoundMessage()).toEqual(noTasksFoundMessage);
|
||||
expect(await taskList.getNoTasksFoundMessage()).toEqual(noTasksFoundMessage);
|
||||
});
|
||||
|
||||
it('[C297476] Filter by taskName', async () => {
|
||||
await editTaskFilter.setTaskName(createdTask.entry.name);
|
||||
await expect(await editTaskFilter.getTaskName()).toEqual(createdTask.entry.name);
|
||||
expect(await editTaskFilter.getTaskName()).toEqual(createdTask.entry.name);
|
||||
await editTaskFilter.closeFilter();
|
||||
await taskList.getRowsWithSameName(createdTask.entry.name).then(async (list) => {
|
||||
await expect(list.length).toEqual(1);
|
||||
expect(list.length).toEqual(1);
|
||||
});
|
||||
});
|
||||
|
||||
it('[C297613] Should be able to see No tasks found when typing a task name that does not exist', async () => {
|
||||
await editTaskFilter.setTaskName('invalidName');
|
||||
await expect(await editTaskFilter.getTaskName()).toEqual('invalidName');
|
||||
expect(await editTaskFilter.getTaskName()).toEqual('invalidName');
|
||||
await editTaskFilter.closeFilter();
|
||||
await expect(await taskList.getNoTasksFoundMessage()).toEqual(noTasksFoundMessage);
|
||||
expect(await taskList.getNoTasksFoundMessage()).toEqual(noTasksFoundMessage);
|
||||
});
|
||||
|
||||
it('[C297480] Should be able to see only tasks that are part of a specific process when processInstanceId is set', async () => {
|
||||
@@ -177,7 +183,7 @@ describe('Edit task filters and task list properties', () => {
|
||||
await editTaskFilter.clearAssignee();
|
||||
await editTaskFilter.closeFilter();
|
||||
|
||||
await expect(await taskList.getDataTable().getNumberOfRows()).toBe(1);
|
||||
expect(await taskList.getDataTable().getNumberOfRows()).toBe(1);
|
||||
|
||||
await taskList.checkContentIsDisplayedByProcessInstanceId(processInstance.entry.id);
|
||||
});
|
||||
@@ -185,7 +191,7 @@ describe('Edit task filters and task list properties', () => {
|
||||
it('[C297684] Should be able to see No tasks found when typing an invalid processInstanceId', async () => {
|
||||
await editTaskFilter.setProcessInstanceId('invalidTaskId');
|
||||
await editTaskFilter.closeFilter();
|
||||
await expect(await taskList.getNoTasksFoundMessage()).toEqual(noTasksFoundMessage);
|
||||
expect(await taskList.getNoTasksFoundMessage()).toEqual(noTasksFoundMessage);
|
||||
});
|
||||
|
||||
it('[C297478] Should be able to see only tasks that are assigned to a specific user when assignee is set', async () => {
|
||||
@@ -198,7 +204,7 @@ describe('Edit task filters and task list properties', () => {
|
||||
it('[C297686] Should be able to see No tasks found when typing an invalid user to assignee field', async () => {
|
||||
await editTaskFilter.setAssignee('invalid');
|
||||
await editTaskFilter.closeFilter();
|
||||
await expect(await taskList.getNoTasksFoundMessage()).toEqual(noTasksFoundMessage);
|
||||
expect(await taskList.getNoTasksFoundMessage()).toEqual(noTasksFoundMessage);
|
||||
});
|
||||
|
||||
it('[C297482] Should be able to see only tasks with specific priority when priority is set', async () => {
|
||||
@@ -211,7 +217,7 @@ describe('Edit task filters and task list properties', () => {
|
||||
it('[C297687] Should be able to see No tasks found when typing unused value for priority field', async () => {
|
||||
await editTaskFilter.setPriority('Normal');
|
||||
await editTaskFilter.closeFilter();
|
||||
await expect(await taskList.getNoTasksFoundMessage()).toEqual(noTasksFoundMessage);
|
||||
expect(await taskList.getNoTasksFoundMessage()).toEqual(noTasksFoundMessage);
|
||||
});
|
||||
|
||||
it('[C297481] Should be able to see only tasks with specific parentTaskId when parentTaskId is set', async () => {
|
||||
@@ -232,7 +238,7 @@ describe('Edit task filters and task list properties', () => {
|
||||
await editTaskFilter.setOwner('invalid');
|
||||
await editTaskFilter.closeFilter();
|
||||
|
||||
await expect(await taskList.getNoTasksFoundMessage()).toEqual(noTasksFoundMessage);
|
||||
expect(await taskList.getNoTasksFoundMessage()).toEqual(noTasksFoundMessage);
|
||||
});
|
||||
|
||||
it('[C297484] Task is displayed when typing into lastModifiedFrom field a date before the task CreatedDate', async () => {
|
||||
@@ -271,30 +277,39 @@ describe('Edit task filters and task list properties', () => {
|
||||
await taskList.checkContentIsNotDisplayedByName(simpleTask.entry.name);
|
||||
});
|
||||
|
||||
it('[C297691] Task is not displayed when typing into lastModifiedFrom field a date before the task due date ' +
|
||||
'and into lastModifiedTo a date before task due date', async () => {
|
||||
await editTaskFilter.setLastModifiedFrom(beforeDate);
|
||||
await editTaskFilter.setLastModifiedTo(beforeDate);
|
||||
await editTaskFilter.setTaskName(createdTask.entry.name);
|
||||
await editTaskFilter.closeFilter();
|
||||
await expect(await taskList.getNoTasksFoundMessage()).toEqual(noTasksFoundMessage);
|
||||
});
|
||||
it(
|
||||
'[C297691] Task is not displayed when typing into lastModifiedFrom field a date before the task due date ' +
|
||||
'and into lastModifiedTo a date before task due date',
|
||||
async () => {
|
||||
await editTaskFilter.setLastModifiedFrom(beforeDate);
|
||||
await editTaskFilter.setLastModifiedTo(beforeDate);
|
||||
await editTaskFilter.setTaskName(createdTask.entry.name);
|
||||
await editTaskFilter.closeFilter();
|
||||
expect(await taskList.getNoTasksFoundMessage()).toEqual(noTasksFoundMessage);
|
||||
}
|
||||
);
|
||||
|
||||
it('[C297692] Task is displayed when typing into lastModifiedFrom field a date before the tasks due date ' +
|
||||
'and into lastModifiedTo a date after', async () => {
|
||||
await editTaskFilter.setLastModifiedFrom(beforeDate);
|
||||
await editTaskFilter.setLastModifiedTo(afterDate);
|
||||
await editTaskFilter.setTaskName(createdTask.entry.name);
|
||||
await editTaskFilter.closeFilter();
|
||||
await taskList.checkContentIsDisplayedByName(createdTask.entry.name);
|
||||
});
|
||||
it(
|
||||
'[C297692] Task is displayed when typing into lastModifiedFrom field a date before the tasks due date ' +
|
||||
'and into lastModifiedTo a date after',
|
||||
async () => {
|
||||
await editTaskFilter.setLastModifiedFrom(beforeDate);
|
||||
await editTaskFilter.setLastModifiedTo(afterDate);
|
||||
await editTaskFilter.setTaskName(createdTask.entry.name);
|
||||
await editTaskFilter.closeFilter();
|
||||
await taskList.checkContentIsDisplayedByName(createdTask.entry.name);
|
||||
}
|
||||
);
|
||||
|
||||
it('[C297693] Task is not displayed when typing into lastModifiedFrom field a date after the tasks due date ' +
|
||||
'and into lastModifiedTo a date after', async () => {
|
||||
await editTaskFilter.setLastModifiedFrom(afterDate);
|
||||
await editTaskFilter.setLastModifiedTo(afterDate);
|
||||
await editTaskFilter.closeFilter();
|
||||
await expect(await taskList.getNoTasksFoundMessage()).toEqual(noTasksFoundMessage);
|
||||
});
|
||||
it(
|
||||
'[C297693] Task is not displayed when typing into lastModifiedFrom field a date after the tasks due date ' +
|
||||
'and into lastModifiedTo a date after',
|
||||
async () => {
|
||||
await editTaskFilter.setLastModifiedFrom(afterDate);
|
||||
await editTaskFilter.setLastModifiedTo(afterDate);
|
||||
await editTaskFilter.closeFilter();
|
||||
expect(await taskList.getNoTasksFoundMessage()).toEqual(noTasksFoundMessage);
|
||||
}
|
||||
);
|
||||
});
|
||||
});
|
||||
|
@@ -16,7 +16,8 @@
|
||||
*/
|
||||
|
||||
import { browser } from 'protractor';
|
||||
import { createApiService,
|
||||
import {
|
||||
createApiService,
|
||||
AppListCloudPage,
|
||||
GroupIdentityService,
|
||||
IdentityService,
|
||||
@@ -34,7 +35,6 @@ import { ProcessInstanceCloud } from '@alfresco/adf-process-services-cloud';
|
||||
import { taskFilterConfiguration } from './../config/task-filter.config';
|
||||
|
||||
describe('Task claim/release', () => {
|
||||
|
||||
const candidateApp = browser.params.resources.ACTIVITI_CLOUD_APPS.CANDIDATE_BASE_APP;
|
||||
|
||||
const loginSSOPage = new LoginPage();
|
||||
@@ -59,7 +59,10 @@ describe('Task claim/release', () => {
|
||||
describe('candidate user', () => {
|
||||
beforeAll(async () => {
|
||||
await apiService.login(browser.params.testConfig.users.hrUser.username, browser.params.testConfig.users.hrUser.password);
|
||||
const processDefinition = await processDefinitionService.getProcessDefinitionByName(candidateApp.processes.candidateUserProcess, candidateApp.name);
|
||||
const processDefinition = await processDefinitionService.getProcessDefinitionByName(
|
||||
candidateApp.processes.candidateUserProcess,
|
||||
candidateApp.name
|
||||
);
|
||||
processInstance = (await processInstancesService.createProcessInstance(processDefinition.entry.key, candidateApp.name)).entry;
|
||||
});
|
||||
|
||||
@@ -81,7 +84,7 @@ describe('Task claim/release', () => {
|
||||
await taskHeaderCloudPage.checkTaskPropertyListIsDisplayed();
|
||||
|
||||
await taskFormCloudComponent.checkClaimButtonIsDisplayed();
|
||||
await expect(await taskHeaderCloudPage.getAssignee()).toEqual('No assignee');
|
||||
expect(await taskHeaderCloudPage.getAssignee()).toEqual('No assignee');
|
||||
|
||||
await taskFormCloudComponent.clickClaimButton();
|
||||
await browser.refresh();
|
||||
@@ -89,18 +92,17 @@ describe('Task claim/release', () => {
|
||||
|
||||
await taskFormCloudComponent.checkReleaseButtonIsDisplayed();
|
||||
|
||||
await expect(await taskHeaderCloudPage.getStatus()).toEqual('ASSIGNED');
|
||||
await expect(await taskHeaderCloudPage.getAssignee()).toEqual(browser.params.testConfig.users.hrUser.username);
|
||||
expect(await taskHeaderCloudPage.getStatus()).toEqual('ASSIGNED');
|
||||
expect(await taskHeaderCloudPage.getAssignee()).toEqual(browser.params.testConfig.users.hrUser.username);
|
||||
|
||||
await taskFormCloudComponent.clickReleaseButton();
|
||||
await browser.refresh();
|
||||
await taskHeaderCloudPage.checkTaskPropertyListIsDisplayed();
|
||||
|
||||
await taskFormCloudComponent.checkClaimButtonIsDisplayed();
|
||||
await expect(await taskHeaderCloudPage.getStatus()).toEqual('CREATED');
|
||||
await expect(await taskHeaderCloudPage.getAssignee()).toEqual('No assignee');
|
||||
expect(await taskHeaderCloudPage.getStatus()).toEqual('CREATED');
|
||||
expect(await taskHeaderCloudPage.getAssignee()).toEqual('No assignee');
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
describe('candidate group', () => {
|
||||
@@ -113,7 +115,10 @@ describe('Task claim/release', () => {
|
||||
await identityService.addUserToGroup(candidate.idIdentityService, groupInfo.id);
|
||||
|
||||
await apiService.login(browser.params.testConfig.users.hrUser.username, browser.params.testConfig.users.hrUser.password);
|
||||
const processDefinition = await processDefinitionService.getProcessDefinitionByName(candidateApp.processes.uploadFileProcess, candidateApp.name);
|
||||
const processDefinition = await processDefinitionService.getProcessDefinitionByName(
|
||||
candidateApp.processes.uploadFileProcess,
|
||||
candidateApp.name
|
||||
);
|
||||
processInstance = (await processInstancesService.createProcessInstance(processDefinition.entry.key, candidateApp.name)).entry;
|
||||
});
|
||||
|
||||
@@ -135,24 +140,24 @@ describe('Task claim/release', () => {
|
||||
await taskHeaderCloudPage.checkTaskPropertyListIsDisplayed();
|
||||
|
||||
await taskFormCloudComponent.checkClaimButtonIsDisplayed();
|
||||
await expect(await taskHeaderCloudPage.getStatus()).toEqual('CREATED');
|
||||
await expect(await taskHeaderCloudPage.getAssignee()).toEqual('No assignee');
|
||||
expect(await taskHeaderCloudPage.getStatus()).toEqual('CREATED');
|
||||
expect(await taskHeaderCloudPage.getAssignee()).toEqual('No assignee');
|
||||
|
||||
await taskFormCloudComponent.clickClaimButton();
|
||||
await browser.refresh();
|
||||
await taskHeaderCloudPage.checkTaskPropertyListIsDisplayed();
|
||||
|
||||
await taskFormCloudComponent.checkReleaseButtonIsDisplayed();
|
||||
await expect(await taskHeaderCloudPage.getStatus()).toEqual('ASSIGNED');
|
||||
await expect(await taskHeaderCloudPage.getAssignee()).toEqual(browser.params.testConfig.users.hrUser.username);
|
||||
expect(await taskHeaderCloudPage.getStatus()).toEqual('ASSIGNED');
|
||||
expect(await taskHeaderCloudPage.getAssignee()).toEqual(browser.params.testConfig.users.hrUser.username);
|
||||
|
||||
await taskFormCloudComponent.clickReleaseButton();
|
||||
await browser.refresh();
|
||||
await taskHeaderCloudPage.checkTaskPropertyListIsDisplayed();
|
||||
|
||||
await taskFormCloudComponent.checkClaimButtonIsDisplayed();
|
||||
await expect(await taskHeaderCloudPage.getStatus()).toEqual('CREATED');
|
||||
await expect(await taskHeaderCloudPage.getAssignee()).toEqual('No assignee');
|
||||
expect(await taskHeaderCloudPage.getStatus()).toEqual('CREATED');
|
||||
expect(await taskHeaderCloudPage.getAssignee()).toEqual('No assignee');
|
||||
|
||||
await navigationBarPage.clickLogoutButton();
|
||||
await navigateToApp(candidate);
|
||||
@@ -163,29 +168,38 @@ describe('Task claim/release', () => {
|
||||
await taskHeaderCloudPage.checkTaskPropertyListIsDisplayed();
|
||||
|
||||
await taskFormCloudComponent.checkClaimButtonIsDisplayed();
|
||||
await expect(await taskHeaderCloudPage.getStatus()).toEqual('CREATED');
|
||||
await expect(await taskHeaderCloudPage.getAssignee()).toEqual('No assignee');
|
||||
expect(await taskHeaderCloudPage.getStatus()).toEqual('CREATED');
|
||||
expect(await taskHeaderCloudPage.getAssignee()).toEqual('No assignee');
|
||||
|
||||
await taskFormCloudComponent.clickClaimButton();
|
||||
await browser.refresh();
|
||||
await taskHeaderCloudPage.checkTaskPropertyListIsDisplayed();
|
||||
|
||||
await taskFormCloudComponent.checkReleaseButtonIsDisplayed();
|
||||
await expect(await taskHeaderCloudPage.getStatus()).toEqual('ASSIGNED');
|
||||
await expect(await taskHeaderCloudPage.getAssignee()).toEqual(candidate.username);
|
||||
expect(await taskHeaderCloudPage.getStatus()).toEqual('ASSIGNED');
|
||||
expect(await taskHeaderCloudPage.getAssignee()).toEqual(candidate.username);
|
||||
|
||||
await taskFormCloudComponent.clickReleaseButton();
|
||||
await browser.refresh();
|
||||
await taskHeaderCloudPage.checkTaskPropertyListIsDisplayed();
|
||||
|
||||
await taskFormCloudComponent.checkClaimButtonIsDisplayed();
|
||||
await expect(await taskHeaderCloudPage.getStatus()).toEqual('CREATED');
|
||||
await expect(await taskHeaderCloudPage.getAssignee()).toEqual('No assignee');
|
||||
expect(await taskHeaderCloudPage.getStatus()).toEqual('CREATED');
|
||||
expect(await taskHeaderCloudPage.getAssignee()).toEqual('No assignee');
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
async function navigateToApp(user: { username: string; password: string }) {
|
||||
interface UserType {
|
||||
username: string;
|
||||
password: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* Navigate to the app
|
||||
*
|
||||
* @param user user
|
||||
*/
|
||||
async function navigateToApp(user: UserType) {
|
||||
await loginSSOPage.login(user.username, user.password);
|
||||
await LocalStorageUtil.setConfigField('adf-edit-task-filter', JSON.stringify(taskFilterConfiguration));
|
||||
await navigationBarPage.navigateToProcessServicesCloudPage();
|
||||
@@ -196,6 +210,12 @@ describe('Task claim/release', () => {
|
||||
await taskList.getDataTable().waitForTableBody();
|
||||
}
|
||||
|
||||
/**
|
||||
* Set status task filter
|
||||
*
|
||||
* @param status status type
|
||||
* @param processInstanceId process instance id
|
||||
*/
|
||||
async function setStatusTaskFilter(status: StatusType, processInstanceId: string) {
|
||||
await editTaskFilter.openFilter();
|
||||
await editTaskFilter.clearAssignee();
|
||||
|
Reference in New Issue
Block a user