mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-24 17:32:15 +00:00
[ADF-5079] Claim task E2E (#5490)
* unified claim and requeue task * * highlight filter added * * removed unused method * * improved test * fixed conflicts
This commit is contained in:
@@ -29,17 +29,17 @@ export class UsersActions {
|
||||
|
||||
const user = new User({ tenantId: newTenant.id });
|
||||
|
||||
await alfrescoJsApi.activiti.adminUsersApi.createNewUser(user);
|
||||
const { id } = await alfrescoJsApi.activiti.adminUsersApi.createNewUser(user);
|
||||
|
||||
return user;
|
||||
return { ...user, id };
|
||||
}
|
||||
|
||||
async createApsUser(alfrescoJsApi, tenantId) {
|
||||
const user = new User({ tenantId });
|
||||
|
||||
await alfrescoJsApi.activiti.adminUsersApi.createNewUser(user);
|
||||
const { id } = await alfrescoJsApi.activiti.adminUsersApi.createNewUser(user);
|
||||
|
||||
return user;
|
||||
return { ...user, id };
|
||||
}
|
||||
|
||||
async getApsUserByEmail(alfrescoJsApi, email) {
|
||||
|
@@ -32,6 +32,7 @@ export class User {
|
||||
type = 'enterprise';
|
||||
tenantId = 1;
|
||||
company = null;
|
||||
id = 0;
|
||||
|
||||
constructor(details?: any) {
|
||||
Object.assign(this, details);
|
||||
|
@@ -15,7 +15,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { BrowserActions, DataTableComponentPage } from '@alfresco/adf-testing';
|
||||
import { BrowserActions, BrowserVisibility, DataTableComponentPage } from '@alfresco/adf-testing';
|
||||
import { by, element, ElementFinder } from 'protractor';
|
||||
|
||||
export class FiltersPage {
|
||||
@@ -40,4 +40,8 @@ export class FiltersPage {
|
||||
return this.dataTable.getAllRowsColumnValues('Name');
|
||||
}
|
||||
|
||||
async checkFilterIsHighlighted(filterName: string): Promise<void> {
|
||||
const highlightedFilter: ElementFinder = element(by.css(`mat-list-item.adf-active span[data-automation-id='${filterName}_filter']`));
|
||||
await BrowserVisibility.waitUntilElementIsVisible(highlightedFilter);
|
||||
}
|
||||
}
|
||||
|
@@ -64,6 +64,8 @@ export class TaskDetailsPage {
|
||||
emptyTaskDetails: ElementFinder = element(by.css('adf-task-details > div > div'));
|
||||
priority: ElementFinder = element(by.css('span[data-automation-id*="priority"] span'));
|
||||
editableAssignee = element(by.css('span[data-automation-id="card-textitem-value-assignee"][class*="clickable"]'));
|
||||
claimElement = element(by.css('[data-automation-id="header-claim-button"]'));
|
||||
releaseElement = element(by.css('[data-automation-id="header-unclaim-button"]'));
|
||||
|
||||
async checkEditableAssigneeIsNotDisplayed(): Promise<void> {
|
||||
await BrowserVisibility.waitUntilElementIsNotVisible(this.editableAssignee);
|
||||
@@ -417,4 +419,20 @@ export class TaskDetailsPage {
|
||||
return this.completeFormTask.isEnabled();
|
||||
}
|
||||
|
||||
async checkClaimEnabled(): Promise<void> {
|
||||
await BrowserVisibility.waitUntilElementIsPresent(this.claimElement);
|
||||
}
|
||||
|
||||
async checkReleaseEnabled(): Promise<void> {
|
||||
await BrowserVisibility.waitUntilElementIsPresent(this.releaseElement);
|
||||
}
|
||||
|
||||
async claimTask(): Promise<void> {
|
||||
await BrowserActions.click(this.claimElement);
|
||||
}
|
||||
|
||||
async releaseTask(): Promise<void> {
|
||||
await BrowserActions.click(this.releaseElement);
|
||||
}
|
||||
|
||||
}
|
||||
|
@@ -32,77 +32,210 @@ import { TasksPage } from '../pages/adf/process-services/tasks.page';
|
||||
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 apps = new AppsActions();
|
||||
const users = new UsersActions();
|
||||
|
||||
const app = browser.params.resources.Files.TEST_ASSIGNEE;
|
||||
this.alfrescoJsApi = new AlfrescoApi({
|
||||
provider: 'BPM',
|
||||
hostBpm: browser.params.testConfig.adf_aps.host
|
||||
});
|
||||
|
||||
let user: User;
|
||||
describe('Candidate User Assignee', () => {
|
||||
const processListPage = new ProcessListPage();
|
||||
const processFiltersPage = new ProcessFiltersPage();
|
||||
const startProcessPage = new StartProcessPage();
|
||||
const processServiceTabBarPage = new ProcessServiceTabBarPage();
|
||||
const processDetailsPage = new ProcessDetailsPage();
|
||||
|
||||
beforeAll(async () => {
|
||||
const apps = new AppsActions();
|
||||
const users = new UsersActions();
|
||||
this.alfrescoJsApi = new AlfrescoApi({
|
||||
provider: 'BPM',
|
||||
hostBpm: browser.params.testConfig.adf_aps.host
|
||||
let user: User;
|
||||
|
||||
beforeAll(async () => {
|
||||
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);
|
||||
});
|
||||
|
||||
await this.alfrescoJsApi.login(browser.params.testConfig.adf.adminEmail, browser.params.testConfig.adf.adminPassword);
|
||||
user = await users.createTenantAndUser(this.alfrescoJsApi);
|
||||
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 () => {
|
||||
const name = 'sample-process-one';
|
||||
await processServicesPage.goToApp(app.title);
|
||||
await processServiceTabBarPage.clickProcessButton();
|
||||
await processListPage.checkProcessListIsDisplayed();
|
||||
await processFiltersPage.clickCreateProcessButton();
|
||||
await processFiltersPage.clickNewProcessDropdown();
|
||||
await startProcessPage.startProcess({ name , processName: 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);
|
||||
});
|
||||
|
||||
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);
|
||||
});
|
||||
describe('Candidate Group Assignee', () => {
|
||||
let user: User;
|
||||
let candidate1: User;
|
||||
let candidate2: User;
|
||||
|
||||
beforeEach(async () => {
|
||||
await navigationBarPage.navigateToProcessServicesPage();
|
||||
await processServicesPage.checkApsContainer();
|
||||
});
|
||||
beforeAll(async () => {
|
||||
await this.alfrescoJsApi.login(browser.params.testConfig.adf.adminEmail, browser.params.testConfig.adf.adminPassword);
|
||||
user = await users.createTenantAndUser(this.alfrescoJsApi);
|
||||
candidate1 = await users.createApsUser(this.alfrescoJsApi, user.tenantId);
|
||||
candidate2 = await users.createApsUser(this.alfrescoJsApi, user.tenantId);
|
||||
const adminGroup = await this.alfrescoJsApi.activiti.adminGroupsApi.createNewGroup(
|
||||
{ 'name': app.adminGroup, 'tenantId': user.tenantId }
|
||||
);
|
||||
await this.alfrescoJsApi.activiti.adminGroupsApi.addGroupMember(adminGroup.id, user.id);
|
||||
await this.alfrescoJsApi.activiti.adminGroupsApi.addGroupCapabilities(adminGroup.id, { capabilities: app.adminCapabilities });
|
||||
|
||||
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();
|
||||
const candidateGroup = await this.alfrescoJsApi.activiti.adminGroupsApi.createNewGroup(
|
||||
{ 'name': app.candidateGroup, 'tenantId': user.tenantId, 'type': 1 }
|
||||
);
|
||||
await this.alfrescoJsApi.activiti.adminGroupsApi.addGroupMember(candidateGroup.id, candidate1.id);
|
||||
await this.alfrescoJsApi.activiti.adminGroupsApi.addGroupMember(candidateGroup.id, candidate2.id);
|
||||
await this.alfrescoJsApi.activiti.adminGroupsApi.addGroupMember(candidateGroup.id, user.id);
|
||||
|
||||
await startProcessPage.startProcess({name: 'sample-process-one', processName: app.processName });
|
||||
await processFiltersPage.selectFromProcessList('sample-process-one');
|
||||
await processDetailsPage.clickOnActiveTask();
|
||||
await this.alfrescoJsApi.login(user.email, user.password);
|
||||
const appModel = await apps.importPublishDeployApp(this.alfrescoJsApi, app.file_location, { renewIdmEntries: true });
|
||||
await apps.startProcess(this.alfrescoJsApi, appModel, app.processNames[1]);
|
||||
});
|
||||
|
||||
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);
|
||||
afterAll(async () => {
|
||||
await this.alfrescoJsApi.login(browser.params.testConfig.adf.adminEmail, browser.params.testConfig.adf.adminPassword);
|
||||
await this.alfrescoJsApi.activiti.adminTenantsApi.deleteTenant(user.tenantId);
|
||||
});
|
||||
|
||||
await taskPage.filtersPage().goToFilter(CONSTANTS.TASK_FILTERS.MY_TASKS);
|
||||
await taskPage.tasksListPage().checkContentIsNotDisplayed(app.userTasks.one);
|
||||
it('[C216430] Start Task - Claim and Requeue a task', async () => {
|
||||
await loginPage.loginToProcessServicesUsingUserModel(candidate1);
|
||||
await navigationBarPage.navigateToProcessServicesPage();
|
||||
await processServicesPage.checkApsContainer();
|
||||
await processServicesPage.goToApp('Task App');
|
||||
await taskPage.tasksListPage().checkTaskListIsLoaded();
|
||||
|
||||
await taskPage.filtersPage().goToFilter(CONSTANTS.TASK_FILTERS.COMPLETED_TASKS);
|
||||
await taskPage.tasksListPage().checkContentIsNotDisplayed(app.userTasks.one);
|
||||
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.MY_TASKS);
|
||||
await taskPage.taskDetails().clickCompleteFormTask();
|
||||
await taskPage.tasksListPage().checkContentIsNotDisplayed(app.userTasks.two);
|
||||
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.COMPLETED_TASKS);
|
||||
await taskPage.tasksListPage().checkContentIsDisplayed(app.userTasks.two);
|
||||
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 processServiceTabBarPage.clickProcessButton();
|
||||
await processListPage.checkProcessListIsDisplayed();
|
||||
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.loginToProcessServicesUsingUserModel(candidate2);
|
||||
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.loginToProcessServicesUsingUserModel(candidate1);
|
||||
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.loginToProcessServicesUsingUserModel(candidate2);
|
||||
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();
|
||||
});
|
||||
});
|
||||
|
||||
});
|
||||
|
BIN
e2e/resources/apps/Assignee.zip
Normal file
BIN
e2e/resources/apps/Assignee.zip
Normal file
Binary file not shown.
Binary file not shown.
@@ -53,11 +53,17 @@ exports.Files = {
|
||||
},
|
||||
|
||||
TEST_ASSIGNEE: {
|
||||
file_location: "/resources/apps/Test Assignee.zip",
|
||||
title: "Test Assignee",
|
||||
file_location: "/resources/apps/Assignee.zip",
|
||||
title: "Assignee",
|
||||
description: "Description for app",
|
||||
processName: "Sample",
|
||||
userTasks: { one: 'Form1', two: 'Form2' }
|
||||
processNames: ["simple", "candidate-task"],
|
||||
userTasks: {
|
||||
"simple": { one: 'Candidate Task', two: 'User Task' },
|
||||
"candidateTask": "Human step"
|
||||
},
|
||||
candidateGroup: "candidates",
|
||||
adminGroup: "admin",
|
||||
adminCapabilities: ['tenant-admin']
|
||||
},
|
||||
|
||||
APP_WITH_USER_WIDGET: {
|
||||
@@ -100,7 +106,6 @@ exports.Files = {
|
||||
file_location: "/resources/apps/Widgets smoke test.zip",
|
||||
title: "Widgets smoke test",
|
||||
formName: "Widgets smoke test",
|
||||
title: "Widgets smoke test",
|
||||
form_fields: {
|
||||
text_id: "text",
|
||||
header_id: "header",
|
||||
|
Reference in New Issue
Block a user