From c12eee1f59ddaa66fbe603ba4dd9323acd6c6439 Mon Sep 17 00:00:00 2001 From: dhrn <14145706+dhrn@users.noreply.github.com> Date: Wed, 19 Feb 2020 16:13:43 +0530 Subject: [PATCH] [ADF-5078] Start Task e2e (#5485) * [ADF-5078] Start Task e2e * * improved test * * fixed import --- e2e/actions/APS/apps.actions.ts | 8 +- e2e/models/APS/user.ts | 2 +- .../adf/process-services/startProcessPage.ts | 6 + e2e/pages/adf/process-services/tasksPage.ts | 2 +- e2e/process-services/task-assignee.e2e.ts | 108 +++++++++++ .../task-attachmentList-actionMenu.e2e.ts | 12 +- e2e/process-services/task-audit.e2e.ts | 21 +-- e2e/process-services/task-details-form.e2e.ts | 17 +- .../task-details-no-form.e2e.ts | 15 +- e2e/process-services/task-details.e2e.ts | 28 +-- .../task-filters-component.e2e.ts | 109 ++++------- .../task-filters-sorting.e2e.ts | 171 +++++++----------- .../task-list-pagination.e2e.ts | 17 +- e2e/resources/apps/Test Assignee.zip | Bin 0 -> 5886 bytes e2e/util/constants.js | 6 + e2e/util/resources.js | 8 + .../pagination/pagination.component.spec.ts | 14 ++ 17 files changed, 289 insertions(+), 255 deletions(-) create mode 100644 e2e/process-services/task-assignee.e2e.ts create mode 100644 e2e/resources/apps/Test Assignee.zip diff --git a/e2e/actions/APS/apps.actions.ts b/e2e/actions/APS/apps.actions.ts index cfff1272d9..a8edf70ca6 100644 --- a/e2e/actions/APS/apps.actions.ts +++ b/e2e/actions/APS/apps.actions.ts @@ -49,8 +49,8 @@ export class AppsActions { return appDefinitionId; } - async importPublishDeployApp(alfrescoJsApi, appFileLocation) { - const appCreated = await this.importApp(alfrescoJsApi, appFileLocation); + async importPublishDeployApp(alfrescoJsApi, appFileLocation, option = {}) { + const appCreated = await this.importApp(alfrescoJsApi, appFileLocation, option); const publishApp = await alfrescoJsApi.activiti.appsApi.publishAppDefinition(appCreated.id, new AppPublish()); @@ -59,13 +59,13 @@ export class AppsActions { return appCreated; } - async importApp(alfrescoJsApi, appFileLocation) { + async importApp(alfrescoJsApi, appFileLocation, options = {}) { browser.setFileDetector(new remote.FileDetector()); const pathFile = path.join(browser.params.testConfig.main.rootPath + appFileLocation); const file = fs.createReadStream(pathFile); - return alfrescoJsApi.activiti.appsApi.importAppDefinition(file); + return alfrescoJsApi.activiti.appsDefinitionApi.importAppDefinition(file, options); } async publishDeployApp(alfrescoJsApi, appId) { diff --git a/e2e/models/APS/user.ts b/e2e/models/APS/user.ts index 00dde1aebc..1d0d322db2 100644 --- a/e2e/models/APS/user.ts +++ b/e2e/models/APS/user.ts @@ -30,7 +30,7 @@ export class User { lastName = StringUtil.generateRandomString(); password = StringUtil.generatePasswordString(); type = 'enterprise'; - tenantId = '1'; + tenantId = 1; company = null; constructor(details?: any) { diff --git a/e2e/pages/adf/process-services/startProcessPage.ts b/e2e/pages/adf/process-services/startProcessPage.ts index 072bf2b035..203906b2de 100644 --- a/e2e/pages/adf/process-services/startProcessPage.ts +++ b/e2e/pages/adf/process-services/startProcessPage.ts @@ -138,4 +138,10 @@ export class StartProcessPage { formFields(): FormFields { return new FormFields(); } + + async startProcess({name, processName }) { + await this.enterProcessName(name); + await this.selectFromProcessDropdown(processName); + await this.clickStartProcessButton(); + } } diff --git a/e2e/pages/adf/process-services/tasksPage.ts b/e2e/pages/adf/process-services/tasksPage.ts index 02d3d122cf..09db2dcfa7 100644 --- a/e2e/pages/adf/process-services/tasksPage.ts +++ b/e2e/pages/adf/process-services/tasksPage.ts @@ -45,7 +45,7 @@ export class TasksPage { return new StartTaskDialog(); } - async createTask({ name, description, dueDate, formName }): Promise { + async createTask({ name, description = '', dueDate = '', formName = 'None'}): Promise { await this.clickOnCreateButton(); await BrowserActions.clickExecuteScript('button[data-automation-id="btn-start-task"]'); const dialog = new StartTaskDialog(); diff --git a/e2e/process-services/task-assignee.e2e.ts b/e2e/process-services/task-assignee.e2e.ts new file mode 100644 index 0000000000..62300eb135 --- /dev/null +++ b/e2e/process-services/task-assignee.e2e.ts @@ -0,0 +1,108 @@ +/*! + * @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 { LoginPage } from '@alfresco/adf-testing'; +import { NavigationBarPage } from '../pages/adf/navigationBarPage'; +import { ProcessServicesPage } from '../pages/adf/process-services/processServicesPage'; +import { StartProcessPage } from '../pages/adf/process-services/startProcessPage'; +import { ProcessFiltersPage } from '../pages/adf/process-services/processFiltersPage'; +import { ProcessServiceTabBarPage } from '../pages/adf/process-services/processServiceTabBarPage'; +import { ProcessDetailsPage } from '../pages/adf/process-services/processDetailsPage'; +import { ProcessListPage } from '../pages/adf/process-services/processListPage'; +import { AlfrescoApiCompatibility as AlfrescoApi } from '@alfresco/js-api'; +import { AppsActions } from '../actions/APS/apps.actions'; +import { UsersActions } from '../actions/users.actions'; +import { browser } from 'protractor'; +import { User } from '../models/APS/user'; +import { TasksPage } from '../pages/adf/process-services/tasksPage'; +import CONSTANTS = require('../util/constants'); + +describe('Task Assignee', () => { + + const loginPage = new LoginPage(); + const processListPage = new ProcessListPage(); + const navigationBarPage = new NavigationBarPage(); + const processServicesPage = new ProcessServicesPage(); + const startProcessPage = new StartProcessPage(); + const processFiltersPage = new ProcessFiltersPage(); + const processServiceTabBarPage = new ProcessServiceTabBarPage(); + const processDetailsPage = new ProcessDetailsPage(); + const taskPage = new TasksPage(); + const app = browser.params.resources.Files.TEST_ASSIGNEE; + + let user: User; + + beforeAll(async () => { + const apps = new AppsActions(); + const users = new UsersActions(); + this.alfrescoJsApi = new AlfrescoApi({ + provider: 'BPM', + hostBpm: browser.params.testConfig.adf_aps.host + }); + + await this.alfrescoJsApi.login(browser.params.testConfig.adf.adminEmail, browser.params.testConfig.adf.adminPassword); + user = await users.createTenantAndUser(this.alfrescoJsApi); + + await this.alfrescoJsApi.login(user.email, user.password); + await apps.importPublishDeployApp(this.alfrescoJsApi, app.file_location, { renewIdmEntries: true }); + await loginPage.loginToProcessServicesUsingUserModel(user); + }); + + afterAll( async () => { + await this.alfrescoJsApi.login(browser.params.testConfig.adf.adminEmail, browser.params.testConfig.adf.adminPassword); + await this.alfrescoJsApi.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 () => { + await processServicesPage.goToApp(app.title); + await processServiceTabBarPage.clickProcessButton(); + await processListPage.checkProcessListIsDisplayed(); + await processFiltersPage.clickCreateProcessButton(); + await processFiltersPage.clickNewProcessDropdown(); + + await startProcessPage.startProcess({name: 'sample-process-one', processName: app.processName }); + await processFiltersPage.selectFromProcessList('sample-process-one'); + await processDetailsPage.clickOnActiveTask(); + + await taskPage.tasksListPage().checkContentIsDisplayed(app.userTasks.one); + await taskPage.tasksListPage().selectRow(app.userTasks.one); + await taskPage.taskDetails().clickCompleteFormTask(); + await taskPage.tasksListPage().checkContentIsNotDisplayed(app.userTasks.one); + + await taskPage.filtersPage().goToFilter(CONSTANTS.TASK_FILTERS.MY_TASKS); + await taskPage.tasksListPage().checkContentIsNotDisplayed(app.userTasks.one); + + await taskPage.filtersPage().goToFilter(CONSTANTS.TASK_FILTERS.COMPLETED_TASKS); + await taskPage.tasksListPage().checkContentIsNotDisplayed(app.userTasks.one); + + await taskPage.filtersPage().goToFilter(CONSTANTS.TASK_FILTERS.MY_TASKS); + await taskPage.taskDetails().clickCompleteFormTask(); + await taskPage.tasksListPage().checkContentIsNotDisplayed(app.userTasks.two); + + await taskPage.filtersPage().goToFilter(CONSTANTS.TASK_FILTERS.COMPLETED_TASKS); + await taskPage.tasksListPage().checkContentIsDisplayed(app.userTasks.two); + + await processServiceTabBarPage.clickProcessButton(); + await processListPage.checkProcessListIsDisplayed(); + }); + +}); diff --git a/e2e/process-services/task-attachmentList-actionMenu.e2e.ts b/e2e/process-services/task-attachmentList-actionMenu.e2e.ts index 18ed2705b1..48ca3ff51d 100644 --- a/e2e/process-services/task-attachmentList-actionMenu.e2e.ts +++ b/e2e/process-services/task-attachmentList-actionMenu.e2e.ts @@ -59,18 +59,14 @@ describe('Attachment list action menu for tasks', () => { }); await this.alfrescoJsApi.login(browser.params.testConfig.adf.adminEmail, browser.params.testConfig.adf.adminPassword); - const user = await users.createTenantAndUser(this.alfrescoJsApi); - tenantId = user.tenantId; await this.alfrescoJsApi.login(user.email, user.password); - - const importedApp = await apps.importPublishDeployApp(this.alfrescoJsApi, app.file_location); - appId = importedApp.id; + const { id } = await apps.importPublishDeployApp(this.alfrescoJsApi, app.file_location); + appId = id; await loginPage.loginToProcessServicesUsingUserModel(user); - }); afterAll(async () => { @@ -84,9 +80,7 @@ describe('Attachment list action menu for tasks', () => { await (await (await navigationBarPage.navigateToProcessServicesPage()).goToApp(app.title)).clickTasksButton(); await taskPage.filtersPage().goToFilter(CONSTANTS.TASK_FILTERS.MY_TASKS); - const task = await taskPage.createNewTask(); - await task.addName(taskName.active); - await task.clickStartButton(); + await taskPage.createTask({name: taskName.active}); await attachmentListPage.clickAttachFileButton(pngFile.location); await attachmentListPage.viewFile(pngFile.name); diff --git a/e2e/process-services/task-audit.e2e.ts b/e2e/process-services/task-audit.e2e.ts index 6570df6a9a..129fe60157 100644 --- a/e2e/process-services/task-audit.e2e.ts +++ b/e2e/process-services/task-audit.e2e.ts @@ -47,24 +47,23 @@ describe('Task Audit', () => { }); await this.alfrescoJsApi.login(browser.params.testConfig.adf.adminEmail, browser.params.testConfig.adf.adminPassword); - - const newTenant = await this.alfrescoJsApi.activiti.adminTenantsApi.createTenant(new Tenant()); - - processUserModel = await users.createApsUser(this.alfrescoJsApi, newTenant.id); + const { id } = await this.alfrescoJsApi.activiti.adminTenantsApi.createTenant(new Tenant()); + processUserModel = await users.createApsUser(this.alfrescoJsApi, id); await this.alfrescoJsApi.login(processUserModel.email, processUserModel.password); - this.alfrescoJsApi.activiti.taskApi.createNewTask({ name: taskTaskApp }); - await apps.importPublishDeployApp(this.alfrescoJsApi, app.file_location); await loginPage.loginToProcessServicesUsingUserModel(processUserModel); + }); + afterAll( async () => { + await this.alfrescoJsApi.login(browser.params.testConfig.adf.adminEmail, browser.params.testConfig.adf.adminPassword); + await this.alfrescoJsApi.activiti.adminTenantsApi.deleteTenant(processUserModel.tenantId); }); beforeEach(async () => { await BrowserActions.getUrl(browser.params.testConfig.adf.url + '/activiti'); - }); it('[C260386] Should Audit file be downloaded when clicking on Task Audit log icon on a standalone running task', async () => { @@ -95,9 +94,7 @@ describe('Task Audit', () => { it('[C263944] Should Audit file be downloaded when clicking on Task Audit log icon on a custom app standalone completed task', async () => { await (await processServices.goToTaskApp()).clickTasksButton(); - const task = await taskPage.createNewTask(); - await task.addName(taskCompleteCustomApp); - await task.clickStartButton(); + await taskPage.createTask({name: taskCompleteCustomApp}); await taskPage.filtersPage().goToFilter(CONSTANTS.TASK_FILTERS.MY_TASKS); await taskPage.tasksListPage().checkContentIsDisplayed(taskCompleteCustomApp); @@ -114,9 +111,7 @@ describe('Task Audit', () => { it('[C263943] Should Audit file be downloaded when clicking on Task Audit log icon on a custom app standalone running task', async () => { await (await processServices.goToTaskApp()).clickTasksButton(); - const task = await taskPage.createNewTask(); - await task.addName(taskCustomApp); - await task.clickStartButton(); + await taskPage.createTask({name: taskCustomApp}); await taskPage.filtersPage().goToFilter(CONSTANTS.TASK_FILTERS.MY_TASKS); await taskPage.tasksListPage().checkContentIsDisplayed(taskCustomApp); diff --git a/e2e/process-services/task-details-form.e2e.ts b/e2e/process-services/task-details-form.e2e.ts index 24965b5f91..4fd8df7a79 100644 --- a/e2e/process-services/task-details-form.e2e.ts +++ b/e2e/process-services/task-details-form.e2e.ts @@ -65,41 +65,36 @@ describe('Task Details - Form', () => { }); await this.alfrescoJsApi.login(browser.params.testConfig.adf.adminEmail, browser.params.testConfig.adf.adminPassword); - user = await users.createTenantAndUser(this.alfrescoJsApi); - await this.alfrescoJsApi.login(user.email, user.password); attachedForm = await this.alfrescoJsApi.activiti.modelsApi.createModel(attachedFormModel); - newForm = await this.alfrescoJsApi.activiti.modelsApi.createModel(newFormModel); const otherEmptyTask = await this.alfrescoJsApi.activiti.taskApi.createNewTask(otherTaskModel); - otherAttachedForm = await this.alfrescoJsApi.activiti.modelsApi.createModel(otherAttachedFormModel); await this.alfrescoJsApi.activiti.taskApi.attachForm(otherEmptyTask.id, { 'formId': otherAttachedForm.id }); - otherTask = await this.alfrescoJsApi.activiti.taskApi.getTask(otherEmptyTask.id); await loginPage.loginToProcessServicesUsingUserModel(user); }); + afterAll( async () => { + await this.alfrescoJsApi.login(browser.params.testConfig.adf.adminEmail, browser.params.testConfig.adf.adminPassword); + await this.alfrescoJsApi.activiti.adminTenantsApi.deleteTenant(user.tenantId); + }); + beforeEach(async () => { - const taskModel = new StandaloneTask(); - - const emptyTask = await this.alfrescoJsApi.activiti.taskApi.createNewTask(taskModel); - + const emptyTask = await this.alfrescoJsApi.activiti.taskApi.createNewTask(new StandaloneTask()); await this.alfrescoJsApi.activiti.taskApi.attachForm(emptyTask.id, { 'formId': attachedForm.id }); - task = await this.alfrescoJsApi.activiti.taskApi.getTask(emptyTask.id); await (await new NavigationBarPage().navigateToProcessServicesPage()).goToTaskApp(); await tasksListPage.checkTaskListIsLoaded(); await filtersPage.goToFilter('Involved Tasks'); await tasksListPage.checkTaskListIsLoaded(); - }); it('[C280018] Should be able to change the form in a task', async () => { diff --git a/e2e/process-services/task-details-no-form.e2e.ts b/e2e/process-services/task-details-no-form.e2e.ts index 969f0f5a3e..9a35c8d341 100644 --- a/e2e/process-services/task-details-no-form.e2e.ts +++ b/e2e/process-services/task-details-no-form.e2e.ts @@ -38,28 +38,27 @@ describe('Task Details - No form', () => { beforeAll(async () => { const users = new UsersActions(); - this.alfrescoJsApi = new AlfrescoApi({ provider: 'BPM', hostBpm: browser.params.testConfig.adf_aps.host }); await this.alfrescoJsApi.login(browser.params.testConfig.adf.adminEmail, browser.params.testConfig.adf.adminPassword); - - const newTenant = await this.alfrescoJsApi.activiti.adminTenantsApi.createTenant(new Tenant()); - - processUserModel = await users.createApsUser(this.alfrescoJsApi, newTenant.id); + const { id } = await this.alfrescoJsApi.activiti.adminTenantsApi.createTenant(new Tenant()); + processUserModel = await users.createApsUser(this.alfrescoJsApi, id); await this.alfrescoJsApi.login(processUserModel.email, processUserModel.password); - importedApp = await apps.importPublishDeployApp(this.alfrescoJsApi, app.file_location); - await apps.startProcess(this.alfrescoJsApi, importedApp); - await loginPage.loginToProcessServicesUsingUserModel(processUserModel); }); + afterAll( async () => { + await this.alfrescoJsApi.login(browser.params.testConfig.adf.adminEmail, browser.params.testConfig.adf.adminPassword); + await this.alfrescoJsApi.activiti.adminTenantsApi.deleteTenant(processUserModel.tenantId); + }); + it('[C289311] Should attach form and complete buttons to be displayed when no form is attached', async () => { await (await (await navigationBarPage.navigateToProcessServicesPage()).goToTaskApp()).clickTasksButton(); await taskPage.filtersPage().goToFilter(CONSTANTS.TASK_FILTERS.MY_TASKS); diff --git a/e2e/process-services/task-details.e2e.ts b/e2e/process-services/task-details.e2e.ts index a17a8c00cb..2f6837eeb3 100644 --- a/e2e/process-services/task-details.e2e.ts +++ b/e2e/process-services/task-details.e2e.ts @@ -59,17 +59,17 @@ describe('Task Details component', () => { }); await this.alfrescoJsApi.login(browser.params.testConfig.adf.adminEmail, browser.params.testConfig.adf.adminPassword); - - const newTenant = await this.alfrescoJsApi.activiti.adminTenantsApi.createTenant(new Tenant()); - - processUserModel = await users.createApsUser(this.alfrescoJsApi, newTenant.id); + const { id } = await this.alfrescoJsApi.activiti.adminTenantsApi.createTenant(new Tenant()); + processUserModel = await users.createApsUser(this.alfrescoJsApi, id); await this.alfrescoJsApi.login(processUserModel.email, processUserModel.password); - appModel = await apps.importPublishDeployApp(this.alfrescoJsApi, app.file_location); - await loginPage.loginToProcessServicesUsingUserModel(processUserModel); + }); + afterAll( async () => { + await this.alfrescoJsApi.login(browser.params.testConfig.adf.adminEmail, browser.params.testConfig.adf.adminPassword); + await this.alfrescoJsApi.activiti.adminTenantsApi.deleteTenant(processUserModel.tenantId); }); beforeEach(async () => { @@ -80,12 +80,8 @@ describe('Task Details component', () => { await (await processServices.goToTaskApp()).clickTasksButton(); await taskPage.filtersPage().goToFilter(CONSTANTS.TASK_FILTERS.MY_TASKS); - const task = await taskPage.createNewTask(); - await task.addName(tasks[1]); - await task.addDescription('Description'); - await task.addForm(app.formName); - await task.clickStartButton(); + await taskPage.createTask({name: tasks[1], description: 'Description', formName: app.formName}); await expect(await taskPage.taskDetails().getTitle()).toEqual('Activities'); const allTasks = await this.alfrescoJsApi.activiti.taskApi.listTasks(new Task({ sort: 'created-desc' })); @@ -114,12 +110,7 @@ describe('Task Details component', () => { await (await processServices.goToTaskApp()).clickTasksButton(); await taskPage.filtersPage().goToFilter(CONSTANTS.TASK_FILTERS.MY_TASKS); - const task = await taskPage.createNewTask(); - await task.addName(tasks[1]); - await task.addDescription('Description'); - await task.addForm(app.formName); - await task.clickStartButton(); - + await taskPage.createTask({name: tasks[1], description: 'Description', formName: app.formName}); await expect(await taskPage.taskDetails().getTitle()).toEqual('Activities'); const allTasks = await this.alfrescoJsApi.activiti.taskApi.listTasks(new Task({ sort: 'created-desc' })); @@ -185,13 +176,11 @@ describe('Task Details component', () => { await apps.startProcess(this.alfrescoJsApi, appModel); await (await processServices.goToTaskApp()).clickTasksButton(); - await taskPage.filtersPage().goToFilter(CONSTANTS.TASK_FILTERS.MY_TASKS); await expect(await taskPage.taskDetails().getTitle()).toEqual('Activities'); const allTasks = await this.alfrescoJsApi.activiti.taskApi.listTasks(new Task({ sort: 'created-desc' })); - const taskModel = new TaskModel(allTasks.data[0]); await taskPage.tasksListPage().checkContentIsDisplayed(taskModel.getName()); @@ -292,7 +281,6 @@ describe('Task Details component', () => { it('[C286709] Should display task details for completed task - Task App', async () => { const taskName = 'TaskAppCompleted'; const taskId = await this.alfrescoJsApi.activiti.taskApi.createNewTask({ 'name': taskName }); - await (await processServices.goToTaskApp()).clickTasksButton(); await taskPage.filtersPage().goToFilter(CONSTANTS.TASK_FILTERS.MY_TASKS); diff --git a/e2e/process-services/task-filters-component.e2e.ts b/e2e/process-services/task-filters-component.e2e.ts index 295ba4ae89..b6fe348c44 100644 --- a/e2e/process-services/task-filters-component.e2e.ts +++ b/e2e/process-services/task-filters-component.e2e.ts @@ -28,6 +28,7 @@ import { AlfrescoApiCompatibility as AlfrescoApi, UserProcessInstanceFilterRepre import { AppsActions } from '../actions/APS/apps.actions'; import { UsersActions } from '../actions/users.actions'; import { browser } from 'protractor'; +import { User } from '../models/APS/user'; describe('Task', () => { @@ -42,15 +43,13 @@ describe('Task', () => { const taskFiltersDemoPage = new TaskFiltersDemoPage(); const app = browser.params.resources.Files.APP_WITH_DATE_FIELD_FORM; - let appId, tenantId; + let appId: number, user: User; beforeAll(async () => { - this.alfrescoJsApi = new AlfrescoApi({ provider: 'BPM', hostBpm: browser.params.testConfig.adf_aps.host }); - }); beforeEach(async () => { @@ -59,34 +58,23 @@ describe('Task', () => { const users = new UsersActions(); await this.alfrescoJsApi.login(browser.params.testConfig.adf.adminEmail, browser.params.testConfig.adf.adminPassword); - - const user = await users.createTenantAndUser(this.alfrescoJsApi); - - tenantId = user.tenantId; + user = await users.createTenantAndUser(this.alfrescoJsApi); await this.alfrescoJsApi.login(user.email, user.password); - - const appModel = await apps.importPublishDeployApp(this.alfrescoJsApi, app.file_location); - - appId = appModel.id; + const { id } = await apps.importPublishDeployApp(this.alfrescoJsApi, app.file_location); + appId = id; await loginPage.loginToProcessServicesUsingUserModel(user); - await navigationBarPage.navigateToProcessServicesPage(); - await processServicesPage.checkApsContainer(); await processServicesPage.goToApp(app.title); }); afterEach(async () => { - await this.alfrescoJsApi.activiti.modelsApi.deleteModel(appId); - await this.alfrescoJsApi.login(browser.params.testConfig.adf.adminEmail, browser.params.testConfig.adf.adminPassword); - - await this.alfrescoJsApi.activiti.adminTenantsApi.deleteTenant(tenantId); - + await this.alfrescoJsApi.activiti.adminTenantsApi.deleteTenant(user.tenantId); }); it('[C279967] Should display default filters when an app is deployed', async () => { @@ -97,9 +85,7 @@ describe('Task', () => { }); it('[C260330] Should display Task Filter List when app is in Task Tab', async () => { - const task = await tasksPage.createNewTask(); - await task.addName('Test'); - await task.clickStartButton(); + await tasksPage.createTask({name: 'Test'}); await taskFiltersDemoPage.myTasksFilter().clickTaskFilter(); await tasksListPage.checkContentIsDisplayed('Test'); await expect(await taskFiltersDemoPage.checkActiveFilterActive()).toBe('My Tasks'); @@ -157,25 +143,14 @@ describe('Task', () => { }); it('[C260349] Should sort task by name when Name sorting is clicked', async () => { - const task = await tasksPage.createNewTask(); - await task.addName('Test1'); - await task.clickStartButton(); - + await tasksPage.createTask({name: 'Test1'}); await taskDetailsPage.clickCompleteTask(); - const task2 = await tasksPage.createNewTask(); - await task2.addName('Test2'); - await task2.clickStartButton(); - + await tasksPage.createTask({name: 'Test2'}); await taskDetailsPage.clickCompleteTask(); - const task3 = await tasksPage.createNewTask(); - await task3.addName('Test3'); - await task3.clickStartButton(); - - const task4 = await tasksPage.createNewTask(); - await task4.addName('Test4'); - await task4.clickStartButton(); + await tasksPage.createTask({name: 'Test3'}); + await tasksPage.createTask({name: 'Test4'}); await tasksListPage.checkContentIsDisplayed('Test4'); await tasksListPage.checkRowIsSelected('Test4'); @@ -201,9 +176,7 @@ describe('Task', () => { }); it('[C277264] Should display task filter results when task filter is selected', async () => { - const task = await tasksPage.createNewTask(); - await task.addName('Test'); - await task.clickStartButton(); + await tasksPage.createTask({name: 'Test'}); await taskFiltersDemoPage.myTasksFilter().clickTaskFilter(); await tasksListPage.checkContentIsDisplayed('Test'); @@ -221,10 +194,7 @@ describe('Task', () => { const taskFiltersDemoPage = new TaskFiltersDemoPage(); let user; - let appId; - let importedApp; - - let taskFilterId; + let appId: number; const app = browser.params.resources.Files.APP_WITH_PROCESSES; @@ -238,21 +208,19 @@ describe('Task', () => { }); await this.alfrescoJsApi.login(browser.params.testConfig.adf.adminEmail, browser.params.testConfig.adf.adminPassword); - user = await users.createTenantAndUser(this.alfrescoJsApi); await this.alfrescoJsApi.login(user.email, user.password); - - importedApp = await apps.importPublishDeployApp(this.alfrescoJsApi, app.file_location); - + const importedApp = await apps.importPublishDeployApp(this.alfrescoJsApi, app.file_location); const appDefinitions = await this.alfrescoJsApi.activiti.appsApi.getAppDefinitions(); - - appId = appDefinitions.data.find((currentApp) => { - return currentApp.modelId === importedApp.id; - }).id; + appId = appDefinitions.data.find((currentApp) => currentApp.modelId === importedApp.id).id; await loginPage.loginToProcessServicesUsingUserModel(user); + }); + afterAll( async () => { + await this.alfrescoJsApi.login(browser.params.testConfig.adf.adminEmail, browser.params.testConfig.adf.adminPassword); + await this.alfrescoJsApi.activiti.adminTenantsApi.deleteTenant(user.tenantId); }); beforeEach(async () => { @@ -262,33 +230,27 @@ describe('Task', () => { }); it('[C260350] Should display a new filter when a filter is added', async () => { - const newFilter: any = new UserProcessInstanceFilterRepresentation(); - newFilter.name = 'New Task Filter'; - newFilter.appId = appId; - newFilter.icon = 'glyphicon-filter'; - newFilter.filter = { sort: 'created-desc', state: 'completed', assignment: 'involved' }; - - const result = await this.alfrescoJsApi.activiti.userFiltersApi.createUserTaskFilter(newFilter); - - taskFilterId = result.id; + const newFilter = new UserProcessInstanceFilterRepresentation({ + name: 'New Task Filter', + appId, + icon: 'glyphicon-filter', + filter: { sort: 'created-desc', state: 'completed', assignment: 'involved' } + }); + const { id } = await this.alfrescoJsApi.activiti.userFiltersApi.createUserTaskFilter(newFilter); await browser.refresh(); - await taskFiltersDemoPage.customTaskFilter('New Task Filter').checkTaskFilterIsDisplayed(); - - await this.alfrescoJsApi.activiti.userFiltersApi.deleteUserTaskFilter(taskFilterId); + await this.alfrescoJsApi.activiti.userFiltersApi.deleteUserTaskFilter(id); }); it('[C286447] Should display the task filter icon when a custom filter is added', async () => { - const newFilter: any = new UserProcessInstanceFilterRepresentation(); - newFilter.name = 'New Task Filter with icon'; - newFilter.appId = appId; - newFilter.icon = 'glyphicon-cloud'; - newFilter.filter = { sort: 'created-desc', state: 'completed', assignment: 'involved' }; - - const result = await this.alfrescoJsApi.activiti.userFiltersApi.createUserTaskFilter(newFilter); - - taskFilterId = result.id; + const newFilter = new UserProcessInstanceFilterRepresentation({ + name : 'New Task Filter with icon', + appId, + icon: 'glyphicon-cloud', + filter: { sort: 'created-desc', state: 'completed', assignment: 'involved' } + }); + const { id } = await this.alfrescoJsApi.activiti.userFiltersApi.createUserTaskFilter(newFilter); await browser.refresh(); await processServiceTabBarPage.clickSettingsButton(); @@ -298,8 +260,7 @@ describe('Task', () => { await taskFiltersDemoPage.customTaskFilter('New Task Filter with icon').checkTaskFilterIsDisplayed(); await expect(await taskFiltersDemoPage.customTaskFilter('New Task Filter with icon').getTaskFilterIcon()).toEqual('cloud'); - - await this.alfrescoJsApi.activiti.userFiltersApi.deleteUserTaskFilter(taskFilterId); + await this.alfrescoJsApi.activiti.userFiltersApi.deleteUserTaskFilter(id); }); it('[C286449] Should display task filter icons only when showIcon property is set on true', async () => { diff --git a/e2e/process-services/task-filters-sorting.e2e.ts b/e2e/process-services/task-filters-sorting.e2e.ts index 96427c8a25..172beba542 100644 --- a/e2e/process-services/task-filters-sorting.e2e.ts +++ b/e2e/process-services/task-filters-sorting.e2e.ts @@ -39,7 +39,6 @@ describe('Task Filters Sorting', () => { let user; let appId; - let importedApp; const app = browser.params.resources.Files.APP_WITH_PROCESSES; @@ -61,74 +60,48 @@ describe('Task Filters Sorting', () => { }); await this.alfrescoJsApi.login(browser.params.testConfig.adf.adminEmail, browser.params.testConfig.adf.adminPassword); - user = await users.createTenantAndUser(this.alfrescoJsApi); await this.alfrescoJsApi.login(user.email, user.password); - - importedApp = await apps.importPublishDeployApp(this.alfrescoJsApi, app.file_location); - + const importedApp = await apps.importPublishDeployApp(this.alfrescoJsApi, app.file_location); const appDefinitions = await this.alfrescoJsApi.activiti.appsApi.getAppDefinitions(); - - appId = appDefinitions.data.find((currentApp) => { - return currentApp.modelId === importedApp.id; - }).id; + appId = appDefinitions.data.find((currentApp) => currentApp.modelId === importedApp.id).id; await loginPage.loginToProcessServicesUsingUserModel(user); - await navigationBarPage.navigateToProcessServicesPage(); await processServicesPage.checkApsContainer(); await processServicesPage.goToApp(app.title); - const task = await tasksPage.createNewTask(); - await task.addName(tasks[0].name); - await task.addDueDate(tasks[0].dueDate); - await task.clickStartButton(); - + await tasksPage.createTask({name: tasks[0].name, dueDate: tasks[0].dueDate}); await taskDetailsPage.clickCompleteTask(); - const task2 = await tasksPage.createNewTask(); - - await task2.addName(tasks[1].name); - await task2.addDueDate(tasks[1].dueDate); - await task2.clickStartButton(); + await tasksPage.createTask({name: tasks[1].name, dueDate: tasks[1].dueDate}); await taskDetailsPage.clickCompleteTask(); - const task3 = await tasksPage.createNewTask(); - await task3.addName(tasks[2].name); - await task3.addDueDate(tasks[2].dueDate); - await task3.clickStartButton(); + await tasksPage.createTask({name: tasks[2].name, dueDate: tasks[2].dueDate}); await taskDetailsPage.clickCompleteTask(); - const task4 = await tasksPage.createNewTask(); - await task4.addName(tasks[3].name); - await task4.addDueDate(tasks[3].dueDate); - await task4.clickStartButton(); - - const task5 = await tasksPage.createNewTask(); - await task5.addName(tasks[4].name); - await task5.addDueDate(tasks[4].dueDate); - await task5.clickStartButton(); - - const task6 = await tasksPage.createNewTask(); - await task6.addName(tasks[5].name); - await task6.addDueDate(tasks[5].dueDate); - await task6.clickStartButton(); + await tasksPage.createTask({name: tasks[3].name, dueDate: tasks[3].dueDate}); + await tasksPage.createTask({name: tasks[4].name, dueDate: tasks[4].dueDate}); + await tasksPage.createTask({name: tasks[5].name, dueDate: tasks[5].dueDate}); + }); + afterAll( async () => { + await this.alfrescoJsApi.login(browser.params.testConfig.adf.adminEmail, browser.params.testConfig.adf.adminPassword); + await this.alfrescoJsApi.activiti.adminTenantsApi.deleteTenant(user.tenantId); }); it('[C277254] Should display tasks under new filter from newest to oldest when they are completed', async () => { - const newFilter: any = new UserProcessInstanceFilterRepresentation(); - newFilter.name = 'Newest first'; - newFilter.appId = appId; - newFilter.icon = 'glyphicon-filter'; - newFilter.filter = { sort: 'created-desc', state: 'completed', assignment: 'involved' }; - + const newFilter = new UserProcessInstanceFilterRepresentation({ + appId, + name : 'Newest first', + icon: 'glyphicon-filter', + filter: { sort: 'created-desc', state: 'completed', assignment: 'involved' } + }); await this.alfrescoJsApi.activiti.userFiltersApi.createUserTaskFilter(newFilter); await browser.refresh(); - - await taskFiltersDemoPage.customTaskFilter('Newest first').clickTaskFilter(); + await taskFiltersDemoPage.customTaskFilter(newFilter.name).clickTaskFilter(); await expect(await tasksListPage.getDataTable().contentInPosition(1)).toBe(tasks[2].name); await expect(await tasksListPage.getDataTable().contentInPosition(2)).toBe(tasks[1].name); @@ -137,17 +110,16 @@ describe('Task Filters Sorting', () => { }); it('[C277255] Should display tasks under new filter from oldest to newest when they are completed', async () => { - const newFilter: any = new UserProcessInstanceFilterRepresentation(); - newFilter.name = 'Newest last'; - newFilter.appId = appId; - newFilter.icon = 'glyphicon-filter'; - newFilter.filter = { sort: 'created-asc', state: 'completed', assignment: 'involved' }; - + const newFilter = new UserProcessInstanceFilterRepresentation({ + appId, + name : 'Newest last', + icon: 'glyphicon-filter', + filter: { sort: 'created-asc', state: 'completed', assignment: 'involved' } + }); await this.alfrescoJsApi.activiti.userFiltersApi.createUserTaskFilter(newFilter); await browser.refresh(); - - await taskFiltersDemoPage.customTaskFilter('Newest last').clickTaskFilter(); + await taskFiltersDemoPage.customTaskFilter(newFilter.name).clickTaskFilter(); await expect(await tasksListPage.getDataTable().contentInPosition(1)).toBe(tasks[0].name); await expect(await tasksListPage.getDataTable().contentInPosition(2)).toBe(tasks[1].name); @@ -155,17 +127,16 @@ describe('Task Filters Sorting', () => { }); it('[C277256] Should display tasks under new filter from closest due date to farthest when they are completed', async () => { - const newFilter: any = new UserProcessInstanceFilterRepresentation(); - newFilter.name = 'Due first'; - newFilter.appId = appId; - newFilter.icon = 'glyphicon-filter'; - newFilter.filter = { sort: 'due-desc', state: 'completed', assignment: 'involved' }; - + const newFilter = new UserProcessInstanceFilterRepresentation({ + appId, + name : 'Due first', + icon: 'glyphicon-filter', + filter: { sort: 'due-desc', state: 'completed', assignment: 'involved' } + }); await this.alfrescoJsApi.activiti.userFiltersApi.createUserTaskFilter(newFilter); await browser.refresh(); - - await taskFiltersDemoPage.customTaskFilter('Due first').clickTaskFilter(); + await taskFiltersDemoPage.customTaskFilter(newFilter.name).clickTaskFilter(); await expect(await tasksListPage.getDataTable().contentInPosition(1)).toBe(tasks[2].name); await expect(await tasksListPage.getDataTable().contentInPosition(2)).toBe(tasks[1].name); @@ -173,17 +144,16 @@ describe('Task Filters Sorting', () => { }); it('[C277257] Should display tasks under new filter from farthest due date to closest when they are completed', async () => { - const newFilter: any = new UserProcessInstanceFilterRepresentation(); - newFilter.name = 'Due last'; - newFilter.appId = appId; - newFilter.icon = 'glyphicon-filter'; - newFilter.filter = { sort: 'due-asc', state: 'completed', assignment: 'involved' }; - + const newFilter = new UserProcessInstanceFilterRepresentation({ + appId, + name : 'Due last', + icon: 'glyphicon-filter', + filter: { sort: 'due-asc', state: 'completed', assignment: 'involved' } + }); await this.alfrescoJsApi.activiti.userFiltersApi.createUserTaskFilter(newFilter); await browser.refresh(); - - await taskFiltersDemoPage.customTaskFilter('Due last').clickTaskFilter(); + await taskFiltersDemoPage.customTaskFilter(newFilter.name).clickTaskFilter(); await expect(await tasksListPage.getDataTable().contentInPosition(1)).toBe(tasks[0].name); await expect(await tasksListPage.getDataTable().contentInPosition(2)).toBe(tasks[1].name); @@ -191,17 +161,16 @@ describe('Task Filters Sorting', () => { }); it('[C277258] Should display tasks under new filter from newest to oldest when they are open ', async () => { - const newFilter: any = new UserProcessInstanceFilterRepresentation(); - newFilter.name = 'Newest first Open'; - newFilter.appId = appId; - newFilter.icon = 'glyphicon-filter'; - newFilter.filter = { sort: 'created-desc', state: 'open', assignment: 'involved' }; - + const newFilter = new UserProcessInstanceFilterRepresentation({ + appId, + name : 'Newest first Open', + icon: 'glyphicon-filter', + filter: { sort: 'created-desc', state: 'open', assignment: 'involved' } + }); await this.alfrescoJsApi.activiti.userFiltersApi.createUserTaskFilter(newFilter); await browser.refresh(); - - await taskFiltersDemoPage.customTaskFilter('Newest first Open').clickTaskFilter(); + await taskFiltersDemoPage.customTaskFilter(newFilter.name).clickTaskFilter(); await expect(await tasksListPage.getDataTable().contentInPosition(1)).toBe(tasks[5].name); await expect(await tasksListPage.getDataTable().contentInPosition(2)).toBe(tasks[4].name); @@ -209,17 +178,16 @@ describe('Task Filters Sorting', () => { }); it('[C277259] Should display tasks under new filter from oldest to newest when they are open', async () => { - const newFilter: any = new UserProcessInstanceFilterRepresentation(); - newFilter.name = 'Newest last Open'; - newFilter.appId = appId; - newFilter.icon = 'glyphicon-filter'; - newFilter.filter = { sort: 'created-asc', state: 'open', assignment: 'involved' }; - + const newFilter = new UserProcessInstanceFilterRepresentation({ + appId, + name : 'Newest last Open', + icon: 'glyphicon-filter', + filter: { sort: 'created-asc', state: 'open', assignment: 'involved' } + }); await this.alfrescoJsApi.activiti.userFiltersApi.createUserTaskFilter(newFilter); await browser.refresh(); - - await taskFiltersDemoPage.customTaskFilter('Newest last Open').clickTaskFilter(); + await taskFiltersDemoPage.customTaskFilter(newFilter.name).clickTaskFilter(); await expect(await tasksListPage.getDataTable().contentInPosition(1)).toBe(tasks[3].name); await expect(await tasksListPage.getDataTable().contentInPosition(2)).toBe(tasks[4].name); @@ -227,17 +195,16 @@ describe('Task Filters Sorting', () => { }); it('[C277260] Should display tasks under new filter from closest due date to farthest when they are open', async () => { - const newFilter: any = new UserProcessInstanceFilterRepresentation(); - newFilter.name = 'Due first Open'; - newFilter.appId = appId; - newFilter.icon = 'glyphicon-filter'; - newFilter.filter = { sort: 'due-desc', state: 'open', assignment: 'involved' }; - + const newFilter = new UserProcessInstanceFilterRepresentation({ + appId, + name : 'Due first Open', + icon: 'glyphicon-filter', + filter: { sort: 'due-desc', state: 'open', assignment: 'involved' } + }); await this.alfrescoJsApi.activiti.userFiltersApi.createUserTaskFilter(newFilter); await browser.refresh(); - - await taskFiltersDemoPage.customTaskFilter('Due first Open').clickTaskFilter(); + await taskFiltersDemoPage.customTaskFilter(newFilter.name).clickTaskFilter(); await expect(await tasksListPage.getDataTable().contentInPosition(1)).toBe(tasks[5].name); await expect(await tasksListPage.getDataTable().contentInPosition(2)).toBe(tasks[4].name); @@ -245,21 +212,19 @@ describe('Task Filters Sorting', () => { }); it('[C277261] Should display tasks under new filter from farthest due date to closest when they are open', async () => { - const newFilter: any = new UserProcessInstanceFilterRepresentation(); - newFilter.name = 'Due last Open'; - newFilter.appId = appId; - newFilter.icon = 'glyphicon-filter'; - newFilter.filter = { sort: 'due-asc', state: 'open', assignment: 'involved' }; - + const newFilter = new UserProcessInstanceFilterRepresentation({ + appId, + name : 'Due last Open', + icon: 'glyphicon-filter', + filter: { sort: 'due-asc', state: 'open', assignment: 'involved' } + }); await this.alfrescoJsApi.activiti.userFiltersApi.createUserTaskFilter(newFilter); await browser.refresh(); - - await taskFiltersDemoPage.customTaskFilter('Due last Open').clickTaskFilter(); + await taskFiltersDemoPage.customTaskFilter(newFilter.name).clickTaskFilter(); await expect(await tasksListPage.getDataTable().contentInPosition(1)).toBe(tasks[3].name); await expect(await tasksListPage.getDataTable().contentInPosition(2)).toBe(tasks[4].name); await expect(await tasksListPage.getDataTable().contentInPosition(3)).toBe(tasks[5].name); - }); }); diff --git a/e2e/process-services/task-list-pagination.e2e.ts b/e2e/process-services/task-list-pagination.e2e.ts index 1b65a4365e..e81ccacb98 100644 --- a/e2e/process-services/task-list-pagination.e2e.ts +++ b/e2e/process-services/task-list-pagination.e2e.ts @@ -23,6 +23,7 @@ import { UsersActions } from '../actions/users.actions'; import { NavigationBarPage } from '../pages/adf/navigationBarPage'; import { TasksPage } from '../pages/adf/process-services/tasksPage'; import CONSTANTS = require('../util/constants'); +import { User } from '../models/APS/user'; describe('Task List Pagination', () => { @@ -31,7 +32,7 @@ describe('Task List Pagination', () => { const taskPage = new TasksPage(); const paginationPage = new PaginationPage(); - let processUserModel, processUserModelEmpty; + let processUserModel: User; const app = browser.params.resources.Files.SIMPLE_APP_WITH_USER_FORM; let currentPage = 1; const nrOfTasks = 20; @@ -59,12 +60,9 @@ describe('Task List Pagination', () => { }); await this.alfrescoJsApi.login(browser.params.testConfig.adf.adminEmail, browser.params.testConfig.adf.adminPassword); - processUserModel = await users.createTenantAndUser(this.alfrescoJsApi); - processUserModelEmpty = await users.createTenantAndUser(this.alfrescoJsApi); await this.alfrescoJsApi.login(processUserModel.email, processUserModel.password); - const resultApp = await apps.importPublishDeployApp(this.alfrescoJsApi, app.file_location); for (let i = 0; i < nrOfTasks; i++) { @@ -72,7 +70,11 @@ describe('Task List Pagination', () => { } await loginPage.loginToProcessServicesUsingUserModel(processUserModel); + }); + afterAll( async () => { + await this.alfrescoJsApi.login(browser.params.testConfig.adf.adminEmail, browser.params.testConfig.adf.adminPassword); + await this.alfrescoJsApi.activiti.adminTenantsApi.deleteTenant(processUserModel.tenantId); }); it('[C260301] Should display default pagination', async () => { @@ -192,11 +194,4 @@ describe('Task List Pagination', () => { await paginationPage.checkPreviousPageButtonIsDisabled(); }); - it('Pagination in an empty task list', async () => { - await loginPage.loginToProcessServicesUsingUserModel(processUserModelEmpty); - - await (await navigationBarPage.navigateToProcessServicesPage()).goToTaskApp(); - await paginationPage.checkPaginationIsNotDisplayed(); - }); - }); diff --git a/e2e/resources/apps/Test Assignee.zip b/e2e/resources/apps/Test Assignee.zip new file mode 100644 index 0000000000000000000000000000000000000000..23b7f22275da63aceb5c97bdcf994f93680307c6 GIT binary patch literal 5886 zcmaJ_1yCGYo1Fj|AV35L2|*?>5D3oTkl^m_gghJq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Um9< zD(@2+m{V5QMm9$_Tu&WlJU*H)ujdWbPX@1(H5+K6Dqo~@SfBDnz$t@bdodC5_TUx4 zzH2y=O(w&3X9kby%GER33K!?z_?(ZuWCn)s9x^K!adXfTgkzlRq!NAmO_6c%uVY@j z;ao~a_lPg!9jOb^FywqO4ZttfLs1UAWf{2YR;`j=?9ws?6(E{rxi$@ueV1hcIC>wm(-t&Y0vSJX&-mMQLllgm@ZuvM}1+x?F5h1 z@78nzuZ*jvBK`VDJiLgcHN8qfT!^wPy*zPnbeM+0PH0R-4UgoZE*k~(vhT~9UT;zW z|Cx6Z&0`m5;OWH;@m;0m_4t}SM*{%VAKbCiJv0#DZ`1U5xA4w1{m=Nn7V1CW|J_r# z^A!J%=f7(EPY&Zhk$#t+cUAv)@c-H&|AzF-k@zRj?__+ZRR0bGoPP)UTetob@Ar-R vpC1 { expect(component.current).toBe(1); }); + + it('should not show pagination when external component count is zero', () => { + const pagination: Pagination = {}; + const customComponent = { + pagination: new BehaviorSubject({ count: 0, maxItems: 5, totalItems: 5 }) + }; + component.target = customComponent; + component.ngOnInit(); + customComponent.pagination.next(pagination); + fixture.detectChanges(); + + expect(fixture.debugElement.nativeElement.querySelector('.adf-pagination__block')).toBeNull(); + }); + }); });