mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2026-09-09 18:03:21 +00:00
Remove demo shell test and make cloud a bit more stable (#6781)
* remove demo shell test and make cloud a bit more stable * fix lint * Update restore-content-directive.e2e.ts * Update restore-content-directive.e2e.ts * Update restore-content-directive.e2e.ts * try fix attach * Update .travis.yml * sleep... * remove about e2e demo shell.... * fix * lint fix * configure * refactor buuild * names and remove demo shell build from libs * fix new build approach * fix * fix * . * uncomment * . * . * fix * fix * . * fix * lock update * fix demo shell errors * use replay subject * fix some console log error * suffix problem * split process e2e * not need to check everywhere the pagination e2e * split content * fix * fix * fix * fix * reorg # Conflicts: # .travis.yml
This commit is contained in:
@@ -0,0 +1,298 @@
|
||||
/*!
|
||||
* @license
|
||||
* Copyright 2019 Alfresco Software, Ltd.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import {
|
||||
ApiService,
|
||||
AppListCloudPage,
|
||||
BrowserActions,
|
||||
FilterProps,
|
||||
GroupIdentityService,
|
||||
IdentityService,
|
||||
LocalStorageUtil,
|
||||
LoginPage,
|
||||
ProcessDefinitionsService,
|
||||
ProcessInstancesService,
|
||||
QueryService,
|
||||
StringUtil,
|
||||
TasksService
|
||||
} from '@alfresco/adf-testing';
|
||||
import { browser } from 'protractor';
|
||||
import { ProcessCloudDemoPage } from './../pages/process-cloud-demo.page';
|
||||
import { TasksCloudDemoPage } from './../pages/tasks-cloud-demo.page';
|
||||
import { NavigationBarPage } from '../../core/pages/navigation-bar.page';
|
||||
import { EditProcessFilterConfiguration } from './../config/edit-process-filter.config';
|
||||
import { ProcessListCloudConfiguration } from './../config/process-list-cloud.config';
|
||||
|
||||
describe('Process list cloud', () => {
|
||||
|
||||
// en-US values for the process status
|
||||
const PROCESS_STATUS = {
|
||||
ALL: 'All',
|
||||
RUNNING: 'Running',
|
||||
SUSPENDED: 'Suspended',
|
||||
COMPLETED: 'Completed'
|
||||
};
|
||||
|
||||
// en-US values for the sort direction
|
||||
const SORT_DIRECTION = {
|
||||
ASC: 'Ascending',
|
||||
DESC: 'Descending'
|
||||
};
|
||||
|
||||
describe('Process List', () => {
|
||||
|
||||
const loginSSOPage = new LoginPage();
|
||||
const navigationBarPage = new NavigationBarPage();
|
||||
const appListCloudComponent = new AppListCloudPage();
|
||||
|
||||
const processCloudDemoPage = new ProcessCloudDemoPage();
|
||||
const editProcessFilter = processCloudDemoPage.editProcessFilterCloudComponent();
|
||||
const processList = processCloudDemoPage.processListCloudComponent();
|
||||
|
||||
const tasksCloudDemoPage = new TasksCloudDemoPage();
|
||||
|
||||
const apiService = new ApiService();
|
||||
const identityService = new IdentityService(apiService);
|
||||
const groupIdentityService = new GroupIdentityService(apiService);
|
||||
const processDefinitionService = new ProcessDefinitionsService(apiService);
|
||||
const processInstancesService = new ProcessInstancesService(apiService);
|
||||
const queryService = new QueryService(apiService);
|
||||
const tasksService = new TasksService(apiService);
|
||||
|
||||
const processListCloudConfiguration = new ProcessListCloudConfiguration();
|
||||
const editProcessFilterConfiguration = new EditProcessFilterConfiguration();
|
||||
const processListCloudConfigFile = processListCloudConfiguration.getConfiguration();
|
||||
const editProcessFilterConfigFile = editProcessFilterConfiguration.getConfiguration();
|
||||
|
||||
let completedProcess, runningProcessInstance, switchProcessInstance, noOfApps, testUser, groupInfo,
|
||||
anotherProcessInstance;
|
||||
const candidateBaseApp = browser.params.resources.ACTIVITI_CLOUD_APPS.CANDIDATE_BASE_APP.name;
|
||||
|
||||
beforeAll(async () => {
|
||||
await apiService.loginWithProfile('identityAdmin');
|
||||
|
||||
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);
|
||||
|
||||
const processDefinition = await processDefinitionService
|
||||
.getProcessDefinitionByName(browser.params.resources.ACTIVITI_CLOUD_APPS.CANDIDATE_BASE_APP.processes.candidateGroupProcess, candidateBaseApp);
|
||||
|
||||
const anotherProcessDefinition = await processDefinitionService
|
||||
.getProcessDefinitionByName(browser.params.resources.ACTIVITI_CLOUD_APPS.CANDIDATE_BASE_APP.processes.anotherCandidateGroupProcess, candidateBaseApp);
|
||||
|
||||
await processInstancesService.createProcessInstance(processDefinition.entry.key, candidateBaseApp);
|
||||
|
||||
runningProcessInstance = await processInstancesService.createProcessInstance(processDefinition.entry.key, candidateBaseApp, {
|
||||
'name': StringUtil.generateRandomString(),
|
||||
'businessKey': StringUtil.generateRandomString()
|
||||
});
|
||||
|
||||
anotherProcessInstance = await processInstancesService.createProcessInstance(anotherProcessDefinition.entry.key, candidateBaseApp, {
|
||||
'name': StringUtil.generateRandomString(),
|
||||
'businessKey': StringUtil.generateRandomString()
|
||||
});
|
||||
|
||||
switchProcessInstance = await processInstancesService.createProcessInstance(processDefinition.entry.key, candidateBaseApp, {
|
||||
'name': StringUtil.generateRandomString(),
|
||||
'businessKey': StringUtil.generateRandomString()
|
||||
});
|
||||
|
||||
completedProcess = await processInstancesService.createProcessInstance(processDefinition.entry.key, candidateBaseApp, {
|
||||
'name': StringUtil.generateRandomString(),
|
||||
'businessKey': StringUtil.generateRandomString()
|
||||
});
|
||||
|
||||
const task = await queryService.getProcessInstanceTasks(completedProcess.entry.id, candidateBaseApp);
|
||||
const claimedTask = await tasksService.claimTask(task.list.entries[0].entry.id, candidateBaseApp);
|
||||
await tasksService.completeTask(claimedTask.entry.id, candidateBaseApp);
|
||||
|
||||
await loginSSOPage.login(testUser.username, testUser.password);
|
||||
await LocalStorageUtil.setConfigField('adf-edit-process-filter', JSON.stringify(editProcessFilterConfigFile));
|
||||
await LocalStorageUtil.setConfigField('adf-cloud-process-list', JSON.stringify(processListCloudConfigFile));
|
||||
});
|
||||
|
||||
afterAll(async () => {
|
||||
await apiService.login(testUser.username, testUser.password);
|
||||
await processInstancesService.deleteProcessInstance(anotherProcessInstance.entry.id, candidateBaseApp);
|
||||
await apiService.loginWithProfile('identityAdmin');
|
||||
await identityService.deleteIdentityUser(testUser.idIdentityService);
|
||||
});
|
||||
|
||||
beforeEach(async () => {
|
||||
await navigationBarPage.navigateToProcessServicesCloudPage();
|
||||
await appListCloudComponent.checkApsContainer();
|
||||
await appListCloudComponent.goToApp(candidateBaseApp);
|
||||
await tasksCloudDemoPage.taskListCloudComponent().checkTaskListIsLoaded();
|
||||
await processCloudDemoPage.processFilterCloudComponent.clickOnProcessFilters();
|
||||
});
|
||||
|
||||
function setFilter(props: FilterProps): Promise<void> {
|
||||
return editProcessFilter.setFilter(props);
|
||||
}
|
||||
|
||||
async function waitTillContentLoaded() {
|
||||
await processList.getDataTable().waitTillContentLoaded();
|
||||
}
|
||||
|
||||
it('[C290069] Should display processes ordered by name when Name is selected from sort dropdown', async () => {
|
||||
await setFilter({ status: PROCESS_STATUS.RUNNING, sort: 'Name', order: SORT_DIRECTION.ASC });
|
||||
await waitTillContentLoaded();
|
||||
|
||||
await expect(await processList.getDataTable().checkListIsSorted(SORT_DIRECTION.ASC, 'Name')).toBe(true);
|
||||
|
||||
await setFilter({ order: SORT_DIRECTION.DESC});
|
||||
await waitTillContentLoaded();
|
||||
|
||||
await expect(await processList.getDataTable().checkListIsSorted(SORT_DIRECTION.DESC, 'Name')).toBe(true);
|
||||
});
|
||||
|
||||
it('[C291783] Should display processes ordered by id when Id is selected from sort dropdown', async () => {
|
||||
await setFilter({ status: PROCESS_STATUS.RUNNING, sort: 'Id', order: SORT_DIRECTION.ASC });
|
||||
await waitTillContentLoaded();
|
||||
|
||||
await expect(await processList.getDataTable().checkListIsSorted(SORT_DIRECTION.ASC, 'Id')).toBe(true);
|
||||
|
||||
await setFilter({ order: SORT_DIRECTION.DESC});
|
||||
await waitTillContentLoaded();
|
||||
await expect(await processList.getDataTable().checkListIsSorted(SORT_DIRECTION.DESC, 'Id')).toBe(true);
|
||||
});
|
||||
|
||||
it('[C305054] Should display processes ordered by status when Status is selected from sort dropdown', async () => {
|
||||
await setFilter({ status: PROCESS_STATUS.ALL, sort: 'Status', order: SORT_DIRECTION.ASC });
|
||||
await waitTillContentLoaded();
|
||||
|
||||
await expect(await processList.getDataTable().checkListIsSorted(SORT_DIRECTION.ASC, 'Status')).toBe(true);
|
||||
|
||||
await setFilter({ order: SORT_DIRECTION.DESC});
|
||||
await waitTillContentLoaded();
|
||||
await expect(await processList.getDataTable().checkListIsSorted(SORT_DIRECTION.DESC, 'Status')).toBe(true);
|
||||
});
|
||||
|
||||
it('[C305054] Should display processes ordered by started by when Started By is selected from sort dropdown', async () => {
|
||||
await setFilter({ status: PROCESS_STATUS.ALL, sort: 'Started by', order: SORT_DIRECTION.ASC });
|
||||
await waitTillContentLoaded();
|
||||
|
||||
await expect(await processList.getDataTable().checkListIsSorted(SORT_DIRECTION.ASC, 'Started by')).toBe(true);
|
||||
|
||||
await setFilter({ order: SORT_DIRECTION.DESC});
|
||||
await waitTillContentLoaded();
|
||||
await expect(await processList.getDataTable().checkListIsSorted(SORT_DIRECTION.DESC, 'Started by')).toBe(true);
|
||||
});
|
||||
|
||||
it('[C305054] Should display processes ordered by processdefinitionid date when ProcessDefinitionId is selected from sort dropdown', async () => {
|
||||
await setFilter({ status: PROCESS_STATUS.ALL, sort: 'ProcessDefinitionId', order: SORT_DIRECTION.ASC });
|
||||
await waitTillContentLoaded();
|
||||
|
||||
await expect(await processList.getDataTable().checkListIsSorted(SORT_DIRECTION.ASC, 'Process Definition Id')).toBe(true);
|
||||
|
||||
await setFilter({ order: SORT_DIRECTION.DESC});
|
||||
await waitTillContentLoaded();
|
||||
await expect(await processList.getDataTable().checkListIsSorted(SORT_DIRECTION.DESC, 'Process Definition Id')).toBe(true);
|
||||
});
|
||||
|
||||
it('[C305054] Should display processes ordered by processdefinitionkey date when ProcessDefinitionKey is selected from sort dropdown', async () => {
|
||||
await setFilter({ status: PROCESS_STATUS.ALL, sort: 'ProcessDefinitionKey', order: SORT_DIRECTION.ASC });
|
||||
await waitTillContentLoaded();
|
||||
|
||||
await expect(await processList.getDataTable().checkListIsSorted(SORT_DIRECTION.ASC, 'Process Definition Key')).toBe(true);
|
||||
|
||||
await setFilter({ order: SORT_DIRECTION.DESC});
|
||||
await expect(await processList.getDataTable().checkListIsSorted(SORT_DIRECTION.DESC, 'Process Definition Key')).toBe(true);
|
||||
});
|
||||
|
||||
it('[C305054] Should display processes ordered by last modified date when Last Modified is selected from sort dropdown', async () => {
|
||||
await setFilter({ status: PROCESS_STATUS.ALL, sort: 'Last Modified', order: SORT_DIRECTION.ASC });
|
||||
await waitTillContentLoaded();
|
||||
|
||||
await expect(await processList.getDataTable().checkListIsSorted(SORT_DIRECTION.ASC, 'Last Modified')).toBe(true);
|
||||
|
||||
await setFilter({ order: SORT_DIRECTION.DESC });
|
||||
await waitTillContentLoaded();
|
||||
await expect(await processList.getDataTable().checkListIsSorted(SORT_DIRECTION.DESC, 'Last Modified')).toBe(true);
|
||||
});
|
||||
|
||||
it('[C305054] Should display processes ordered by business key date when BusinessKey is selected from sort dropdown', async () => {
|
||||
await setFilter({ status: PROCESS_STATUS.ALL, sort: 'Business Key', order: SORT_DIRECTION.ASC });
|
||||
await waitTillContentLoaded();
|
||||
|
||||
await expect(await processList.getDataTable().checkListIsSorted(SORT_DIRECTION.ASC, 'Business Key')).toBe(true);
|
||||
|
||||
await setFilter({ order: SORT_DIRECTION.DESC});
|
||||
await waitTillContentLoaded();
|
||||
await expect(await processList.getDataTable().checkListIsSorted(SORT_DIRECTION.DESC, 'Business Key')).toBe(true);
|
||||
});
|
||||
|
||||
it('[C297697] The value of the filter should be preserved when saving it', async () => {
|
||||
await processCloudDemoPage.processFilterCloudComponent.clickAllProcessesFilter();
|
||||
await editProcessFilter.openFilter();
|
||||
await editProcessFilter.setProcessInstanceId(completedProcess.entry.id);
|
||||
|
||||
await editProcessFilter.saveAs('New');
|
||||
|
||||
await expect(await processCloudDemoPage.processFilterCloudComponent.getActiveFilterName()).toBe('New');
|
||||
|
||||
await processList.checkContentIsDisplayedById(completedProcess.entry.id);
|
||||
await expect(await processList.getDataTable().numberOfRows()).toBe(1);
|
||||
|
||||
await editProcessFilter.openFilter();
|
||||
|
||||
await expect(await editProcessFilter.getProcessInstanceId()).toEqual(completedProcess.entry.id);
|
||||
});
|
||||
|
||||
it('[C297646] Should display the filter dropdown fine , after switching between saved filters', async () => {
|
||||
await editProcessFilter.openFilter();
|
||||
noOfApps = await editProcessFilter.getNumberOfAppNameOptions();
|
||||
|
||||
await expect(await editProcessFilter.checkAppNamesAreUnique()).toBe(true);
|
||||
await BrowserActions.closeMenuAndDialogs();
|
||||
await editProcessFilter.setStatusFilterDropDown(PROCESS_STATUS.RUNNING);
|
||||
await editProcessFilter.setAppNameDropDown(candidateBaseApp);
|
||||
await editProcessFilter.setProcessInstanceId(runningProcessInstance.entry.id);
|
||||
await waitTillContentLoaded();
|
||||
|
||||
await processList.checkContentIsDisplayedById(runningProcessInstance.entry.id);
|
||||
await expect(await editProcessFilter.getNumberOfAppNameOptions()).toBe(noOfApps);
|
||||
await expect(await editProcessFilter.checkAppNamesAreUnique()).toBe(true);
|
||||
await BrowserActions.closeMenuAndDialogs();
|
||||
|
||||
await editProcessFilter.saveAs('SavedFilter');
|
||||
await expect(await processCloudDemoPage.processFilterCloudComponent.getActiveFilterName()).toBe('SavedFilter');
|
||||
|
||||
await editProcessFilter.openFilter();
|
||||
await expect(await editProcessFilter.getProcessInstanceId()).toEqual(runningProcessInstance.entry.id);
|
||||
|
||||
await editProcessFilter.setStatusFilterDropDown(PROCESS_STATUS.RUNNING);
|
||||
await editProcessFilter.setAppNameDropDown(candidateBaseApp);
|
||||
await editProcessFilter.setProcessInstanceId(switchProcessInstance.entry.id);
|
||||
await waitTillContentLoaded();
|
||||
|
||||
await processList.checkContentIsDisplayedById(switchProcessInstance.entry.id);
|
||||
await editProcessFilter.saveAs('SwitchFilter');
|
||||
await expect(await processCloudDemoPage.processFilterCloudComponent.getActiveFilterName()).toBe('SwitchFilter');
|
||||
|
||||
await editProcessFilter.openFilter();
|
||||
await expect(await editProcessFilter.getProcessInstanceId()).toEqual(switchProcessInstance.entry.id);
|
||||
await expect(await editProcessFilter.getNumberOfAppNameOptions()).toBe(noOfApps);
|
||||
await expect(await editProcessFilter.checkAppNamesAreUnique()).toBe(true);
|
||||
await BrowserActions.closeMenuAndDialogs();
|
||||
});
|
||||
|
||||
});
|
||||
});
|
||||
@@ -0,0 +1,347 @@
|
||||
/*!
|
||||
* @license
|
||||
* Copyright 2019 Alfresco Software, Ltd.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import {
|
||||
ApiService,
|
||||
AppListCloudPage,
|
||||
DateUtil,
|
||||
GroupIdentityService,
|
||||
IdentityService,
|
||||
LocalStorageUtil,
|
||||
LoginPage,
|
||||
ProcessDefinitionsService,
|
||||
ProcessInstancesService,
|
||||
QueryService,
|
||||
StringUtil,
|
||||
TasksService
|
||||
} from '@alfresco/adf-testing';
|
||||
import { browser } from 'protractor';
|
||||
import { ProcessCloudDemoPage } from './../pages/process-cloud-demo.page';
|
||||
import { TasksCloudDemoPage } from './../pages/tasks-cloud-demo.page';
|
||||
import { NavigationBarPage } from '../../core/pages/navigation-bar.page';
|
||||
import { ProcessListPage } from '../../process-services/pages/process-list.page';
|
||||
import { EditProcessFilterConfiguration } from './../config/edit-process-filter.config';
|
||||
import { ProcessListCloudConfiguration } from './../config/process-list-cloud.config';
|
||||
import moment = require('moment');
|
||||
|
||||
describe('Process filters cloud', () => {
|
||||
|
||||
// en-US values for the process status
|
||||
const PROCESS_STATUS = {
|
||||
ALL: 'All',
|
||||
RUNNING: 'Running',
|
||||
SUSPENDED: 'Suspended',
|
||||
COMPLETED: 'Completed'
|
||||
};
|
||||
|
||||
const loginSSOPage = new LoginPage();
|
||||
const navigationBarPage = new NavigationBarPage();
|
||||
const appListCloudComponent = new AppListCloudPage();
|
||||
|
||||
const processCloudDemoPage = new ProcessCloudDemoPage();
|
||||
const editProcessFilter = processCloudDemoPage.editProcessFilterCloudComponent();
|
||||
const processList = processCloudDemoPage.processListCloudComponent();
|
||||
|
||||
const tasksCloudDemoPage = new TasksCloudDemoPage();
|
||||
const processListPage = new ProcessListPage();
|
||||
|
||||
const apiService = new ApiService();
|
||||
const identityService = new IdentityService(apiService);
|
||||
const groupIdentityService = new GroupIdentityService(apiService);
|
||||
const processDefinitionService = new ProcessDefinitionsService(apiService);
|
||||
const processInstancesService = new ProcessInstancesService(apiService);
|
||||
const queryService = new QueryService(apiService);
|
||||
const tasksService = new TasksService(apiService);
|
||||
|
||||
const beforeDate = moment().add(-1, 'days').format('DD/MM/YYYY');
|
||||
const currentDate = DateUtil.formatDate('DD/MM/YYYY');
|
||||
const afterDate = moment().add(1, 'days').format('DD/MM/YYYY');
|
||||
const processListCloudConfiguration = new ProcessListCloudConfiguration();
|
||||
const editProcessFilterConfiguration = new EditProcessFilterConfiguration();
|
||||
const processListCloudConfigFile = processListCloudConfiguration.getConfiguration();
|
||||
const editProcessFilterConfigFile = editProcessFilterConfiguration.getConfiguration();
|
||||
|
||||
let completedProcess, runningProcessInstance, suspendProcessInstance, testUser, anotherUser, groupInfo,
|
||||
anotherProcessInstance, processDefinition, anotherProcessDefinition,
|
||||
differentAppUserProcessInstance, simpleAppProcessDefinition;
|
||||
const candidateBaseApp = browser.params.resources.ACTIVITI_CLOUD_APPS.CANDIDATE_BASE_APP.name;
|
||||
const simpleApp = browser.params.resources.ACTIVITI_CLOUD_APPS.SIMPLE_APP.name;
|
||||
|
||||
beforeAll(async () => {
|
||||
await apiService.loginWithProfile('identityAdmin');
|
||||
|
||||
testUser = await identityService.createIdentityUserWithRole( [identityService.ROLES.ACTIVITI_USER]);
|
||||
anotherUser = await identityService.createIdentityUserWithRole( [identityService.ROLES.ACTIVITI_USER]);
|
||||
|
||||
groupInfo = await groupIdentityService.getGroupInfoByGroupName('hr');
|
||||
await identityService.addUserToGroup(testUser.idIdentityService, groupInfo.id);
|
||||
await identityService.addUserToGroup(anotherUser.idIdentityService, groupInfo.id);
|
||||
|
||||
await apiService.login(anotherUser.username, anotherUser.password);
|
||||
simpleAppProcessDefinition = await processDefinitionService
|
||||
.getProcessDefinitionByName(browser.params.resources.ACTIVITI_CLOUD_APPS.SIMPLE_APP.processes.simpleProcess, simpleApp);
|
||||
|
||||
differentAppUserProcessInstance = await processInstancesService.createProcessInstance(simpleAppProcessDefinition.entry.key, simpleApp, {
|
||||
'name': StringUtil.generateRandomString(),
|
||||
'businessKey': StringUtil.generateRandomString()
|
||||
});
|
||||
|
||||
await apiService.login(testUser.username, testUser.password);
|
||||
processDefinition = await processDefinitionService
|
||||
.getProcessDefinitionByName(browser.params.resources.ACTIVITI_CLOUD_APPS.CANDIDATE_BASE_APP.processes.candidateGroupProcess, candidateBaseApp);
|
||||
|
||||
anotherProcessDefinition = await processDefinitionService
|
||||
.getProcessDefinitionByName(browser.params.resources.ACTIVITI_CLOUD_APPS.CANDIDATE_BASE_APP.processes.anotherCandidateGroupProcess, candidateBaseApp);
|
||||
|
||||
runningProcessInstance = await processInstancesService.createProcessInstance(processDefinition.entry.key, candidateBaseApp, {
|
||||
'name': StringUtil.generateRandomString(),
|
||||
'businessKey': StringUtil.generateRandomString()
|
||||
});
|
||||
|
||||
anotherProcessInstance = await processInstancesService.createProcessInstance(anotherProcessDefinition.entry.key, candidateBaseApp, {
|
||||
'name': StringUtil.generateRandomString(),
|
||||
'businessKey': StringUtil.generateRandomString()
|
||||
});
|
||||
|
||||
suspendProcessInstance = await processInstancesService.createProcessInstance(processDefinition.entry.key, candidateBaseApp, {
|
||||
'name': StringUtil.generateRandomString(),
|
||||
'businessKey': StringUtil.generateRandomString()
|
||||
});
|
||||
await processInstancesService.suspendProcessInstance(suspendProcessInstance.entry.id, candidateBaseApp);
|
||||
|
||||
completedProcess = await processInstancesService.createProcessInstance(processDefinition.entry.key, candidateBaseApp, {
|
||||
'name': StringUtil.generateRandomString(),
|
||||
'businessKey': StringUtil.generateRandomString()
|
||||
});
|
||||
|
||||
const task = await queryService.getProcessInstanceTasks(completedProcess.entry.id, candidateBaseApp);
|
||||
const claimedTask = await tasksService.claimTask(task.list.entries[0].entry.id, candidateBaseApp);
|
||||
await tasksService.completeTask(claimedTask.entry.id, candidateBaseApp);
|
||||
|
||||
await loginSSOPage.login(testUser.username, testUser.password);
|
||||
await LocalStorageUtil.setConfigField('adf-edit-process-filter', JSON.stringify(editProcessFilterConfigFile));
|
||||
await LocalStorageUtil.setConfigField('adf-cloud-process-list', JSON.stringify(processListCloudConfigFile));
|
||||
});
|
||||
|
||||
afterAll(async () => {
|
||||
await processInstancesService.deleteProcessInstance(runningProcessInstance.entry.id, candidateBaseApp);
|
||||
await processInstancesService.deleteProcessInstance(anotherProcessInstance.entry.id, candidateBaseApp);
|
||||
await processInstancesService.deleteProcessInstance(suspendProcessInstance.entry.id, candidateBaseApp);
|
||||
|
||||
await apiService.login(anotherUser.username, anotherUser.password);
|
||||
await processInstancesService.deleteProcessInstance(differentAppUserProcessInstance.entry.id, simpleApp);
|
||||
|
||||
await apiService.loginWithProfile('identityAdmin');
|
||||
|
||||
await identityService.deleteIdentityUser(testUser.idIdentityService);
|
||||
await identityService.deleteIdentityUser(anotherUser.idIdentityService);
|
||||
});
|
||||
|
||||
beforeEach(async () => {
|
||||
await navigationBarPage.navigateToProcessServicesCloudPage();
|
||||
await appListCloudComponent.checkApsContainer();
|
||||
await appListCloudComponent.goToApp(candidateBaseApp);
|
||||
await tasksCloudDemoPage.taskListCloudComponent().checkTaskListIsLoaded();
|
||||
await processCloudDemoPage.processFilterCloudComponent.clickOnProcessFilters();
|
||||
await processCloudDemoPage.processFilterCloudComponent.clickRunningProcessesFilter();
|
||||
});
|
||||
|
||||
it('[C306887] Should be able to filter by appName', async () => {
|
||||
await editProcessFilter.openFilter();
|
||||
await editProcessFilter.setAppNameDropDown(candidateBaseApp);
|
||||
await editProcessFilter.setInitiator(`${testUser.firstName} ${testUser.lastName}`);
|
||||
|
||||
await processList.getDataTable().waitTillContentLoaded();
|
||||
await processList.checkContentIsDisplayedByName(runningProcessInstance.entry.name);
|
||||
await processList.checkContentIsNotDisplayedByName(differentAppUserProcessInstance.entry.name);
|
||||
});
|
||||
|
||||
it('[C306889] Should be able to see "No process found" when using an app with no processes in the appName field', async () => {
|
||||
await editProcessFilter.openFilter();
|
||||
await editProcessFilter.setAppNameDropDown('subprocessapp');
|
||||
await editProcessFilter.setInitiator(`${testUser.firstName} ${testUser.lastName}`);
|
||||
|
||||
await expect(await processListPage.getDisplayedProcessListTitle()).toEqual('No Processes Found');
|
||||
});
|
||||
|
||||
it('[C306890] Should be able to filter by initiator', async () => {
|
||||
await editProcessFilter.openFilter();
|
||||
await editProcessFilter.setInitiator(`${testUser.firstName} ${testUser.lastName}`);
|
||||
|
||||
await processList.getDataTable().waitTillContentLoaded();
|
||||
await processList.checkContentIsDisplayedByName(runningProcessInstance.entry.name);
|
||||
await processList.checkContentIsNotDisplayedByName(differentAppUserProcessInstance.entry.name);
|
||||
});
|
||||
|
||||
it('[C311315] Should be able to filter by process definition id', async () => {
|
||||
await editProcessFilter.openFilter();
|
||||
await editProcessFilter.setProperty('processDefinitionId', processDefinition.entry.id);
|
||||
await processList.checkContentIsDisplayedByName(runningProcessInstance.entry.name);
|
||||
|
||||
await editProcessFilter.setProperty('processDefinitionId', anotherProcessDefinition.entry.id);
|
||||
await processList.checkContentIsDisplayedByName(anotherProcessInstance.entry.name);
|
||||
await processList.checkContentIsNotDisplayedByName(runningProcessInstance.entry.name);
|
||||
});
|
||||
|
||||
it('[C311316] Should be able to filter by process definition key', async () => {
|
||||
await editProcessFilter.openFilter();
|
||||
await editProcessFilter.setProperty('processDefinitionKey', processDefinition.entry.key);
|
||||
await editProcessFilter.setProcessName(runningProcessInstance.entry.name);
|
||||
await processList.checkContentIsDisplayedByName(runningProcessInstance.entry.name);
|
||||
|
||||
await editProcessFilter.setProcessName(anotherProcessInstance.entry.name);
|
||||
await editProcessFilter.setProperty('processDefinitionKey', anotherProcessDefinition.entry.key);
|
||||
await processList.checkContentIsDisplayedByName(anotherProcessInstance.entry.name);
|
||||
await processList.checkContentIsNotDisplayedByName(runningProcessInstance.entry.name);
|
||||
});
|
||||
|
||||
it('[C311317] Should be able to filter by process instance id', async () => {
|
||||
await editProcessFilter.openFilter();
|
||||
await editProcessFilter.setProperty('processInstanceId', runningProcessInstance.entry.id);
|
||||
await processList.getDataTable().waitTillContentLoaded();
|
||||
await processList.checkContentIsDisplayedByName(runningProcessInstance.entry.name);
|
||||
|
||||
await expect(await processList.getDataTable().getNumberOfRows()).toBe(1);
|
||||
|
||||
await editProcessFilter.setProperty('processInstanceId', anotherProcessInstance.entry.id);
|
||||
await processList.getDataTable().waitTillContentLoaded();
|
||||
await processList.checkContentIsDisplayedByName(anotherProcessInstance.entry.name);
|
||||
await processList.checkContentIsNotDisplayedByName(runningProcessInstance.entry.name);
|
||||
await expect(await processList.getDataTable().getNumberOfRows()).toBe(1);
|
||||
});
|
||||
|
||||
it('[C311321] Should be able to filter by process name', async () => {
|
||||
await editProcessFilter.openFilter();
|
||||
await editProcessFilter.setProcessName(runningProcessInstance.entry.name);
|
||||
await processList.getDataTable().waitTillContentLoaded();
|
||||
await processList.checkContentIsDisplayedByName(runningProcessInstance.entry.name);
|
||||
|
||||
await editProcessFilter.setProcessName(anotherProcessInstance.entry.name);
|
||||
await processList.getDataTable().waitTillContentLoaded();
|
||||
await processList.checkContentIsDisplayedByName(anotherProcessInstance.entry.name);
|
||||
await processList.checkContentIsNotDisplayedByName(runningProcessInstance.entry.name);
|
||||
});
|
||||
|
||||
it('[C306892] Should be able to filter by process status - Running', async () => {
|
||||
await editProcessFilter.openFilter();
|
||||
await editProcessFilter.setStatusFilterDropDown(PROCESS_STATUS.RUNNING);
|
||||
await editProcessFilter.setProcessName(runningProcessInstance.entry.name);
|
||||
await processList.checkContentIsDisplayedByName(runningProcessInstance.entry.name);
|
||||
|
||||
await editProcessFilter.setProcessName(suspendProcessInstance.entry.name);
|
||||
await processList.checkContentIsNotDisplayedByName(suspendProcessInstance.entry.name);
|
||||
|
||||
await editProcessFilter.setProcessName(anotherProcessInstance.entry.name);
|
||||
await processList.checkContentIsDisplayedByName(anotherProcessInstance.entry.name);
|
||||
|
||||
await editProcessFilter.setProcessName(completedProcess.entry.name);
|
||||
await processList.checkContentIsNotDisplayedByName(completedProcess.entry.name);
|
||||
});
|
||||
|
||||
it('[C306892] Should be able to filter by process status - Completed', async () => {
|
||||
await editProcessFilter.openFilter();
|
||||
await editProcessFilter.setStatusFilterDropDown(PROCESS_STATUS.COMPLETED);
|
||||
await editProcessFilter.setProcessName(completedProcess.entry.name);
|
||||
await processList.checkContentIsDisplayedByName(completedProcess.entry.name);
|
||||
|
||||
await editProcessFilter.setProcessName(runningProcessInstance.entry.name);
|
||||
await processList.checkContentIsNotDisplayedByName(runningProcessInstance.entry.name);
|
||||
|
||||
await editProcessFilter.setProcessName(suspendProcessInstance.entry.name);
|
||||
await processList.checkContentIsNotDisplayedByName(suspendProcessInstance.entry.name);
|
||||
|
||||
await editProcessFilter.setProcessName(anotherProcessInstance.entry.name);
|
||||
await processList.checkContentIsNotDisplayedByName(anotherProcessInstance.entry.name);
|
||||
});
|
||||
|
||||
it('[C306892] Should be able to filter by process status - Suspended', async () => {
|
||||
await editProcessFilter.openFilter();
|
||||
await editProcessFilter.setStatusFilterDropDown(PROCESS_STATUS.SUSPENDED);
|
||||
await editProcessFilter.setProcessName(suspendProcessInstance.entry.name);
|
||||
await processList.checkContentIsDisplayedByName(suspendProcessInstance.entry.name);
|
||||
|
||||
await editProcessFilter.setProcessName(runningProcessInstance.entry.name);
|
||||
await processList.checkContentIsNotDisplayedByName(runningProcessInstance.entry.name);
|
||||
|
||||
await editProcessFilter.setProcessName(anotherProcessInstance.entry.name);
|
||||
await processList.checkContentIsNotDisplayedByName(anotherProcessInstance.entry.name);
|
||||
|
||||
await editProcessFilter.setProcessName(completedProcess.entry.name);
|
||||
await processList.checkContentIsNotDisplayedByName(completedProcess.entry.name);
|
||||
});
|
||||
|
||||
it('[C306892] Should be able to filter by process status - All', async () => {
|
||||
await processCloudDemoPage.processFilterCloudComponent.clickAllProcessesFilter();
|
||||
|
||||
await editProcessFilter.openFilter();
|
||||
await editProcessFilter.setStatusFilterDropDown(PROCESS_STATUS.ALL);
|
||||
|
||||
await processList.checkContentIsDisplayedByName(runningProcessInstance.entry.name);
|
||||
await processList.checkContentIsDisplayedByName(anotherProcessInstance.entry.name);
|
||||
await processList.checkContentIsDisplayedByName(suspendProcessInstance.entry.name);
|
||||
await processList.checkContentIsDisplayedByName(completedProcess.entry.name);
|
||||
});
|
||||
|
||||
it('[C311318] Should be able to filter by lastModifiedFrom - displays record when date = currentDate', async () => {
|
||||
await editProcessFilter.openFilter();
|
||||
await editProcessFilter.setProperty('lastModifiedFrom', currentDate);
|
||||
await editProcessFilter.setProcessName(runningProcessInstance.entry.name);
|
||||
await processList.checkContentIsDisplayedByName(runningProcessInstance.entry.name);
|
||||
});
|
||||
|
||||
it('[C311318] Should be able to filter by lastModifiedFrom - displays record when date = beforeDate', async () => {
|
||||
await editProcessFilter.openFilter();
|
||||
await editProcessFilter.setProperty('lastModifiedFrom', beforeDate);
|
||||
await editProcessFilter.setProcessName(runningProcessInstance.entry.name);
|
||||
await processList.checkContentIsDisplayedByName(runningProcessInstance.entry.name);
|
||||
});
|
||||
|
||||
it('[C311318] Should be able to filter by lastModifiedFrom - does not display record when date = afterDate', async () => {
|
||||
await editProcessFilter.openFilter();
|
||||
await editProcessFilter.setProcessName(runningProcessInstance.entry.name);
|
||||
await editProcessFilter.setProperty('lastModifiedFrom', afterDate);
|
||||
await processList.checkContentIsNotDisplayedByName(runningProcessInstance.entry.name);
|
||||
});
|
||||
|
||||
it('[C311319] Should be able to filter by lastModifiedTo - displays record when date = currentDate', async () => {
|
||||
await editProcessFilter.openFilter();
|
||||
await editProcessFilter.setProperty('lastModifiedTo', currentDate);
|
||||
await editProcessFilter.setProcessName(runningProcessInstance.entry.name);
|
||||
await processList.checkContentIsDisplayedByName(runningProcessInstance.entry.name);
|
||||
});
|
||||
|
||||
it('[C311319] Should be able to filter by lastModifiedTo - does not display record when date = beforeDate', async () => {
|
||||
await editProcessFilter.openFilter();
|
||||
await editProcessFilter.setProperty('lastModifiedTo', beforeDate);
|
||||
await editProcessFilter.setProcessName(runningProcessInstance.entry.name);
|
||||
await processList.checkContentIsNotDisplayedByName(runningProcessInstance.entry.name);
|
||||
});
|
||||
|
||||
it('[C311319] Should be able to filter by lastModifiedTo - displays record when date = afterDate', async () => {
|
||||
await editProcessFilter.openFilter();
|
||||
await editProcessFilter.setProperty('lastModifiedTo', afterDate);
|
||||
await editProcessFilter.setProcessName(runningProcessInstance.entry.name);
|
||||
await processList.checkContentIsDisplayedByName(runningProcessInstance.entry.name);
|
||||
});
|
||||
|
||||
it('[C311319] Should not display any processes when the lastModifiedFrom and lastModifiedTo are set to a future date', async () => {
|
||||
await editProcessFilter.openFilter();
|
||||
await editProcessFilter.setProperty('lastModifiedFrom', afterDate);
|
||||
await editProcessFilter.setProperty('lastModifiedTo', afterDate);
|
||||
await expect(await processListPage.getDisplayedProcessListTitle()).toEqual('No Processes Found');
|
||||
});
|
||||
});
|
||||
@@ -0,0 +1,123 @@
|
||||
/*!
|
||||
* @license
|
||||
* Copyright 2019 Alfresco Software, Ltd.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import {
|
||||
ApiService,
|
||||
AppListCloudPage,
|
||||
LocalStorageUtil,
|
||||
LoginPage,
|
||||
ProcessDefinitionsService,
|
||||
ProcessInstancesService,
|
||||
QueryService,
|
||||
TaskFormCloudComponent,
|
||||
TaskHeaderCloudPage
|
||||
} from '@alfresco/adf-testing';
|
||||
import { browser, protractor } from 'protractor';
|
||||
import { ProcessCloudDemoPage } from './../pages/process-cloud-demo.page';
|
||||
import { ProcessDetailsCloudDemoPage } from './../pages/process-details-cloud-demo.page';
|
||||
import { TasksCloudDemoPage } from './../pages/tasks-cloud-demo.page';
|
||||
import { NavigationBarPage } from '../../core/pages/navigation-bar.page';
|
||||
import { EditProcessFilterConfiguration } from './../config/edit-process-filter.config';
|
||||
import { ProcessListCloudConfiguration } from './../config/process-list-cloud.config';
|
||||
import {
|
||||
ProcessDefinitionCloud,
|
||||
ProcessInstanceCloud,
|
||||
StartTaskCloudResponseModel
|
||||
} from '@alfresco/adf-process-services-cloud';
|
||||
|
||||
describe('Process filters cloud', () => {
|
||||
// en-US values for the process status
|
||||
const PROCESS_STATUS = {
|
||||
ALL: 'All',
|
||||
RUNNING: 'Running',
|
||||
SUSPENDED: 'Suspended',
|
||||
COMPLETED: 'Completed'
|
||||
};
|
||||
|
||||
const loginSSOPage = new LoginPage();
|
||||
const navigationBarPage = new NavigationBarPage();
|
||||
const appListCloudComponent = new AppListCloudPage();
|
||||
const processCloudDemoPage = new ProcessCloudDemoPage();
|
||||
const editProcessFilter = processCloudDemoPage.editProcessFilterCloudComponent();
|
||||
|
||||
const tasksCloudDemoPage = new TasksCloudDemoPage();
|
||||
const editTaskFilter = tasksCloudDemoPage.editTaskFilterCloud;
|
||||
const taskFilter = tasksCloudDemoPage.taskFilterCloudComponent;
|
||||
const taskList = tasksCloudDemoPage.taskListCloudComponent();
|
||||
const processList = processCloudDemoPage.processListCloudComponent();
|
||||
|
||||
const processDetailsCloudDemoPage = new ProcessDetailsCloudDemoPage();
|
||||
const taskHeaderCloudPage = new TaskHeaderCloudPage();
|
||||
const taskFormCloudComponent = new TaskFormCloudComponent();
|
||||
|
||||
const apiService = new ApiService();
|
||||
const processDefinitionService = new ProcessDefinitionsService(apiService);
|
||||
const processInstancesService = new ProcessInstancesService(apiService);
|
||||
const queryService = new QueryService(apiService);
|
||||
|
||||
const processListCloudConfigFile = new ProcessListCloudConfiguration().getConfiguration();
|
||||
const editProcessFilterConfigFile = new EditProcessFilterConfiguration().getConfiguration();
|
||||
|
||||
let simpleProcessDefinition: ProcessDefinitionCloud;
|
||||
let processInstance: ProcessInstanceCloud;
|
||||
let taskAssigned: StartTaskCloudResponseModel[];
|
||||
let taskName: string;
|
||||
const simpleApp = browser.params.resources.ACTIVITI_CLOUD_APPS.SIMPLE_APP.name;
|
||||
|
||||
beforeAll(async () => {
|
||||
await apiService.loginWithProfile('hrUser');
|
||||
|
||||
simpleProcessDefinition = (await processDefinitionService
|
||||
.getProcessDefinitionByName(browser.params.resources.ACTIVITI_CLOUD_APPS.SIMPLE_APP.processes.processstring, simpleApp)).entry;
|
||||
processInstance = (await processInstancesService.createProcessInstance(simpleProcessDefinition.key, simpleApp)).entry;
|
||||
taskAssigned = (await queryService.getProcessInstanceTasks(processInstance.id, simpleApp)).list.entries;
|
||||
taskName = browser.params.resources.ACTIVITI_CLOUD_APPS.SIMPLE_APP.tasks.processstring;
|
||||
|
||||
await loginSSOPage.loginWithProfile('hrUser');
|
||||
await LocalStorageUtil.setConfigField('adf-edit-process-filter', JSON.stringify(editProcessFilterConfigFile));
|
||||
await LocalStorageUtil.setConfigField('adf-cloud-process-list', JSON.stringify(processListCloudConfigFile));
|
||||
});
|
||||
|
||||
beforeEach(async () => {
|
||||
await navigationBarPage.navigateToProcessServicesCloudPage();
|
||||
await appListCloudComponent.checkApsContainer();
|
||||
await appListCloudComponent.goToApp(simpleApp);
|
||||
await taskList.checkTaskListIsLoaded();
|
||||
await processCloudDemoPage.processFilterCloudComponent.clickOnProcessFilters();
|
||||
});
|
||||
|
||||
it('[C290040] Should be able to open the Task Details page by clicking on the process name', async () => {
|
||||
await editProcessFilter.openFilter();
|
||||
await editProcessFilter.setAppNameDropDown(simpleApp);
|
||||
await editProcessFilter.setStatusFilterDropDown(PROCESS_STATUS.RUNNING);
|
||||
await editProcessFilter.setProperty('processInstanceId', processInstance.id);
|
||||
|
||||
await processList.getDataTable().selectRow('Id', processInstance.id);
|
||||
await browser.actions().sendKeys(protractor.Key.ENTER).perform();
|
||||
|
||||
await processDetailsCloudDemoPage.checkTaskIsDisplayed(taskName);
|
||||
await browser.navigate().back();
|
||||
|
||||
await taskFilter.clickOnTaskFilters();
|
||||
await editTaskFilter.openFilter();
|
||||
await taskList.checkContentIsDisplayedByName(taskAssigned[0].entry.name);
|
||||
await taskList.selectRow(taskAssigned[0].entry.name);
|
||||
await taskHeaderCloudPage.checkTaskPropertyListIsDisplayed();
|
||||
await expect(await taskFormCloudComponent.getFormTitle()).toContain(taskName);
|
||||
await taskFormCloudComponent.clickCompleteButton();
|
||||
});
|
||||
});
|
||||
@@ -0,0 +1,144 @@
|
||||
/*!
|
||||
* @license
|
||||
* Copyright 2019 Alfresco Software, Ltd.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import {
|
||||
ApiService,
|
||||
AppListCloudPage,
|
||||
GroupIdentityService,
|
||||
IdentityService,
|
||||
LoginPage,
|
||||
StringUtil,
|
||||
ProcessDefinitionsService,
|
||||
ProcessInstancesService,
|
||||
QueryService,
|
||||
TasksService,
|
||||
EditProcessFilterCloudComponentPage
|
||||
} from '@alfresco/adf-testing';
|
||||
import { browser } from 'protractor';
|
||||
import { ProcessCloudDemoPage } from './../pages/process-cloud-demo.page';
|
||||
import { TasksCloudDemoPage } from './../pages/tasks-cloud-demo.page';
|
||||
import { NavigationBarPage } from '../../core/pages/navigation-bar.page';
|
||||
import CONSTANTS = require('../../util/constants');
|
||||
|
||||
describe('Process filters cloud', () => {
|
||||
|
||||
describe('Process Filters', () => {
|
||||
const loginSSOPage = new LoginPage();
|
||||
const navigationBarPage = new NavigationBarPage();
|
||||
const appListCloudComponent = new AppListCloudPage();
|
||||
const processCloudDemoPage = new ProcessCloudDemoPage();
|
||||
const tasksCloudDemoPage = new TasksCloudDemoPage();
|
||||
const editProcessFilterCloudComponentPage = new EditProcessFilterCloudComponentPage();
|
||||
|
||||
const apiService = new ApiService();
|
||||
const identityService = new IdentityService(apiService);
|
||||
const groupIdentityService = new GroupIdentityService(apiService);
|
||||
const processDefinitionService = new ProcessDefinitionsService(apiService);
|
||||
const queryService = new QueryService(apiService);
|
||||
const tasksService = new TasksService(apiService);
|
||||
const processInstancesService = new ProcessInstancesService(apiService);
|
||||
|
||||
let runningProcess, completedProcess, testUser, groupInfo;
|
||||
const candidateBaseApp = browser.params.resources.ACTIVITI_CLOUD_APPS.CANDIDATE_BASE_APP.name;
|
||||
const PROCESSES = CONSTANTS.PROCESS_FILTERS;
|
||||
|
||||
beforeAll(async () => {
|
||||
await apiService.loginWithProfile('identityAdmin');
|
||||
|
||||
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);
|
||||
|
||||
const processDefinition = await processDefinitionService
|
||||
.getProcessDefinitionByName(browser.params.resources.ACTIVITI_CLOUD_APPS.CANDIDATE_BASE_APP.processes.candidateGroupProcess, candidateBaseApp);
|
||||
|
||||
runningProcess = await processInstancesService.createProcessInstance(processDefinition.entry.key, candidateBaseApp, {
|
||||
'name': StringUtil.generateRandomString(),
|
||||
'businessKey': StringUtil.generateRandomString()
|
||||
});
|
||||
|
||||
completedProcess = await processInstancesService.createProcessInstance(processDefinition.entry.key, candidateBaseApp, {
|
||||
'name': StringUtil.generateRandomString(),
|
||||
'businessKey': StringUtil.generateRandomString()
|
||||
});
|
||||
|
||||
const task = await queryService.getProcessInstanceTasks(completedProcess.entry.id, candidateBaseApp);
|
||||
const claimedTask = await tasksService.claimTask(task.list.entries[0].entry.id, candidateBaseApp);
|
||||
await tasksService.completeTask(claimedTask.entry.id, candidateBaseApp);
|
||||
|
||||
await loginSSOPage.login(testUser.username, testUser.password);
|
||||
|
||||
}, 5 * 60 * 1000);
|
||||
|
||||
afterAll(async () => {
|
||||
await apiService.loginWithProfile('identityAdmin');
|
||||
await identityService.deleteIdentityUser(testUser.idIdentityService);
|
||||
});
|
||||
|
||||
beforeEach(async () => {
|
||||
await navigationBarPage.navigateToProcessServicesCloudPage();
|
||||
await appListCloudComponent.checkApsContainer();
|
||||
await appListCloudComponent.goToApp(candidateBaseApp);
|
||||
await tasksCloudDemoPage.taskListCloudComponent().checkTaskListIsLoaded();
|
||||
await processCloudDemoPage.processFilterCloudComponent.clickOnProcessFilters();
|
||||
});
|
||||
|
||||
it('[C290021] Should be able to view default filters', async () => {
|
||||
await processCloudDemoPage.processFilterCloudComponent.checkCompletedProcessesFilterIsDisplayed();
|
||||
await processCloudDemoPage.processFilterCloudComponent.checkRunningProcessesFilterIsDisplayed();
|
||||
await processCloudDemoPage.processFilterCloudComponent.checkAllProcessesFilterIsDisplayed();
|
||||
});
|
||||
|
||||
it('[C290043] Should display process in Running Processes List when process is started', async () => {
|
||||
await processCloudDemoPage.processFilterCloudComponent.clickRunningProcessesFilter();
|
||||
await editProcessFilterCloudComponentPage.openFilter();
|
||||
await editProcessFilterCloudComponentPage.setProcessName(runningProcess.entry.name);
|
||||
await expect(await processCloudDemoPage.processFilterCloudComponent.getActiveFilterName()).toBe(PROCESSES.RUNNING);
|
||||
await processCloudDemoPage.processListCloudComponent().checkContentIsDisplayedById(runningProcess.entry.id);
|
||||
|
||||
await processCloudDemoPage.processFilterCloudComponent.clickCompletedProcessesFilter();
|
||||
await editProcessFilterCloudComponentPage.setProcessName(runningProcess.entry.name);
|
||||
await expect(await processCloudDemoPage.processFilterCloudComponent.getActiveFilterName()).toBe(PROCESSES.COMPLETED);
|
||||
await processCloudDemoPage.processListCloudComponent().checkContentIsNotDisplayedById(runningProcess.entry.id);
|
||||
|
||||
await processCloudDemoPage.processFilterCloudComponent.clickAllProcessesFilter();
|
||||
await editProcessFilterCloudComponentPage.setProcessName(runningProcess.entry.name);
|
||||
await expect(await processCloudDemoPage.processFilterCloudComponent.getActiveFilterName()).toBe(PROCESSES.ALL);
|
||||
await processCloudDemoPage.processListCloudComponent().checkContentIsDisplayedById(runningProcess.entry.id);
|
||||
});
|
||||
|
||||
it('[C290044] Should display process in Completed Processes List when process is completed', async () => {
|
||||
await processCloudDemoPage.processFilterCloudComponent.clickRunningProcessesFilter();
|
||||
await editProcessFilterCloudComponentPage.openFilter();
|
||||
await editProcessFilterCloudComponentPage.setProcessName(completedProcess.entry.name);
|
||||
await expect(await processCloudDemoPage.processFilterCloudComponent.getActiveFilterName()).toBe(PROCESSES.RUNNING);
|
||||
await processCloudDemoPage.processListCloudComponent().checkContentIsNotDisplayedById(completedProcess.entry.id);
|
||||
|
||||
await processCloudDemoPage.processFilterCloudComponent.clickCompletedProcessesFilter();
|
||||
await editProcessFilterCloudComponentPage.setProcessName(completedProcess.entry.name);
|
||||
await expect(await processCloudDemoPage.processFilterCloudComponent.getActiveFilterName()).toBe(PROCESSES.COMPLETED);
|
||||
await processCloudDemoPage.processListCloudComponent().checkContentIsDisplayedById(completedProcess.entry.id);
|
||||
|
||||
await processCloudDemoPage.processFilterCloudComponent.clickAllProcessesFilter();
|
||||
await editProcessFilterCloudComponentPage.setProcessName(completedProcess.entry.name);
|
||||
await expect(await processCloudDemoPage.processFilterCloudComponent.getActiveFilterName()).toBe(PROCESSES.ALL);
|
||||
await processCloudDemoPage.processListCloudComponent().checkContentIsDisplayedById(completedProcess.entry.id);
|
||||
});
|
||||
});
|
||||
});
|
||||
@@ -0,0 +1,153 @@
|
||||
/*!
|
||||
* @license
|
||||
* Copyright 2019 Alfresco Software, Ltd.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { ApiService, AppListCloudPage, GroupIdentityService, IdentityService, LoginPage, ProcessDefinitionsService, ProcessHeaderCloudPage, ProcessInstancesService, QueryService, StringUtil, LocalStorageUtil } from '@alfresco/adf-testing';
|
||||
import { browser } from 'protractor';
|
||||
import { ProcessCloudDemoPage } from './../pages/process-cloud-demo.page';
|
||||
import { TasksCloudDemoPage } from './../pages/tasks-cloud-demo.page';
|
||||
import { NavigationBarPage } from '../../core/pages/navigation-bar.page';
|
||||
import CONSTANTS = require('../../util/constants');
|
||||
import moment = require('moment');
|
||||
import { EditProcessFilterConfiguration } from './../config/edit-process-filter.config';
|
||||
|
||||
describe('Process Header cloud component', () => {
|
||||
|
||||
describe('Process Header cloud component', () => {
|
||||
const simpleApp = browser.params.resources.ACTIVITI_CLOUD_APPS.SIMPLE_APP.name;
|
||||
const subProcessApp = browser.params.resources.ACTIVITI_CLOUD_APPS.SUB_PROCESS_APP.name;
|
||||
const formatDate = 'MMM D, YYYY';
|
||||
|
||||
const processHeaderCloudPage = new ProcessHeaderCloudPage();
|
||||
|
||||
const loginSSOPage = new LoginPage();
|
||||
const navigationBarPage = new NavigationBarPage();
|
||||
const appListCloudComponent = new AppListCloudPage();
|
||||
|
||||
const tasksCloudDemoPage = new TasksCloudDemoPage();
|
||||
const taskList = tasksCloudDemoPage.taskListCloudComponent();
|
||||
|
||||
const processCloudDemoPage = new ProcessCloudDemoPage();
|
||||
const editProcessFilter = processCloudDemoPage.editProcessFilterCloudComponent();
|
||||
const processFilter = processCloudDemoPage.processFilterCloudComponent;
|
||||
const processList = processCloudDemoPage.processListCloudComponent();
|
||||
|
||||
const editProcessFilterConfiguration = new EditProcessFilterConfiguration();
|
||||
const editProcessFilterConfigFile = editProcessFilterConfiguration.getConfiguration();
|
||||
|
||||
const apiService = new ApiService();
|
||||
const identityService = new IdentityService(apiService);
|
||||
const groupIdentityService = new GroupIdentityService(apiService);
|
||||
const processDefinitionService = new ProcessDefinitionsService(apiService);
|
||||
const processInstancesService = new ProcessInstancesService(apiService);
|
||||
const queryService = new QueryService(apiService);
|
||||
|
||||
let testUser, groupInfo;
|
||||
|
||||
let runningProcess, runningCreatedDate, parentCompleteProcess, childCompleteProcess, completedCreatedDate;
|
||||
const PROCESSES = CONSTANTS.PROCESS_FILTERS;
|
||||
|
||||
beforeAll(async () => {
|
||||
await apiService.loginWithProfile('identityAdmin');
|
||||
|
||||
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);
|
||||
|
||||
const dropdownRestProcess = await processDefinitionService.getProcessDefinitionByName(browser.params.resources.ACTIVITI_CLOUD_APPS.SIMPLE_APP.processes.dropdownrestprocess, simpleApp);
|
||||
|
||||
const processparent = await processDefinitionService.getProcessDefinitionByName(browser.params.resources.ACTIVITI_CLOUD_APPS.SUB_PROCESS_APP.processes.processparent, subProcessApp);
|
||||
|
||||
runningProcess = await processInstancesService.createProcessInstance(dropdownRestProcess.entry.key,
|
||||
simpleApp, { name: StringUtil.generateRandomString(), businessKey: 'test' });
|
||||
|
||||
runningCreatedDate = moment(runningProcess.entry.startDate).format(formatDate);
|
||||
|
||||
parentCompleteProcess = await processInstancesService.createProcessInstance(processparent.entry.key,
|
||||
subProcessApp);
|
||||
|
||||
const parentProcessInstance = await queryService.getProcessInstanceSubProcesses(parentCompleteProcess.entry.id,
|
||||
subProcessApp);
|
||||
|
||||
childCompleteProcess = parentProcessInstance.list.entries[0];
|
||||
|
||||
completedCreatedDate = moment(childCompleteProcess.entry.startDate).format(formatDate);
|
||||
|
||||
await loginSSOPage.login(testUser.username, testUser.password);
|
||||
await LocalStorageUtil.setConfigField('adf-edit-process-filter', JSON.stringify(editProcessFilterConfigFile));
|
||||
});
|
||||
|
||||
afterAll(async() => {
|
||||
await apiService.loginWithProfile('identityAdmin');
|
||||
await identityService.deleteIdentityUser(testUser.idIdentityService);
|
||||
});
|
||||
|
||||
beforeEach(async () => {
|
||||
await navigationBarPage.navigateToProcessServicesCloudPage();
|
||||
await appListCloudComponent.checkApsContainer();
|
||||
});
|
||||
|
||||
it('[C305010] Should display process details for running process', async () => {
|
||||
await appListCloudComponent.goToApp(simpleApp);
|
||||
await taskList.checkTaskListIsLoaded();
|
||||
await processFilter.clickOnProcessFilters();
|
||||
await processFilter.clickRunningProcessesFilter();
|
||||
|
||||
await expect(await processFilter.getActiveFilterName()).toBe(PROCESSES.RUNNING);
|
||||
|
||||
await editProcessFilter.setFilter({ processName: runningProcess.entry.name });
|
||||
await processList.getDataTable().waitTillContentLoaded();
|
||||
await processList.checkContentIsDisplayedByName(runningProcess.entry.name);
|
||||
|
||||
await processList.selectRow(runningProcess.entry.name);
|
||||
await expect(await processHeaderCloudPage.getId()).toEqual(runningProcess.entry.id);
|
||||
await expect(await processHeaderCloudPage.getName()).toEqual(runningProcess.entry.name);
|
||||
await expect(await processHeaderCloudPage.getStatus()).toEqual('RUNNING');
|
||||
await expect(await processHeaderCloudPage.getInitiator()).toEqual(runningProcess.entry.initiator);
|
||||
await expect(await processHeaderCloudPage.getStartDate()).toEqual(runningCreatedDate);
|
||||
await expect(await processHeaderCloudPage.getParentId()).toEqual(CONSTANTS.PROCESS_DETAILS.NO_PARENT);
|
||||
await expect(await processHeaderCloudPage.getBusinessKey()).toEqual(runningProcess.entry.businessKey);
|
||||
await expect(await processHeaderCloudPage.getLastModified()).toEqual(runningCreatedDate);
|
||||
});
|
||||
|
||||
it('[C305008] Should display process details for completed process', async () => {
|
||||
await appListCloudComponent.goToApp(subProcessApp);
|
||||
await taskList.checkTaskListIsLoaded();
|
||||
await processFilter.clickOnProcessFilters();
|
||||
|
||||
await processFilter.clickCompletedProcessesFilter();
|
||||
await expect(await processFilter.getActiveFilterName()).toBe(PROCESSES.COMPLETED);
|
||||
|
||||
await editProcessFilter.setFilter({ initiator: `${testUser.firstName} ${testUser.lastName}` });
|
||||
await processList.getDataTable().waitTillContentLoaded();
|
||||
await processList.checkContentIsDisplayedByName(childCompleteProcess.entry.name);
|
||||
|
||||
await processList.checkProcessListIsLoaded();
|
||||
await processList.selectRowById(childCompleteProcess.entry.id);
|
||||
|
||||
await expect(await processHeaderCloudPage.getId()).toEqual(childCompleteProcess.entry.id);
|
||||
await expect(await processHeaderCloudPage.getName()).toEqual(CONSTANTS.PROCESS_DETAILS.NO_NAME);
|
||||
await expect(await processHeaderCloudPage.getStatus()).toEqual('COMPLETED');
|
||||
await expect(await processHeaderCloudPage.getInitiator()).toEqual(childCompleteProcess.entry.initiator);
|
||||
await expect(await processHeaderCloudPage.getStartDate()).toEqual(completedCreatedDate);
|
||||
await expect(await processHeaderCloudPage.getParentId()).toEqual(childCompleteProcess.entry.parentId);
|
||||
await expect(await processHeaderCloudPage.getBusinessKey()).toEqual(CONSTANTS.PROCESS_DETAILS.NO_BUSINESS_KEY);
|
||||
await expect(await processHeaderCloudPage.getLastModified()).toEqual(completedCreatedDate);
|
||||
});
|
||||
});
|
||||
});
|
||||
@@ -0,0 +1,202 @@
|
||||
/*!
|
||||
* @license
|
||||
* Copyright 2019 Alfresco Software, Ltd.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { ApiService, AppListCloudPage, GroupIdentityService, IdentityService, LoginPage, ProcessDefinitionsService, ProcessInstancesService, LocalStorageUtil } from '@alfresco/adf-testing';
|
||||
import { browser } from 'protractor';
|
||||
import { ProcessCloudDemoPage } from './../pages/process-cloud-demo.page';
|
||||
import { TasksCloudDemoPage } from './../pages/tasks-cloud-demo.page';
|
||||
import { NavigationBarPage } from '../../core/pages/navigation-bar.page';
|
||||
import { ProcessDetailsCloudDemoPage } from './../pages/process-details-cloud-demo.page';
|
||||
import { EditProcessFilterConfiguration } from './../config/edit-process-filter.config';
|
||||
import CONSTANTS = require('../../util/constants');
|
||||
|
||||
describe('Process list cloud', () => {
|
||||
|
||||
describe('Process List - selection', () => {
|
||||
|
||||
const simpleApp = browser.params.resources.ACTIVITI_CLOUD_APPS.SIMPLE_APP.name;
|
||||
|
||||
const loginSSOPage = new LoginPage();
|
||||
const navigationBarPage = new NavigationBarPage();
|
||||
const appListCloudComponent = new AppListCloudPage();
|
||||
|
||||
const processCloudDemoPage = new ProcessCloudDemoPage();
|
||||
const editProcessFilter = processCloudDemoPage.editProcessFilterCloudComponent();
|
||||
const processList = processCloudDemoPage.processListCloudComponent();
|
||||
const processFilter = processCloudDemoPage.processFilterCloudComponent;
|
||||
|
||||
const tasksCloudDemoPage = new TasksCloudDemoPage();
|
||||
const processDetailsCloudDemoPage = new ProcessDetailsCloudDemoPage();
|
||||
|
||||
const apiService = new ApiService();
|
||||
const identityService = new IdentityService(apiService);
|
||||
const groupIdentityService = new GroupIdentityService(apiService);
|
||||
const processDefinitionService = new ProcessDefinitionsService(apiService);
|
||||
const processInstancesService = new ProcessInstancesService(apiService);
|
||||
|
||||
let testUser, groupInfo;
|
||||
|
||||
const noOfProcesses = 3;
|
||||
const processInstances = [];
|
||||
const editProcessFilterConfiguration = new EditProcessFilterConfiguration();
|
||||
const editProcessFilterConfigFile = editProcessFilterConfiguration.getConfiguration();
|
||||
const PROCESSES = CONSTANTS.PROCESS_FILTERS;
|
||||
|
||||
beforeAll(async () => {
|
||||
await apiService.loginWithProfile('identityAdmin');
|
||||
|
||||
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);
|
||||
const processDefinition = await processDefinitionService
|
||||
.getProcessDefinitionByName(browser.params.resources.ACTIVITI_CLOUD_APPS.SIMPLE_APP.processes.simpleProcess, simpleApp);
|
||||
|
||||
for (let i = 0; i < noOfProcesses; i++) {
|
||||
const response = await processInstancesService.createProcessInstance(processDefinition.entry.key, simpleApp);
|
||||
processInstances.push(response.entry.id);
|
||||
}
|
||||
|
||||
await loginSSOPage.login(testUser.username, testUser.password);
|
||||
await LocalStorageUtil.setConfigField('adf-edit-process-filter', JSON.stringify(editProcessFilterConfigFile));
|
||||
});
|
||||
|
||||
afterAll(async() => {
|
||||
await apiService.loginWithProfile('identityAdmin');
|
||||
await identityService.deleteIdentityUser(testUser.idIdentityService);
|
||||
});
|
||||
|
||||
beforeEach(async () => {
|
||||
await navigationBarPage.navigateToProcessServicesCloudPage();
|
||||
await expect(processInstances.length).toEqual(noOfProcesses, 'Wrong preconditions');
|
||||
await appListCloudComponent.checkApsContainer();
|
||||
await appListCloudComponent.goToApp(simpleApp);
|
||||
await processFilter.clickOnProcessFilters();
|
||||
await processFilter.clickRunningProcessesFilter();
|
||||
await expect(await processFilter.getActiveFilterName()).toBe(PROCESSES.RUNNING);
|
||||
await tasksCloudDemoPage.clickSettingsButton();
|
||||
await tasksCloudDemoPage.disableDisplayProcessDetails();
|
||||
await tasksCloudDemoPage.clickAppButton();
|
||||
});
|
||||
|
||||
it('[C297469] Should NOT be able to select a process when settings are set to None', async () => {
|
||||
await tasksCloudDemoPage.clickSettingsButton();
|
||||
await tasksCloudDemoPage.selectSelectionMode('None');
|
||||
await tasksCloudDemoPage.clickAppButton();
|
||||
await processFilter.isProcessFiltersListVisible();
|
||||
await expect(await processFilter.getActiveFilterName()).toEqual(PROCESSES.RUNNING);
|
||||
await editProcessFilter.openFilter();
|
||||
await editProcessFilter.setInitiator(`${testUser.firstName} ${testUser.lastName}`);
|
||||
await processList.getDataTable().waitTillContentLoaded();
|
||||
await processList.selectRowById(processInstances[0]);
|
||||
await processList.getDataTable().checkNoRowIsSelected();
|
||||
});
|
||||
|
||||
it('[C297468] Should be able to select only one process when settings are set to Single', async () => {
|
||||
await tasksCloudDemoPage.clickSettingsButton();
|
||||
await tasksCloudDemoPage.selectSelectionMode('Single');
|
||||
await tasksCloudDemoPage.clickAppButton();
|
||||
await processFilter.isProcessFiltersListVisible();
|
||||
await expect(await processFilter.getActiveFilterName()).toEqual(PROCESSES.RUNNING);
|
||||
|
||||
await editProcessFilter.setFilter({ 'initiator': `${testUser.firstName} ${testUser.lastName}`});
|
||||
await processList.getDataTable().waitTillContentLoaded();
|
||||
await processList.selectRowById(processInstances[0]);
|
||||
await processList.checkRowIsSelectedById(processInstances[0]);
|
||||
await expect(await processList.getDataTable().getNumberOfSelectedRows()).toEqual(1);
|
||||
await processList.selectRowById(processInstances[1]);
|
||||
await processList.checkRowIsSelectedById(processInstances[1]);
|
||||
await expect(await processList.getDataTable().getNumberOfSelectedRows()).toEqual(1);
|
||||
});
|
||||
|
||||
it('[C297470] Should be able to select multiple processes using keyboard', async () => {
|
||||
await tasksCloudDemoPage.clickSettingsButton();
|
||||
await tasksCloudDemoPage.selectSelectionMode('Multiple');
|
||||
await tasksCloudDemoPage.clickAppButton();
|
||||
await processFilter.isProcessFiltersListVisible();
|
||||
await expect(await processFilter.getActiveFilterName()).toEqual(PROCESSES.RUNNING);
|
||||
await editProcessFilter.setFilter({ 'initiator': `${testUser.firstName} ${testUser.lastName}`});
|
||||
await processList.getDataTable().waitTillContentLoaded();
|
||||
await processList.selectRowById(processInstances[0]);
|
||||
await processList.checkRowIsSelectedById(processInstances[0]);
|
||||
await processList.selectRowWithKeyboard(processInstances[1]);
|
||||
await processList.checkRowIsSelectedById(processInstances[0]);
|
||||
await processList.checkRowIsSelectedById(processInstances[1]);
|
||||
await processList.checkRowIsNotSelectedById(processInstances[2]);
|
||||
await expect(await processList.getDataTable().getNumberOfSelectedRows()).toEqual(2);
|
||||
});
|
||||
|
||||
it('[C297465] Should be able to select multiple processes using checkboxes', async () => {
|
||||
await tasksCloudDemoPage.clickSettingsButton();
|
||||
await tasksCloudDemoPage.enableMultiSelection();
|
||||
await tasksCloudDemoPage.clickAppButton();
|
||||
await processFilter.isProcessFiltersListVisible();
|
||||
await expect(await processFilter.getActiveFilterName()).toEqual(PROCESSES.RUNNING);
|
||||
await editProcessFilter.setFilter({ 'initiator': `${testUser.firstName} ${testUser.lastName}`});
|
||||
await processList.getDataTable().waitTillContentLoaded();
|
||||
await processList.checkCheckboxById(processInstances[0]);
|
||||
await processList.checkRowIsCheckedById(processInstances[0]);
|
||||
await processList.checkCheckboxById(processInstances[1]);
|
||||
await processList.checkRowIsCheckedById(processInstances[1]);
|
||||
await processList.checkRowIsNotCheckedById(processInstances[2]);
|
||||
await processList.checkCheckboxById(processInstances[1]);
|
||||
await processList.checkRowIsNotCheckedById(processInstances[1]);
|
||||
await processList.checkRowIsCheckedById(processInstances[0]);
|
||||
});
|
||||
|
||||
it('[C299125] Should be possible to select all the rows when multiselect is true', async () => {
|
||||
await tasksCloudDemoPage.clickSettingsButton();
|
||||
await tasksCloudDemoPage.enableMultiSelection();
|
||||
await tasksCloudDemoPage.clickAppButton();
|
||||
await processFilter.isProcessFiltersListVisible();
|
||||
await editProcessFilter.setFilter({ 'initiator': `${testUser.firstName} ${testUser.lastName}`});
|
||||
await processList.getDataTable().waitTillContentLoaded();
|
||||
await expect(await processFilter.getActiveFilterName()).toEqual(PROCESSES.RUNNING);
|
||||
await browser.sleep(1000);
|
||||
await processList.getDataTable().checkAllRowsButtonIsDisplayed();
|
||||
await processList.getDataTable().checkAllRows();
|
||||
await processList.checkRowIsCheckedById(processInstances[0]);
|
||||
await processList.checkRowIsCheckedById(processInstances[1]);
|
||||
await processList.checkRowIsCheckedById(processInstances[2]);
|
||||
|
||||
await processList.getDataTable().checkAllRowsButtonIsDisplayed();
|
||||
await processList.getDataTable().uncheckAllRows();
|
||||
await processList.checkRowIsNotCheckedById(processInstances[0]);
|
||||
await processList.checkRowIsNotCheckedById(processInstances[1]);
|
||||
await processList.checkRowIsNotCheckedById(processInstances[2]);
|
||||
});
|
||||
|
||||
it('[C297467] Should be able to see selected processes', async () => {
|
||||
await tasksCloudDemoPage.clickSettingsButton();
|
||||
await tasksCloudDemoPage.enableMultiSelection();
|
||||
await tasksCloudDemoPage.enableTestingMode();
|
||||
await tasksCloudDemoPage.clickAppButton();
|
||||
await processFilter.isProcessFiltersListVisible();
|
||||
await expect(await processFilter.getActiveFilterName()).toEqual(PROCESSES.RUNNING);
|
||||
await editProcessFilter.setFilter({ 'initiator': `${testUser.firstName} ${testUser.lastName}`});
|
||||
await processList.getDataTable().waitTillContentLoaded();
|
||||
await processList.checkCheckboxById(processInstances[0]);
|
||||
await processList.checkRowIsCheckedById(processInstances[0]);
|
||||
await processDetailsCloudDemoPage.checkListedSelectedProcessInstance(processInstances[0]);
|
||||
|
||||
await processList.checkCheckboxById(processInstances[1]);
|
||||
await processList.checkRowIsCheckedById(processInstances[1]);
|
||||
await processDetailsCloudDemoPage.checkListedSelectedProcessInstance(processInstances[1]);
|
||||
});
|
||||
});
|
||||
});
|
||||
@@ -0,0 +1,180 @@
|
||||
/*!
|
||||
* @license
|
||||
* Copyright 2019 Alfresco Software, Ltd.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { browser } from 'protractor';
|
||||
import {
|
||||
ApiService,
|
||||
AppListCloudPage,
|
||||
ContentNodeSelectorDialogPage,
|
||||
GroupIdentityService,
|
||||
IdentityService,
|
||||
LoginPage,
|
||||
QueryService,
|
||||
ProcessCloudWidgetPage,
|
||||
ProcessDefinitionsService,
|
||||
ProcessInstancesService,
|
||||
StringUtil,
|
||||
TaskFormCloudComponent,
|
||||
TasksService,
|
||||
UploadActions,
|
||||
ViewerPage
|
||||
} from '@alfresco/adf-testing';
|
||||
import { ProcessCloudDemoPage } from './../pages/process-cloud-demo.page';
|
||||
import { NavigationBarPage } from '../../core/pages/navigation-bar.page';
|
||||
import { TasksCloudDemoPage } from './../pages/tasks-cloud-demo.page';
|
||||
import CONSTANTS = require('../../util/constants');
|
||||
|
||||
describe('Process Task - Attach content file', () => {
|
||||
|
||||
const loginSSOPage = new LoginPage();
|
||||
const navigationBarPage = new NavigationBarPage();
|
||||
const appListCloudComponent = new AppListCloudPage();
|
||||
|
||||
const processCloudDemoPage = new ProcessCloudDemoPage();
|
||||
const editProcessFilter = processCloudDemoPage.editProcessFilterCloudComponent();
|
||||
const processList = processCloudDemoPage.processListCloudComponent();
|
||||
|
||||
const tasksCloudDemoPage = new TasksCloudDemoPage();
|
||||
const taskFilter = tasksCloudDemoPage.taskFilterCloudComponent;
|
||||
const taskList = tasksCloudDemoPage.taskListCloudComponent();
|
||||
|
||||
const taskFormCloudComponent = new TaskFormCloudComponent();
|
||||
const processCloudWidget = new ProcessCloudWidgetPage();
|
||||
const contentNodeSelectorDialog = new ContentNodeSelectorDialogPage();
|
||||
|
||||
const apiService = new ApiService();
|
||||
const uploadActions = new UploadActions(apiService);
|
||||
const processDefinitionService = new ProcessDefinitionsService(apiService);
|
||||
const processInstancesService = new ProcessInstancesService(apiService);
|
||||
const identityService = new IdentityService(apiService);
|
||||
const groupIdentityService = new GroupIdentityService(apiService);
|
||||
const queryService = new QueryService(apiService);
|
||||
const tasksService = new TasksService(apiService);
|
||||
|
||||
const viewerPage = new ViewerPage();
|
||||
const simpleApp = browser.params.resources.ACTIVITI_CLOUD_APPS.SIMPLE_APP.name;
|
||||
const processDefinitionName = browser.params.resources.ACTIVITI_CLOUD_APPS.SIMPLE_APP.processes.uploadSingleMultipleFiles;
|
||||
const uploadWidgetId = browser.params.resources.ACTIVITI_CLOUD_APPS.SIMPLE_APP.forms.uploadSingleMultiple.widgets.contentMultipleAttachFileId;
|
||||
const taskName = browser.params.resources.ACTIVITI_CLOUD_APPS.SIMPLE_APP.tasks.uploadSingleMultipleFiles;
|
||||
const folderName = StringUtil.generateRandomString(5);
|
||||
|
||||
let uploadedFolder: any;
|
||||
let processInstance: any;
|
||||
let testUser: any;
|
||||
let groupInfo: any;
|
||||
|
||||
const pdfFileOne = {
|
||||
'name': browser.params.resources.Files.ADF_DOCUMENTS.PNG.file_name,
|
||||
'location': browser.params.resources.Files.ADF_DOCUMENTS.PNG.file_path
|
||||
};
|
||||
|
||||
const pdfFileTwo = {
|
||||
'name': browser.params.resources.Files.ADF_DOCUMENTS.PNG_B.file_name,
|
||||
'location': browser.params.resources.Files.ADF_DOCUMENTS.PNG_B.file_path
|
||||
};
|
||||
|
||||
beforeAll(async () => {
|
||||
await apiService.loginWithProfile('identityAdmin');
|
||||
|
||||
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);
|
||||
const processDefinition = await processDefinitionService.getProcessDefinitionByName(processDefinitionName, simpleApp);
|
||||
processInstance = await processInstancesService.createProcessInstance(processDefinition.entry.key, simpleApp, { name: 'upload process' });
|
||||
|
||||
const task = await queryService.getProcessInstanceTasks(processInstance.entry.id, simpleApp);
|
||||
await tasksService.claimTask(task.list.entries[0].entry.id, simpleApp);
|
||||
await apiService.login(testUser.username, testUser.password);
|
||||
uploadedFolder = await uploadActions.createFolder(folderName, '-my-');
|
||||
await uploadActions.uploadFile(pdfFileOne.location, pdfFileOne.name, uploadedFolder.entry.id);
|
||||
await uploadActions.uploadFile(pdfFileTwo.location, pdfFileTwo.name, uploadedFolder.entry.id);
|
||||
|
||||
await loginSSOPage.login(testUser.username, testUser.password);
|
||||
await navigationBarPage.navigateToProcessServicesCloudPage();
|
||||
await appListCloudComponent.checkApsContainer();
|
||||
});
|
||||
|
||||
afterAll(async () => {
|
||||
await uploadActions.deleteFileOrFolder(uploadedFolder.entry.id);
|
||||
await apiService.loginWithProfile('identityAdmin');
|
||||
await identityService.deleteIdentityUser(testUser.idIdentityService);
|
||||
});
|
||||
|
||||
it('[C311290] Should be able to attach multiple files when widget allows multiple files to be attached from content', async () => {
|
||||
await appListCloudComponent.checkAppIsDisplayed(simpleApp);
|
||||
await appListCloudComponent.goToApp(simpleApp);
|
||||
|
||||
await processCloudDemoPage.processFilterCloudComponent.clickOnProcessFilters();
|
||||
await processCloudDemoPage.processFilterCloudComponent.clickRunningProcessesFilter();
|
||||
await editProcessFilter.openFilter();
|
||||
await editProcessFilter.setProcessName('upload process');
|
||||
await editProcessFilter.openFilter();
|
||||
await expect(await processCloudDemoPage.processFilterCloudComponent.getActiveFilterName()).toBe(CONSTANTS.PROCESS_FILTERS.RUNNING);
|
||||
|
||||
await processList.checkContentIsDisplayedById(processInstance.entry.id);
|
||||
await processList.selectRowById(processInstance.entry.id);
|
||||
|
||||
await taskList.checkTaskListIsLoaded();
|
||||
await taskList.selectRow(taskName);
|
||||
|
||||
await taskFormCloudComponent.formFields().checkFormIsDisplayed();
|
||||
await taskFormCloudComponent.formFields().checkWidgetIsVisible(uploadWidgetId);
|
||||
const contentUploadFileWidget = await processCloudWidget.attachFileWidgetCloud(uploadWidgetId);
|
||||
await contentUploadFileWidget.clickAttachContentFile(uploadWidgetId);
|
||||
|
||||
await contentNodeSelectorDialog.attachFileFromContentNode(folderName, pdfFileOne.name);
|
||||
await viewAttachedFile(contentUploadFileWidget, pdfFileOne.name);
|
||||
|
||||
await taskFormCloudComponent.formFields().checkWidgetIsVisible(uploadWidgetId);
|
||||
await contentUploadFileWidget.clickAttachContentFile(uploadWidgetId);
|
||||
|
||||
await contentNodeSelectorDialog.attachFileFromContentNode(folderName, pdfFileTwo.name);
|
||||
await viewAttachedFile(contentUploadFileWidget, pdfFileTwo.name);
|
||||
await taskFormCloudComponent.clickCompleteButton();
|
||||
|
||||
await expect(await taskFilter.getActiveFilterName()).toBe('My Tasks');
|
||||
await taskList.checkContentIsNotDisplayedByName(taskName);
|
||||
|
||||
await taskFilter.clickTaskFilter('completed-tasks');
|
||||
await taskList.getDataTable().waitTillContentLoaded();
|
||||
await taskList.checkContentIsDisplayedByName(taskName);
|
||||
|
||||
await processCloudDemoPage.processFilterCloudComponent.clickOnProcessFilters();
|
||||
await processCloudDemoPage.processFilterCloudComponent.clickCompletedProcessesFilter();
|
||||
|
||||
await editProcessFilter.openFilter();
|
||||
await editProcessFilter.setProcessName('upload process');
|
||||
await editProcessFilter.openFilter();
|
||||
|
||||
await expect(await processCloudDemoPage.processFilterCloudComponent.getActiveFilterName()).toBe(CONSTANTS.PROCESS_FILTERS.COMPLETED);
|
||||
await processList.checkContentIsDisplayedById(processInstance.entry.id);
|
||||
});
|
||||
|
||||
async function viewAttachedFile(contentUploadWidget: any, fileName: string): Promise<void> {
|
||||
await contentUploadWidget.checkFileIsAttached(fileName);
|
||||
await contentUploadWidget.viewFile(fileName);
|
||||
|
||||
await viewerPage.checkToolbarIsDisplayed();
|
||||
await viewerPage.checkInfoButtonIsDisplayed();
|
||||
await viewerPage.checkDownloadButtonIsDisplayed();
|
||||
await viewerPage.checkFileThumbnailIsDisplayed();
|
||||
await viewerPage.checkFileNameIsDisplayed(fileName);
|
||||
await viewerPage.clickCloseButton();
|
||||
}
|
||||
});
|
||||
Reference in New Issue
Block a user