mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-06-02 17:35:08 +00:00
* Refactor isCompleteFormButtonDisabled method - Change the isCompleteFormButtonDisabled() method structure as per the Code Style E2E 03-01 - Replace the isCompleteFormButtonDisabled() with isCompleteFormButtonEnabled() in the tests - Add lists with the default tasks and process filters name in order to use a variable instead of a string (ADW eg. in the breadcrumb checks) * Add visibility wait in isCompleteFormButtonEnabled method * Refactor isProcessListDisplayed method - Change the isProcessListDisplayed() method structure as per the Code Style E2E 03-01 - Replace the checkProcessListIsDisplayed() with isProcessListDisplayed() in the tests * Fix isCompleteFormButtonEnabled and isCancelButtonEnabled methods * Fix isCompleteFormButtonEnabled method * Create separate method to check for Complete button visibility * fix tslint
270 lines
14 KiB
TypeScript
270 lines
14 KiB
TypeScript
/*!
|
|
* @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 {
|
|
LoginSSOPage,
|
|
ApplicationsUtil,
|
|
ProcessUtil,
|
|
StartProcessPage,
|
|
ApiService,
|
|
UserModel
|
|
} from '@alfresco/adf-testing';
|
|
import { NavigationBarPage } from '../pages/adf/navigation-bar.page';
|
|
import { ProcessServicesPage } from '../pages/adf/process-services/process-services.page';
|
|
import { ProcessFiltersPage } from '../pages/adf/process-services/process-filters.page';
|
|
import { ProcessServiceTabBarPage } from '../pages/adf/process-services/process-service-tab-bar.page';
|
|
import { ProcessDetailsPage } from '../pages/adf/process-services/process-details.page';
|
|
import { ProcessListPage } from '../pages/adf/process-services/process-list.page';
|
|
import { UsersActions } from '../actions/users.actions';
|
|
import { browser } from 'protractor';
|
|
import { TasksPage } from '../pages/adf/process-services/tasks.page';
|
|
import CONSTANTS = require('../util/constants');
|
|
|
|
describe('Task Assignee', () => {
|
|
|
|
const app = browser.params.resources.Files.TEST_ASSIGNEE;
|
|
|
|
const loginPage = new LoginSSOPage();
|
|
const navigationBarPage = new NavigationBarPage();
|
|
const processServicesPage = new ProcessServicesPage();
|
|
const processListPage = new ProcessListPage();
|
|
const processFiltersPage = new ProcessFiltersPage();
|
|
const startProcessPage = new StartProcessPage();
|
|
const processServiceTabBarPage = new ProcessServiceTabBarPage();
|
|
const processDetailsPage = new ProcessDetailsPage();
|
|
const taskPage = new TasksPage();
|
|
|
|
const apiService = new ApiService();
|
|
const usersActions = new UsersActions(apiService);
|
|
const applicationsService = new ApplicationsUtil(apiService);
|
|
|
|
describe('Candidate User Assignee', () => {
|
|
|
|
let user: UserModel;
|
|
|
|
beforeAll(async () => {
|
|
await apiService.getInstance().login(browser.params.testConfig.admin.email, browser.params.testConfig.admin.password);
|
|
|
|
user = await usersActions.createUser(new UserModel({
|
|
firstName: app.candidate.firstName,
|
|
lastName: app.candidate.lastName
|
|
}));
|
|
|
|
try {// creates group if not available
|
|
await apiService.getInstance().activiti.adminGroupsApi.createNewGroup({
|
|
'name': app.candidateGroup,
|
|
'tenantId': user.tenantId,
|
|
'type': 1
|
|
});
|
|
} catch (e) {
|
|
}
|
|
|
|
await apiService.getInstance().login(user.email, user.password);
|
|
await applicationsService.importPublishDeployApp(app.file_path, { renewIdmEntries: true });
|
|
|
|
await loginPage.login(user.email, user.password);
|
|
});
|
|
|
|
afterAll(async () => {
|
|
await apiService.getInstance().login(browser.params.testConfig.admin.email, browser.params.testConfig.admin.password);
|
|
await apiService.getInstance().activiti.adminTenantsApi.deleteTenant(user.tenantId);
|
|
});
|
|
|
|
beforeEach(async () => {
|
|
await navigationBarPage.navigateToProcessServicesPage();
|
|
await processServicesPage.checkApsContainer();
|
|
});
|
|
|
|
it('[C260387] Should the running process be displayed when clicking on Running filter', async () => {
|
|
const name = 'sample-process-one';
|
|
await processServicesPage.goToApp(app.title);
|
|
await processServiceTabBarPage.clickProcessButton();
|
|
await expect(await processListPage.isProcessListDisplayed()).toEqual(true);
|
|
await processFiltersPage.clickCreateProcessButton();
|
|
await processFiltersPage.clickNewProcessDropdown();
|
|
await startProcessPage.startProcess(name, app.processNames[0]);
|
|
await processFiltersPage.selectFromProcessList(name);
|
|
await processDetailsPage.clickOnActiveTask();
|
|
|
|
await taskPage.tasksListPage().checkContentIsDisplayed(app.userTasks.simple.one);
|
|
await taskPage.tasksListPage().selectRow(app.userTasks.simple.one);
|
|
await taskPage.taskDetails().clickCompleteFormTask();
|
|
await taskPage.tasksListPage().checkContentIsNotDisplayed(app.userTasks.simple.one);
|
|
|
|
await taskPage.filtersPage().goToFilter(CONSTANTS.TASK_FILTERS.MY_TASKS);
|
|
await taskPage.tasksListPage().checkContentIsNotDisplayed(app.userTasks.simple.one);
|
|
|
|
await taskPage.filtersPage().goToFilter(CONSTANTS.TASK_FILTERS.COMPLETED_TASKS);
|
|
await taskPage.tasksListPage().checkContentIsNotDisplayed(app.userTasks.simple.one);
|
|
|
|
await taskPage.filtersPage().goToFilter(CONSTANTS.TASK_FILTERS.MY_TASKS);
|
|
await taskPage.taskDetails().clickCompleteFormTask();
|
|
await taskPage.tasksListPage().checkContentIsNotDisplayed(app.userTasks.simple.two);
|
|
|
|
await taskPage.filtersPage().goToFilter(CONSTANTS.TASK_FILTERS.COMPLETED_TASKS);
|
|
await taskPage.tasksListPage().checkContentIsDisplayed(app.userTasks.simple.two);
|
|
});
|
|
});
|
|
|
|
describe('Candidate Group Assignee', () => {
|
|
let user: UserModel;
|
|
let candidate1: UserModel;
|
|
let candidate2: UserModel;
|
|
|
|
beforeAll(async () => {
|
|
await apiService.getInstance().login(browser.params.testConfig.admin.email, browser.params.testConfig.admin.password);
|
|
user = await usersActions.createUser();
|
|
candidate1 = await usersActions.createUser(new UserModel({ tenantId: user.tenantId }));
|
|
candidate2 = await usersActions.createUser(new UserModel({ tenantId: user.tenantId }));
|
|
|
|
const adminGroup = await apiService.getInstance().activiti.adminGroupsApi.createNewGroup(
|
|
{ 'name': app.adminGroup, 'tenantId': user.tenantId }
|
|
);
|
|
|
|
await apiService.getInstance().activiti.adminGroupsApi.addGroupMember(adminGroup.id, user.id);
|
|
|
|
await apiService.getInstance().activiti.adminGroupsApi.addGroupCapabilities(adminGroup.id, { capabilities: app.adminCapabilities });
|
|
|
|
const candidateGroup = await apiService.getInstance().activiti.adminGroupsApi.createNewGroup(
|
|
{ 'name': app.candidateGroup, 'tenantId': user.tenantId, 'type': 1 }
|
|
);
|
|
|
|
await apiService.getInstance().activiti.adminGroupsApi.addGroupMember(candidateGroup.id, candidate1.id);
|
|
await apiService.getInstance().activiti.adminGroupsApi.addGroupMember(candidateGroup.id, candidate2.id);
|
|
await apiService.getInstance().activiti.adminGroupsApi.addGroupMember(candidateGroup.id, user.id);
|
|
|
|
try {// for creates user if not available
|
|
await usersActions.createUser(new UserModel({
|
|
tenantId: user.tenantId,
|
|
firstName: app.candidate.firstName,
|
|
lastName: app.candidate.lastName
|
|
}));
|
|
} catch (e) {
|
|
}
|
|
|
|
await apiService.getInstance().login(user.email, user.password);
|
|
const appModel = await applicationsService.importPublishDeployApp(app.file_path, { renewIdmEntries: true });
|
|
|
|
await new ProcessUtil(apiService).startProcessByDefinitionName(appModel.name, app.processNames[1]);
|
|
});
|
|
|
|
afterAll(async () => {
|
|
await apiService.getInstance().login(browser.params.testConfig.admin.email, browser.params.testConfig.admin.password);
|
|
await apiService.getInstance().activiti.adminTenantsApi.deleteTenant(user.tenantId);
|
|
});
|
|
|
|
it('[C216430] Start Task - Claim and Requeue a task', async () => {
|
|
await loginPage.login(candidate1.email, candidate1.password);
|
|
await navigationBarPage.navigateToProcessServicesPage();
|
|
await processServicesPage.checkApsContainer();
|
|
await processServicesPage.goToApp('Task App');
|
|
await taskPage.tasksListPage().checkTaskListIsLoaded();
|
|
|
|
await taskPage.filtersPage().goToFilter(CONSTANTS.TASK_FILTERS.QUE_TASKS);
|
|
await taskPage.filtersPage().checkFilterIsHighlighted(CONSTANTS.TASK_FILTERS.QUE_TASKS);
|
|
await taskPage.tasksListPage().checkContentIsDisplayed(app.userTasks.candidateTask);
|
|
await taskPage.tasksListPage().selectRow(app.userTasks.candidateTask);
|
|
await taskPage.taskDetails().checkClaimEnabled();
|
|
|
|
await taskPage.filtersPage().goToFilter(CONSTANTS.TASK_FILTERS.INV_TASKS);
|
|
await taskPage.filtersPage().checkFilterIsHighlighted(CONSTANTS.TASK_FILTERS.INV_TASKS);
|
|
await taskPage.tasksListPage().checkTaskListIsLoaded();
|
|
await taskPage.tasksListPage().checkContentIsNotDisplayed(app.userTasks.candidateTask);
|
|
|
|
await taskPage.filtersPage().goToFilter(CONSTANTS.TASK_FILTERS.MY_TASKS);
|
|
await taskPage.filtersPage().checkFilterIsHighlighted(CONSTANTS.TASK_FILTERS.MY_TASKS);
|
|
await taskPage.tasksListPage().checkTaskListIsLoaded();
|
|
await taskPage.tasksListPage().checkContentIsNotDisplayed(app.userTasks.candidateTask);
|
|
|
|
await taskPage.filtersPage().goToFilter(CONSTANTS.TASK_FILTERS.QUE_TASKS);
|
|
await taskPage.filtersPage().checkFilterIsHighlighted(CONSTANTS.TASK_FILTERS.QUE_TASKS);
|
|
await taskPage.tasksListPage().checkTaskListIsLoaded();
|
|
await taskPage.tasksListPage().checkContentIsDisplayed(app.userTasks.candidateTask);
|
|
await taskPage.tasksListPage().selectRow(app.userTasks.candidateTask);
|
|
await taskPage.taskDetails().claimTask();
|
|
|
|
await taskPage.filtersPage().goToFilter(CONSTANTS.TASK_FILTERS.INV_TASKS);
|
|
await taskPage.filtersPage().checkFilterIsHighlighted(CONSTANTS.TASK_FILTERS.INV_TASKS);
|
|
await taskPage.tasksListPage().checkTaskListIsLoaded();
|
|
await taskPage.tasksListPage().checkContentIsDisplayed(app.userTasks.candidateTask);
|
|
await taskPage.taskDetails().checkReleaseEnabled();
|
|
|
|
await taskPage.filtersPage().goToFilter(CONSTANTS.TASK_FILTERS.MY_TASKS);
|
|
await taskPage.filtersPage().checkFilterIsHighlighted(CONSTANTS.TASK_FILTERS.MY_TASKS);
|
|
await taskPage.tasksListPage().checkTaskListIsLoaded();
|
|
await taskPage.tasksListPage().checkContentIsDisplayed(app.userTasks.candidateTask);
|
|
await taskPage.taskDetails().checkReleaseEnabled();
|
|
|
|
await taskPage.filtersPage().goToFilter(CONSTANTS.TASK_FILTERS.QUE_TASKS);
|
|
await taskPage.filtersPage().checkFilterIsHighlighted(CONSTANTS.TASK_FILTERS.QUE_TASKS);
|
|
await taskPage.tasksListPage().checkTaskListIsLoaded();
|
|
await taskPage.tasksListPage().checkContentIsNotDisplayed(app.userTasks.candidateTask);
|
|
|
|
await loginPage.login(candidate2.email, candidate2.password);
|
|
await navigationBarPage.navigateToProcessServicesPage();
|
|
await processServicesPage.checkApsContainer();
|
|
await processServicesPage.goToApp('Task App');
|
|
await taskPage.tasksListPage().checkTaskListIsLoaded();
|
|
|
|
await taskPage.filtersPage().goToFilter(CONSTANTS.TASK_FILTERS.QUE_TASKS);
|
|
await taskPage.filtersPage().checkFilterIsHighlighted(CONSTANTS.TASK_FILTERS.QUE_TASKS);
|
|
await taskPage.tasksListPage().checkTaskListIsLoaded();
|
|
await taskPage.tasksListPage().checkContentIsNotDisplayed(app.userTasks.candidateTask);
|
|
|
|
await loginPage.login(candidate1.email, candidate1.password);
|
|
await navigationBarPage.navigateToProcessServicesPage();
|
|
await processServicesPage.checkApsContainer();
|
|
await processServicesPage.goToApp('Task App');
|
|
await taskPage.tasksListPage().checkTaskListIsLoaded();
|
|
|
|
await taskPage.filtersPage().goToFilter(CONSTANTS.TASK_FILTERS.MY_TASKS);
|
|
await taskPage.filtersPage().checkFilterIsHighlighted(CONSTANTS.TASK_FILTERS.MY_TASKS);
|
|
await taskPage.tasksListPage().checkTaskListIsLoaded();
|
|
await taskPage.tasksListPage().checkContentIsDisplayed(app.userTasks.candidateTask);
|
|
await taskPage.tasksListPage().selectRow(app.userTasks.candidateTask);
|
|
await taskPage.taskDetails().releaseTask();
|
|
|
|
await taskPage.filtersPage().goToFilter(CONSTANTS.TASK_FILTERS.INV_TASKS);
|
|
await taskPage.filtersPage().checkFilterIsHighlighted(CONSTANTS.TASK_FILTERS.INV_TASKS);
|
|
await taskPage.tasksListPage().checkTaskListIsLoaded();
|
|
await taskPage.tasksListPage().checkContentIsNotDisplayed(app.userTasks.candidateTask);
|
|
|
|
await taskPage.filtersPage().goToFilter(CONSTANTS.TASK_FILTERS.MY_TASKS);
|
|
await taskPage.filtersPage().checkFilterIsHighlighted(CONSTANTS.TASK_FILTERS.MY_TASKS);
|
|
await taskPage.tasksListPage().checkTaskListIsLoaded();
|
|
await taskPage.tasksListPage().checkContentIsNotDisplayed(app.userTasks.candidateTask);
|
|
|
|
await taskPage.filtersPage().goToFilter(CONSTANTS.TASK_FILTERS.QUE_TASKS);
|
|
await taskPage.filtersPage().checkFilterIsHighlighted(CONSTANTS.TASK_FILTERS.QUE_TASKS);
|
|
await taskPage.tasksListPage().checkContentIsDisplayed(app.userTasks.candidateTask);
|
|
await taskPage.taskDetails().checkClaimEnabled();
|
|
|
|
await loginPage.login(candidate2.email, candidate2.password);
|
|
await navigationBarPage.navigateToProcessServicesPage();
|
|
await processServicesPage.checkApsContainer();
|
|
await processServicesPage.goToApp('Task App');
|
|
await taskPage.tasksListPage().checkTaskListIsLoaded();
|
|
|
|
await taskPage.filtersPage().goToFilter(CONSTANTS.TASK_FILTERS.QUE_TASKS);
|
|
await taskPage.filtersPage().checkFilterIsHighlighted(CONSTANTS.TASK_FILTERS.QUE_TASKS);
|
|
await taskPage.tasksListPage().checkTaskListIsLoaded();
|
|
await taskPage.tasksListPage().checkContentIsDisplayed(app.userTasks.candidateTask);
|
|
await taskPage.taskDetails().checkClaimEnabled();
|
|
});
|
|
});
|
|
});
|