mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2026-09-09 18:03:21 +00:00
Disable control flow e2e ADF (#4954)
* update project script possible different JS-API * first commit no controll flow * second commit no controll flow * third commit no controll flow * 4 commit no controll flow * 5 commit no controll flow * 6 commit no controll flow * 7 commit no controll flow * 8 commit no controll flow * 9 commit no controll flow * 10 commit no controll flow * 11 commit no controll flow * 12 commit no controll flow * 13 commit no controll flow * 14 commit no controll flow * 15 commit no controll flow * 16 commit no controll flow * 17 commit no controll flow * 18 commit no controll flow * 19 commit no controll flow * 20 commit no controll flow * remove wdpromise, protractor promise and deferred promises * - fixed some incorrect “expect” calls - fixed some matchers - removed “return this;” when not needed - added a few more await-s * forgot a file * fix some failing tests * replaced driver calls with browser calls and enabled back waitForAngular * fix rightClick methods and hopefully some tests * fix settings-component * some more fixes for core and content tests * try to fix some more issues * linting * revert some changes, allowing download on headless chrome won’t work with multiple browser instances * fixes for Search tests * try to remove some wait calls * fix build * increase allScriptsTimeout and try another protractor and web driver version * improve navigation methods * some fixes for notification history and login sso * forgot a space * fix packages and enable some screenshots * navigation bar fixes * fix some test * some fixes for notification history and navigation bar use correct visibility method in attachFileWidget test * fix searching and another fix for navigation * try solve sso login * some more fixes * refactor async forEach into for..of * try fix for search tests * resolve rebabse problems * remove install * fix lint * fix core e2e * fix core e2e * fix core e2e * fix ps tests * fix some tests * fix core e2e * fix core e2e * fix core * fix some issues PS * fix core * fix core * fix some ps test * fix rebase issues * remove save * fix url regressed after rebase * fix url regressed after rebase * fix ps and core * fix lint * more parallel e2e ps * fix some ps cloud test * some cloud fix * fix lint * fix some test * remove files to be ignored * out-tsc * improve one cs test * fix candidate base app * fix ps test * remove click function * clean methods alrady present in browser action * try ugly wait * move wait * remove duplicate call * remove underscore * fix after review * fix imports * minor cosmetic fixes * fix comments test
This commit is contained in:
@@ -35,117 +35,95 @@ describe('Comment component for Processes', () => {
|
||||
const navigationBarPage = new NavigationBarPage();
|
||||
|
||||
const app = resources.Files.SIMPLE_APP_WITH_USER_FORM;
|
||||
let user, tenantId, appId, processInstanceId, comment, taskComment, addedComment;
|
||||
let user, tenantId, appId, processInstanceId, addedComment;
|
||||
|
||||
beforeAll(async(done) => {
|
||||
this.alfrescoJsApi = new AlfrescoApi({
|
||||
beforeAll(async () => {
|
||||
this.alfrescoJsApi = new AlfrescoApi({
|
||||
provider: 'BPM',
|
||||
hostBpm: browser.params.testConfig.adf_aps.host
|
||||
});
|
||||
|
||||
const apps = new AppsActions();
|
||||
const users = new UsersActions();
|
||||
|
||||
await this.alfrescoJsApi.login(browser.params.testConfig.adf.adminEmail, browser.params.testConfig.adf.adminPassword);
|
||||
|
||||
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 processWithComment = await apps.startProcess(this.alfrescoJsApi, 'Task App', 'Comment APS');
|
||||
processInstanceId = processWithComment.id;
|
||||
|
||||
await loginPage.loginToProcessServicesUsingUserModel(user);
|
||||
|
||||
done();
|
||||
});
|
||||
|
||||
afterAll(async(done) => {
|
||||
await this.alfrescoJsApi.activiti.modelsApi.deleteModel(appId);
|
||||
const apps = new AppsActions();
|
||||
const users = new UsersActions();
|
||||
|
||||
await this.alfrescoJsApi.login(browser.params.testConfig.adf.adminEmail, browser.params.testConfig.adf.adminPassword);
|
||||
|
||||
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 processWithComment = await apps.startProcess(this.alfrescoJsApi, 'Task App', 'Comment APS');
|
||||
processInstanceId = processWithComment.id;
|
||||
|
||||
await loginPage.loginToProcessServicesUsingUserModel(user);
|
||||
|
||||
});
|
||||
|
||||
afterAll(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);
|
||||
|
||||
done();
|
||||
});
|
||||
|
||||
it('[C260464] Should be able to add a comment on APS and check on ADF', () => {
|
||||
browser.controlFlow().execute(async() => {
|
||||
comment = {message: 'HELLO'};
|
||||
it('[C260464] Should be able to add a comment on APS and check on ADF', async () => {
|
||||
await this.alfrescoJsApi.activiti.commentsApi.addProcessInstanceComment({ message: 'HELLO' }, processInstanceId);
|
||||
|
||||
await this.alfrescoJsApi.activiti.commentsApi.addProcessInstanceComment(comment, processInstanceId);
|
||||
});
|
||||
await (await (await navigationBarPage.navigateToProcessServicesPage()).goToTaskApp()).clickProcessButton();
|
||||
|
||||
navigationBarPage.navigateToProcessServicesPage().goToTaskApp().clickProcessButton();
|
||||
await processFiltersPage.clickRunningFilterButton();
|
||||
await processFiltersPage.selectFromProcessList('Comment APS');
|
||||
|
||||
processFiltersPage.clickRunningFilterButton();
|
||||
processFiltersPage.selectFromProcessList('Comment APS');
|
||||
addedComment = await this.alfrescoJsApi.activiti.commentsApi.getProcessInstanceComments(processInstanceId, { 'latestFirst': true });
|
||||
|
||||
browser.controlFlow().execute(async() => {
|
||||
addedComment = await this.alfrescoJsApi.activiti.commentsApi.getProcessInstanceComments(processInstanceId, {'latestFirst': true});
|
||||
await commentsPage.checkUserIconIsDisplayed(0);
|
||||
|
||||
commentsPage.checkUserIconIsDisplayed(0);
|
||||
|
||||
expect(commentsPage.getTotalNumberOfComments()).toEqual('Comments (' + addedComment.total + ')');
|
||||
expect(commentsPage.getMessage(0)).toEqual(addedComment.data[0].message);
|
||||
expect(commentsPage.getUserName(0)).toEqual(addedComment.data[0].createdBy.firstName + ' ' + addedComment.data[0].createdBy.lastName);
|
||||
expect(commentsPage.getTime(0)).toMatch(/(ago|few)/);
|
||||
});
|
||||
await expect(await commentsPage.getTotalNumberOfComments()).toEqual('Comments (' + addedComment.total + ')');
|
||||
await expect(await commentsPage.getMessage(0)).toEqual(addedComment.data[0].message);
|
||||
await expect(await commentsPage.getUserName(0)).toEqual(addedComment.data[0].createdBy.firstName + ' ' + addedComment.data[0].createdBy.lastName);
|
||||
await expect(await commentsPage.getTime(0)).toMatch(/(ago|few)/);
|
||||
});
|
||||
|
||||
it('[C260465] Should not be able to view process comment on included task', () => {
|
||||
browser.controlFlow().execute(async() => {
|
||||
comment = {message: 'GOODBYE'};
|
||||
it('[C260465] Should not be able to view process comment on included task', async () => {
|
||||
await this.alfrescoJsApi.activiti.commentsApi.addProcessInstanceComment({ message: 'GOODBYE' }, processInstanceId);
|
||||
|
||||
await this.alfrescoJsApi.activiti.commentsApi.addProcessInstanceComment(comment, processInstanceId);
|
||||
});
|
||||
await (await (await navigationBarPage.navigateToProcessServicesPage()).goToTaskApp()).clickProcessButton();
|
||||
|
||||
navigationBarPage.navigateToProcessServicesPage().goToTaskApp().clickProcessButton();
|
||||
await processFiltersPage.clickRunningFilterButton();
|
||||
await processFiltersPage.selectFromProcessList('Comment APS');
|
||||
|
||||
processFiltersPage.clickRunningFilterButton();
|
||||
processFiltersPage.selectFromProcessList('Comment APS');
|
||||
const taskQuery = await this.alfrescoJsApi.activiti.taskApi.listTasks({ processInstanceId: processInstanceId });
|
||||
|
||||
browser.controlFlow().execute(async() => {
|
||||
const taskQuery = await this.alfrescoJsApi.activiti.taskApi.listTasks({processInstanceId: processInstanceId});
|
||||
const taskId = taskQuery.data[0].id;
|
||||
|
||||
const taskId = taskQuery.data[0].id;
|
||||
|
||||
const taskComments = await this.alfrescoJsApi.activiti.commentsApi.getTaskComments(taskId, {'latestFirst': true});
|
||||
expect(taskComments.total).toEqual(0);
|
||||
});
|
||||
const taskComments = await this.alfrescoJsApi.activiti.commentsApi.getTaskComments(taskId, { 'latestFirst': true });
|
||||
await expect(await taskComments.total).toEqual(0);
|
||||
});
|
||||
|
||||
it('[C260466] Should be able to display comments from Task on the related Process', () => {
|
||||
browser.controlFlow().execute(async() => {
|
||||
const taskQuery = await this.alfrescoJsApi.activiti.taskApi.listTasks({processInstanceId: processInstanceId});
|
||||
it('[C260466] Should be able to display comments from Task on the related Process', async () => {
|
||||
const taskQuery = await this.alfrescoJsApi.activiti.taskApi.listTasks({ processInstanceId: processInstanceId });
|
||||
|
||||
const taskId = taskQuery.data[0].id;
|
||||
const taskId = taskQuery.data[0].id;
|
||||
|
||||
taskComment = {message: 'Task Comment'};
|
||||
await this.alfrescoJsApi.activiti.taskApi.addTaskComment({ message: 'Task Comment' }, taskId);
|
||||
|
||||
await this.alfrescoJsApi.activiti.taskApi.addTaskComment(taskComment, taskId);
|
||||
});
|
||||
await (await (await navigationBarPage.navigateToProcessServicesPage()).goToTaskApp()).clickProcessButton();
|
||||
|
||||
navigationBarPage.navigateToProcessServicesPage().goToTaskApp().clickProcessButton();
|
||||
await processFiltersPage.clickRunningFilterButton();
|
||||
await processFiltersPage.selectFromProcessList('Comment APS');
|
||||
|
||||
processFiltersPage.clickRunningFilterButton();
|
||||
processFiltersPage.selectFromProcessList('Comment APS');
|
||||
const addedTaskComment = await this.alfrescoJsApi.activiti.commentsApi.getProcessInstanceComments(processInstanceId, { 'latestFirst': true });
|
||||
|
||||
browser.controlFlow().execute(async() => {
|
||||
const addedTaskComment = await this.alfrescoJsApi.activiti.commentsApi.getProcessInstanceComments(processInstanceId, {'latestFirst': true});
|
||||
await commentsPage.checkUserIconIsDisplayed(0);
|
||||
|
||||
commentsPage.checkUserIconIsDisplayed(0);
|
||||
|
||||
expect(commentsPage.getTotalNumberOfComments()).toEqual('Comments (' + addedTaskComment.total + ')');
|
||||
expect(commentsPage.getMessage(0)).toEqual(addedTaskComment.data[0].message);
|
||||
expect(commentsPage.getUserName(0)).toEqual(addedTaskComment.data[0].createdBy.firstName + ' ' + addedTaskComment.data[0].createdBy.lastName);
|
||||
expect(commentsPage.getTime(0)).toMatch(/(ago|few)/);
|
||||
});
|
||||
await expect(await commentsPage.getTotalNumberOfComments()).toEqual('Comments (' + addedTaskComment.total + ')');
|
||||
await expect(await commentsPage.getMessage(0)).toEqual(addedTaskComment.data[0].message);
|
||||
await expect(await commentsPage.getUserName(0)).toEqual(addedTaskComment.data[0].createdBy.firstName + ' ' + addedTaskComment.data[0].createdBy.lastName);
|
||||
await expect(await commentsPage.getTime(0)).toMatch(/(ago|few)/);
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user