mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2026-09-09 18:03:21 +00:00
@@ -16,11 +16,11 @@
|
||||
*/
|
||||
|
||||
import { browser } from 'protractor';
|
||||
import { ApiService, ApplicationsUtil, LoginPage, UsersActions } from '@alfresco/adf-testing';
|
||||
import { ModelsActions, ApiService, ApplicationsUtil, LoginPage, UsersActions } from '@alfresco/adf-testing';
|
||||
import { ProcessServicesPage } from './../pages/process-services.page';
|
||||
import { NavigationBarPage } from '../../core/pages/navigation-bar.page';
|
||||
import { ModelsActions } from '../../actions/APS/models.actions';
|
||||
import CONSTANTS = require('../../util/constants');
|
||||
import { AppDefinitionsApi } from '@alfresco/js-api';
|
||||
|
||||
describe('Modify applications', () => {
|
||||
|
||||
@@ -37,6 +37,7 @@ describe('Modify applications', () => {
|
||||
const apps = new ApplicationsUtil(apiService);
|
||||
const usersActions = new UsersActions(apiService);
|
||||
const applicationService = new ApplicationsUtil(apiService);
|
||||
const appsApi = new AppDefinitionsApi(apiService.getInstance());
|
||||
|
||||
let firstApp, appVersionToBeDeleted;
|
||||
|
||||
@@ -105,8 +106,8 @@ describe('Modify applications', () => {
|
||||
|
||||
await expect(await processServicesPage.getBackgroundColor(appToBeDeleted.title)).toEqual(CONSTANTS.APP_COLOR.GREY);
|
||||
|
||||
await modelActions.deleteVersionModel(appVersionToBeDeleted.id);
|
||||
await modelActions.deleteVersionModel(appVersionToBeDeleted.id);
|
||||
await modelActions.deleteModel(appVersionToBeDeleted.id);
|
||||
await modelActions.deleteModel(appVersionToBeDeleted.id);
|
||||
await apps.publishDeployApp(appVersionToBeDeleted.id);
|
||||
|
||||
await navigationBarPage.clickHomeButton();
|
||||
@@ -134,7 +135,7 @@ describe('Modify applications', () => {
|
||||
}, 'publish': true
|
||||
};
|
||||
|
||||
await apiService.getInstance().activiti.appsApi.updateAppDefinition(appVersionToBeDeleted.id, appDefinition);
|
||||
await appsApi.updateAppDefinition(appVersionToBeDeleted.id, appDefinition);
|
||||
|
||||
await navigationBarPage.clickHomeButton();
|
||||
await navigationBarPage.navigateToProcessServicesPage();
|
||||
|
||||
@@ -74,41 +74,36 @@ describe('Attach File - Content service', () => {
|
||||
const csIntegrations = ['adf dev', 'adf master'];
|
||||
let user: UserModel;
|
||||
|
||||
beforeAll(async (done) => {
|
||||
beforeAll(async () => {
|
||||
await LocalStorageUtil.setStorageItem('providers', 'ALL');
|
||||
try {
|
||||
await apiService.loginWithProfile('admin');
|
||||
user = await usersActions.createUser();
|
||||
await apiService.loginWithProfile('admin');
|
||||
user = await usersActions.createUser();
|
||||
|
||||
await apiServiceExternal.loginWithProfile('admin');
|
||||
await usersActionsExternal.createUser(user);
|
||||
await apiServiceExternal.loginWithProfile('admin');
|
||||
await usersActionsExternal.createUser(user);
|
||||
|
||||
await integrationService.addCSIntegration({
|
||||
tenantId: user.tenantId,
|
||||
name: csIntegrations[0],
|
||||
host: browser.params.testConfig.appConfig.ecmHost
|
||||
});
|
||||
await integrationService.addCSIntegration({
|
||||
tenantId: user.tenantId,
|
||||
name: csIntegrations[1],
|
||||
host: browser.params.testConfig.adf_external_acs.host
|
||||
});
|
||||
await integrationService.addCSIntegration({
|
||||
tenantId: user.tenantId,
|
||||
name: csIntegrations[0],
|
||||
host: browser.params.testConfig.appConfig.ecmHost
|
||||
});
|
||||
await integrationService.addCSIntegration({
|
||||
tenantId: user.tenantId,
|
||||
name: csIntegrations[1],
|
||||
host: browser.params.testConfig.adf_external_acs.host
|
||||
});
|
||||
|
||||
await apiService.login(user.username, user.password);
|
||||
await uploadActions.uploadFile(pdfFileTwo.location, pdfFileTwo.name, '-my-');
|
||||
await applicationService.importPublishDeployApp(app.file_path);
|
||||
await apiService.login(user.username, user.password);
|
||||
await uploadActions.uploadFile(pdfFileTwo.location, pdfFileTwo.name, '-my-');
|
||||
await applicationService.importPublishDeployApp(app.file_path);
|
||||
|
||||
await searchService.isSearchable(pdfFileTwo.name);
|
||||
await searchService.isSearchable(externalFile);
|
||||
} catch (error) {
|
||||
console.error('Preconditions failed check if the external env is up and running');
|
||||
}
|
||||
done();
|
||||
await searchService.isSearchable(pdfFileTwo.name);
|
||||
await searchService.isSearchable(externalFile);
|
||||
});
|
||||
|
||||
afterAll(async () => {
|
||||
await apiService.loginWithProfile('admin');
|
||||
await apiService.getInstance().activiti.adminTenantsApi.deleteTenant(user.tenantId);
|
||||
await usersActions.deleteTenant(user.tenantId);
|
||||
});
|
||||
|
||||
beforeEach(async () => {
|
||||
|
||||
@@ -61,7 +61,7 @@ describe('Start Task - Task App', () => {
|
||||
|
||||
afterAll(async () => {
|
||||
await apiService.loginWithProfile('admin');
|
||||
await apiService.getInstance().activiti.adminTenantsApi.deleteTenant(user.tenantId);
|
||||
await usersActions.deleteTenant(user.tenantId);
|
||||
});
|
||||
|
||||
it('[C274690] Should be able to open a file attached to a start form', async () => {
|
||||
|
||||
@@ -72,7 +72,7 @@ describe('Attach Folder', () => {
|
||||
|
||||
afterAll(async () => {
|
||||
await apiService.loginWithProfile('admin');
|
||||
await apiService.getInstance().activiti.adminTenantsApi.deleteTenant(user.tenantId);
|
||||
await usersActions.deleteTenant(user.tenantId);
|
||||
});
|
||||
|
||||
it('[C246534] Attach folder - ACS', async () => {
|
||||
|
||||
@@ -15,13 +15,20 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { ApiService, ApplicationsUtil, FormFields, LoginPage, UsersActions } from '@alfresco/adf-testing';
|
||||
import {
|
||||
ApiService,
|
||||
ApplicationsUtil,
|
||||
FormFields,
|
||||
LoginPage,
|
||||
ModelsActions,
|
||||
TaskUtil,
|
||||
UsersActions
|
||||
} from '@alfresco/adf-testing';
|
||||
import { browser, by } from 'protractor';
|
||||
import { NavigationBarPage } from '../../core/pages/navigation-bar.page';
|
||||
import { AttachFormPage } from './../pages/attach-form.page';
|
||||
import { TasksPage } from './../pages/tasks.page';
|
||||
import { TaskDetailsPage } from './../pages/task-details.page';
|
||||
import { TaskRepresentation } from '@alfresco/js-api';
|
||||
import CONSTANTS = require('../../util/constants');
|
||||
|
||||
describe('Attach Form Component', () => {
|
||||
@@ -37,6 +44,8 @@ describe('Attach Form Component', () => {
|
||||
const apiService = new ApiService();
|
||||
const usersActions = new UsersActions(apiService);
|
||||
const applicationService = new ApplicationsUtil(apiService);
|
||||
const taskUtil = new TaskUtil(apiService);
|
||||
const modelsActions = new ModelsActions(apiService);
|
||||
|
||||
const formTextField = app.form_fields.form_fieldId;
|
||||
let user, tenantId, appModel;
|
||||
@@ -60,15 +69,14 @@ describe('Attach Form Component', () => {
|
||||
|
||||
appModel = await applicationService.importPublishDeployApp(app.file_path);
|
||||
|
||||
await apiService.getInstance().activiti.taskApi.createNewTask(new TaskRepresentation({ name: testNames.taskName }));
|
||||
|
||||
await taskUtil.createStandaloneTask(testNames.taskName);
|
||||
await loginPage.login(user.username, user.password);
|
||||
});
|
||||
|
||||
afterAll(async () => {
|
||||
await apiService.getInstance().activiti.modelsApi.deleteModel(appModel.id);
|
||||
await modelsActions.deleteModel(appModel.id);
|
||||
await apiService.loginWithProfile('admin');
|
||||
await apiService.getInstance().activiti.adminTenantsApi.deleteTenant(tenantId);
|
||||
await usersActions.deleteTenant(tenantId);
|
||||
});
|
||||
|
||||
it('[C280047] Should be able to view the attach-form component after creating a standalone task', async () => {
|
||||
|
||||
@@ -15,15 +15,12 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { ApiService, LoginPage, UsersActions } from '@alfresco/adf-testing';
|
||||
import { ApiService, ApplicationsUtil, LoginPage, TaskUtil, UsersActions } from '@alfresco/adf-testing';
|
||||
import { TasksPage } from './../pages/tasks.page';
|
||||
import { ProcessServicesPage } from './../pages/process-services.page';
|
||||
import { ChecklistDialog } from './../pages/dialog/create-checklist-dialog.page';
|
||||
import { NavigationBarPage } from '../../core/pages/navigation-bar.page';
|
||||
import { browser } from 'protractor';
|
||||
import * as fs from 'fs';
|
||||
import * as path from 'path';
|
||||
import { TaskRepresentation } from '@alfresco/js-api';
|
||||
import CONSTANTS = require('../../util/constants');
|
||||
|
||||
describe('Checklist component', () => {
|
||||
@@ -38,6 +35,8 @@ describe('Checklist component', () => {
|
||||
|
||||
const apiService = new ApiService();
|
||||
const usersActions = new UsersActions(apiService);
|
||||
const applicationService = new ApplicationsUtil(apiService);
|
||||
const taskUtil = new TaskUtil(apiService);
|
||||
|
||||
let processUserModel;
|
||||
|
||||
@@ -51,15 +50,12 @@ describe('Checklist component', () => {
|
||||
|
||||
processUserModel = await usersActions.createUser();
|
||||
|
||||
const pathFile = path.join(browser.params.testConfig.main.rootPath + app.file_location);
|
||||
const file = fs.createReadStream(pathFile);
|
||||
await applicationService.importPublishDeployApp(app.file_path);
|
||||
|
||||
await apiService.login(processUserModel.username, processUserModel.password);
|
||||
|
||||
await apiService.getInstance().activiti.appsApi.importAppDefinition(file);
|
||||
|
||||
for (let i = 0; i < tasks.length; i++) {
|
||||
await apiService.getInstance().activiti.taskApi.createNewTask(new TaskRepresentation({ name: tasks[i] }));
|
||||
await taskUtil.createStandaloneTask(tasks[i]);
|
||||
}
|
||||
|
||||
await loginPage.login(processUserModel.username, processUserModel.password);
|
||||
|
||||
@@ -20,7 +20,7 @@ import {
|
||||
ApplicationsUtil,
|
||||
DatePickerCalendarPage,
|
||||
DateUtil,
|
||||
LoginPage,
|
||||
LoginPage, ModelsActions,
|
||||
UsersActions,
|
||||
Widget
|
||||
} from '@alfresco/adf-testing';
|
||||
@@ -37,8 +37,10 @@ describe('Dynamic Table', () => {
|
||||
const datePicker = new DatePickerCalendarPage();
|
||||
const navigationBarPage = new NavigationBarPage();
|
||||
const widget = new Widget();
|
||||
|
||||
const apiService = new ApiService();
|
||||
const usersActions = new UsersActions(apiService);
|
||||
const modelsActions = new ModelsActions(apiService);
|
||||
|
||||
let user, tenantId, appId;
|
||||
|
||||
@@ -50,7 +52,7 @@ describe('Dynamic Table', () => {
|
||||
|
||||
afterAll(async () => {
|
||||
await apiService.loginWithProfile('admin');
|
||||
await apiService.getInstance().activiti.adminTenantsApi.deleteTenant(tenantId);
|
||||
await usersActions.deleteTenant(tenantId);
|
||||
});
|
||||
|
||||
describe('Date Picker', () => {
|
||||
@@ -77,7 +79,7 @@ describe('Dynamic Table', () => {
|
||||
|
||||
afterAll(async () => {
|
||||
await apiService.login(user.username, user.password);
|
||||
await apiService.getInstance().activiti.modelsApi.deleteModel(appId);
|
||||
await modelsActions.deleteModel(appId);
|
||||
await navigationBarPage.clickLogoutButton();
|
||||
});
|
||||
|
||||
@@ -140,7 +142,7 @@ describe('Dynamic Table', () => {
|
||||
|
||||
afterAll(async () => {
|
||||
await apiService.login(user.username, user.password);
|
||||
await apiService.getInstance().activiti.modelsApi.deleteModel(appId);
|
||||
await modelsActions.deleteModel(appId);
|
||||
});
|
||||
|
||||
beforeEach(async () => {
|
||||
|
||||
@@ -63,7 +63,7 @@ describe('Form Component', () => {
|
||||
afterAll(async () => {
|
||||
await apiService.loginWithProfile('admin');
|
||||
|
||||
await apiService.getInstance().activiti.adminTenantsApi.deleteTenant(tenantId);
|
||||
await usersActions.deleteTenant(tenantId);
|
||||
});
|
||||
|
||||
it('[C286505] Should be able to display errors under the Error Log section', async () => {
|
||||
|
||||
@@ -29,6 +29,7 @@ import { TaskDetailsPage } from './../pages/task-details.page';
|
||||
import { NavigationBarPage } from '../../core/pages/navigation-bar.page';
|
||||
import { browser } from 'protractor';
|
||||
import { ProcessServiceTabBarPage } from './../pages/process-service-tab-bar.page';
|
||||
import { TaskFormsApi } from '@alfresco/js-api';
|
||||
|
||||
describe('Form widgets - People ', () => {
|
||||
|
||||
@@ -44,6 +45,7 @@ describe('Form widgets - People ', () => {
|
||||
|
||||
const apiService = new ApiService();
|
||||
const usersActions = new UsersActions(apiService);
|
||||
const taskFormsApi = new TaskFormsApi(apiService.getInstance());
|
||||
|
||||
let processUserModel;
|
||||
let appModel;
|
||||
@@ -65,7 +67,7 @@ describe('Form widgets - People ', () => {
|
||||
afterAll(async () => {
|
||||
await apiService.loginWithProfile('admin');
|
||||
|
||||
await apiService.getInstance().activiti.adminTenantsApi.deleteTenant(processUserModel.tenantId);
|
||||
await usersActions.deleteTenant(processUserModel.tenantId);
|
||||
});
|
||||
|
||||
beforeEach(async () => {
|
||||
@@ -83,7 +85,7 @@ describe('Form widgets - People ', () => {
|
||||
await processDetailsPage.activeTask.click();
|
||||
|
||||
const taskId = await taskDetails.getId();
|
||||
const taskForm: any = await apiService.getInstance().activiti.taskApi.getTaskForm(taskId);
|
||||
const taskForm: any = await taskFormsApi.getTaskForm(taskId);
|
||||
const userEmail = taskForm['fields'][0].fields['1'][0].value.email;
|
||||
await expect(userEmail).toEqual(processUserModel.email);
|
||||
});
|
||||
@@ -103,7 +105,7 @@ describe('Form widgets - People ', () => {
|
||||
await processDetailsPage.completedTask.click();
|
||||
|
||||
const taskId = await taskDetails.getId();
|
||||
const taskForm: any = await apiService.getInstance().activiti.taskApi.getTaskForm(taskId);
|
||||
const taskForm: any = await taskFormsApi.getTaskForm(taskId);
|
||||
const userEmail = taskForm['fields'][0].fields['1'][0].value.email;
|
||||
await expect(userEmail).toEqual(processUserModel.email);
|
||||
});
|
||||
|
||||
@@ -28,6 +28,7 @@ import { NavigationBarPage } from '../../core/pages/navigation-bar.page';
|
||||
import { browser } from 'protractor';
|
||||
import CONSTANTS = require('../../util/constants');
|
||||
import FormDefinitionModel = require('../../models/APS/FormDefinitionModel');
|
||||
import { TaskFormsApi } from '@alfresco/js-api';
|
||||
|
||||
const formInstance = new FormDefinitionModel();
|
||||
|
||||
@@ -40,6 +41,8 @@ describe('Form widgets', () => {
|
||||
const apiService = new ApiService();
|
||||
const usersActions = new UsersActions(apiService);
|
||||
const applicationsService = new ApplicationsUtil(apiService);
|
||||
const taskFormsApi = new TaskFormsApi(apiService.getInstance());
|
||||
const processUtil = new ProcessUtil(apiService);
|
||||
|
||||
const newTask = 'First task';
|
||||
let processUserModel;
|
||||
@@ -76,7 +79,7 @@ describe('Form widgets', () => {
|
||||
|
||||
const response = await taskPage.taskDetails().getId();
|
||||
|
||||
const formDefinition = await apiService.getInstance().activiti.taskFormsApi.getTaskForm(response);
|
||||
const formDefinition = await taskFormsApi.getTaskForm(response);
|
||||
formInstance.setFields(formDefinition.fields);
|
||||
formInstance.setAllWidgets(formDefinition.fields);
|
||||
});
|
||||
@@ -85,7 +88,7 @@ describe('Form widgets', () => {
|
||||
await new NavigationBarPage().clickLogoutButton();
|
||||
await apiService.loginWithProfile('admin');
|
||||
|
||||
await apiService.getInstance().activiti.adminTenantsApi.deleteTenant(processUserModel.tenantId);
|
||||
await usersActions.deleteTenant(processUserModel.tenantId);
|
||||
await apiService.getInstance().logout();
|
||||
});
|
||||
|
||||
@@ -206,7 +209,6 @@ describe('Form widgets', () => {
|
||||
await apiService.login(processUserModel.username, processUserModel.password);
|
||||
appModel = await applicationsService.importPublishDeployApp(app.file_path);
|
||||
|
||||
const processUtil = new ProcessUtil(apiService);
|
||||
process = await processUtil.startProcessOfApp(appModel.name);
|
||||
await loginPage.login(processUserModel.username, processUserModel.password);
|
||||
});
|
||||
@@ -219,9 +221,9 @@ describe('Form widgets', () => {
|
||||
});
|
||||
|
||||
afterAll(async () => {
|
||||
await apiService.getInstance().activiti.processApi.deleteProcessInstance(process.id);
|
||||
await processUtil.cancelProcessInstance(process.id);
|
||||
await apiService.loginWithProfile('admin');
|
||||
await apiService.getInstance().activiti.adminTenantsApi.deleteTenant(processUserModel.tenantId);
|
||||
await usersActions.deleteTenant(processUserModel.tenantId);
|
||||
});
|
||||
|
||||
it('[C260405] Value fields configured with process variables', async () => {
|
||||
|
||||
@@ -15,14 +15,11 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { ApiService, LoginPage, UserModel, UsersActions } from '@alfresco/adf-testing';
|
||||
import { ApiService, ApplicationsUtil, LoginPage, TaskUtil, UserModel, UsersActions } from '@alfresco/adf-testing';
|
||||
import { TasksPage } from './../pages/tasks.page';
|
||||
import { NavigationBarPage } from '../../core/pages/navigation-bar.page';
|
||||
import { ProcessServicesPage } from './../pages/process-services.page';
|
||||
import { browser } from 'protractor';
|
||||
import * as fs from 'fs';
|
||||
import * as path from 'path';
|
||||
import { TaskRepresentation } from '@alfresco/js-api';
|
||||
import CONSTANTS = require('../../util/constants');
|
||||
|
||||
describe('People component', () => {
|
||||
@@ -36,6 +33,8 @@ describe('People component', () => {
|
||||
|
||||
const apiService = new ApiService();
|
||||
const usersActions = new UsersActions(apiService);
|
||||
const taskUtil = new TaskUtil(apiService);
|
||||
const applicationUtil = new ApplicationsUtil(apiService);
|
||||
|
||||
let processUserModel, assigneeUserModel, secondAssigneeUserModel;
|
||||
const peopleTitle = 'People this task is shared with ';
|
||||
@@ -49,18 +48,15 @@ describe('People component', () => {
|
||||
secondAssigneeUserModel = await usersActions.createUser(new UserModel({ tenantId: assigneeUserModel.tenantId }));
|
||||
processUserModel = await usersActions.createUser(new UserModel({ tenantId: assigneeUserModel.tenantId }));
|
||||
|
||||
const pathFile = path.join(browser.params.testConfig.main.rootPath + app.file_location);
|
||||
const file = fs.createReadStream(pathFile);
|
||||
|
||||
await apiService.login(processUserModel.username, processUserModel.password);
|
||||
|
||||
await apiService.getInstance().activiti.appsApi.importAppDefinition(file);
|
||||
await applicationUtil.importApplication(app.file_path);
|
||||
|
||||
await apiService.getInstance().activiti.taskApi.createNewTask(new TaskRepresentation({ name: tasks[0] }));
|
||||
await apiService.getInstance().activiti.taskApi.createNewTask(new TaskRepresentation({ name: tasks[1] }));
|
||||
await apiService.getInstance().activiti.taskApi.createNewTask(new TaskRepresentation({ name: tasks[2] }));
|
||||
await apiService.getInstance().activiti.taskApi.createNewTask(new TaskRepresentation({ name: tasks[3] }));
|
||||
await apiService.getInstance().activiti.taskApi.createNewTask(new TaskRepresentation({ name: tasks[4] }));
|
||||
await taskUtil.createStandaloneTask(tasks[0]);
|
||||
await taskUtil.createStandaloneTask(tasks[1]);
|
||||
await taskUtil.createStandaloneTask(tasks[2]);
|
||||
await taskUtil.createStandaloneTask(tasks[3]);
|
||||
await taskUtil.createStandaloneTask(tasks[4]);
|
||||
});
|
||||
|
||||
beforeEach(async () => {
|
||||
|
||||
@@ -64,7 +64,7 @@ describe('Stencil', () => {
|
||||
|
||||
afterAll(async () => {
|
||||
await apiService.loginWithProfile('admin');
|
||||
await apiService.getInstance().activiti.adminTenantsApi.deleteTenant(user.tenantId);
|
||||
await usersActions.deleteTenant(user.tenantId);
|
||||
});
|
||||
|
||||
beforeEach(async () => {
|
||||
|
||||
@@ -16,10 +16,18 @@
|
||||
*/
|
||||
|
||||
import { browser } from 'protractor';
|
||||
import { ApiService, ApplicationsUtil, LoginPage, ProcessUtil, UsersActions } from '@alfresco/adf-testing';
|
||||
import {
|
||||
ApiService,
|
||||
ApplicationsUtil,
|
||||
LoginPage,
|
||||
ModelsActions,
|
||||
ProcessUtil,
|
||||
UsersActions
|
||||
} from '@alfresco/adf-testing';
|
||||
import { ProcessFiltersPage } from './../pages/process-filters.page';
|
||||
import { CommentsPage } from '../../core/pages/comments.page';
|
||||
import { NavigationBarPage } from '../../core/pages/navigation-bar.page';
|
||||
import { ActivitiCommentsApi, TasksApi } from '@alfresco/js-api';
|
||||
|
||||
describe('Comment component for Processes', () => {
|
||||
|
||||
@@ -33,6 +41,9 @@ describe('Comment component for Processes', () => {
|
||||
const apiService = new ApiService();
|
||||
const usersActions = new UsersActions(apiService);
|
||||
const applicationsService = new ApplicationsUtil(apiService);
|
||||
const modelsActions = new ModelsActions(apiService);
|
||||
const commentsApi = new ActivitiCommentsApi(apiService.getInstance());
|
||||
const taskApi = new TasksApi(apiService.getInstance());
|
||||
|
||||
let user, appId, processInstanceId, addedComment;
|
||||
const processName = 'Comment APS';
|
||||
@@ -54,20 +65,20 @@ describe('Comment component for Processes', () => {
|
||||
});
|
||||
|
||||
afterAll(async () => {
|
||||
await apiService.getInstance().activiti.modelsApi.deleteModel(appId);
|
||||
await modelsActions.deleteModel(appId);
|
||||
await apiService.loginWithProfile('admin');
|
||||
await apiService.getInstance().activiti.adminTenantsApi.deleteTenant(user.tenantId);
|
||||
await usersActions.deleteTenant(user.tenantId);
|
||||
});
|
||||
|
||||
it('[C260464] Should be able to add a comment on APS and check on ADF', async () => {
|
||||
await apiService.getInstance().activiti.commentsApi.addProcessInstanceComment({ message: 'HELLO' }, processInstanceId);
|
||||
await commentsApi.addProcessInstanceComment({ message: 'HELLO' }, processInstanceId);
|
||||
|
||||
await (await (await navigationBarPage.navigateToProcessServicesPage()).goToTaskApp()).clickProcessButton();
|
||||
|
||||
await processFiltersPage.clickRunningFilterButton();
|
||||
await processFiltersPage.selectFromProcessList(processName);
|
||||
|
||||
addedComment = await apiService.getInstance().activiti.commentsApi.getProcessInstanceComments(processInstanceId, { 'latestFirst': true });
|
||||
addedComment = await commentsApi.getProcessInstanceComments(processInstanceId, { 'latestFirst': true });
|
||||
|
||||
await commentsPage.checkUserIconIsDisplayed();
|
||||
|
||||
@@ -78,34 +89,34 @@ describe('Comment component for Processes', () => {
|
||||
});
|
||||
|
||||
it('[C260465] Should not be able to view process comment on included task', async () => {
|
||||
await apiService.getInstance().activiti.commentsApi.addProcessInstanceComment({ message: 'GOODBYE' }, processInstanceId);
|
||||
await commentsApi.addProcessInstanceComment({ message: 'GOODBYE' }, processInstanceId);
|
||||
|
||||
await (await (await navigationBarPage.navigateToProcessServicesPage()).goToTaskApp()).clickProcessButton();
|
||||
|
||||
await processFiltersPage.clickRunningFilterButton();
|
||||
await processFiltersPage.selectFromProcessList(processName);
|
||||
|
||||
const taskQuery = await apiService.getInstance().activiti.taskApi.listTasks({ processInstanceId: processInstanceId });
|
||||
const taskQuery = await taskApi.listTasks({ processInstanceId: processInstanceId });
|
||||
|
||||
const taskId = taskQuery.data[0].id;
|
||||
|
||||
const taskComments = await apiService.getInstance().activiti.commentsApi.getTaskComments(taskId, { 'latestFirst': true });
|
||||
const taskComments = await commentsApi.getTaskComments(taskId, { 'latestFirst': true });
|
||||
await expect(taskComments.total).toEqual(0);
|
||||
});
|
||||
|
||||
it('[C260466] Should be able to display comments from Task on the related Process', async () => {
|
||||
const taskQuery = await apiService.getInstance().activiti.taskApi.listTasks({ processInstanceId: processInstanceId });
|
||||
const taskQuery = await taskApi.listTasks({ processInstanceId: processInstanceId });
|
||||
|
||||
const taskId = taskQuery.data[0].id;
|
||||
|
||||
await apiService.getInstance().activiti.taskApi.addTaskComment({ message: 'Task Comment' }, taskId);
|
||||
await commentsApi.addTaskComment({ message: 'Task Comment' }, taskId);
|
||||
|
||||
await (await (await navigationBarPage.navigateToProcessServicesPage()).goToTaskApp()).clickProcessButton();
|
||||
|
||||
await processFiltersPage.clickRunningFilterButton();
|
||||
await processFiltersPage.selectFromProcessList(processName);
|
||||
|
||||
const addedTaskComment = await apiService.getInstance().activiti.commentsApi.getProcessInstanceComments(processInstanceId, { 'latestFirst': true });
|
||||
const addedTaskComment = await commentsApi.getProcessInstanceComments(processInstanceId, { 'latestFirst': true });
|
||||
|
||||
await commentsPage.checkUserIconIsDisplayed();
|
||||
|
||||
|
||||
@@ -17,10 +17,18 @@
|
||||
|
||||
import { browser } from 'protractor';
|
||||
|
||||
import { ApiService, ApplicationsUtil, LoginPage, ProcessUtil, UsersActions } from '@alfresco/adf-testing';
|
||||
import {
|
||||
ApiService,
|
||||
ApplicationsUtil,
|
||||
LoginPage,
|
||||
ModelsActions,
|
||||
ProcessUtil,
|
||||
UsersActions
|
||||
} from '@alfresco/adf-testing';
|
||||
import { NavigationBarPage } from '../../core/pages/navigation-bar.page';
|
||||
import { ProcessFiltersPage } from './../pages/process-filters.page';
|
||||
import { FiltersPage } from './../pages/filters.page';
|
||||
import { ProcessInstancesApi, UserFiltersApi } from '@alfresco/js-api';
|
||||
|
||||
describe('Sorting for process filters', () => {
|
||||
|
||||
@@ -33,6 +41,9 @@ describe('Sorting for process filters', () => {
|
||||
|
||||
const apiService = new ApiService();
|
||||
const usersActions = new UsersActions(apiService);
|
||||
const modelsActions = new ModelsActions(apiService);
|
||||
const userFiltersApi = new UserFiltersApi(apiService.getInstance());
|
||||
const processInstancesApi = new ProcessInstancesApi(apiService.getInstance());
|
||||
|
||||
let tenantId, appId, user, processesQuery;
|
||||
let importedApp;
|
||||
@@ -66,9 +77,9 @@ describe('Sorting for process filters', () => {
|
||||
|
||||
afterEach(async () => {
|
||||
try {
|
||||
await apiService.getInstance().activiti.modelsApi.deleteModel(appId);
|
||||
await modelsActions.deleteModel(appId);
|
||||
await apiService.loginWithProfile('admin');
|
||||
await apiService.getInstance().activiti.adminTenantsApi.deleteTenant(tenantId);
|
||||
await usersActions.deleteTenant(tenantId);
|
||||
} catch (e) {
|
||||
}
|
||||
|
||||
@@ -76,7 +87,7 @@ describe('Sorting for process filters', () => {
|
||||
});
|
||||
|
||||
it('[C260476] Should be able to create a filter on APS for running processes - Oldest first and check on ADF', async () => {
|
||||
await apiService.getInstance().activiti.userFiltersApi.createUserProcessInstanceFilter({
|
||||
await userFiltersApi.createUserProcessInstanceFilter({
|
||||
'appId': null, 'name': processFilter.running_old_first, 'icon': 'glyphicon-random',
|
||||
'filter': { 'sort': 'created-asc', 'name': '', 'state': 'running' }
|
||||
});
|
||||
@@ -89,7 +100,7 @@ describe('Sorting for process filters', () => {
|
||||
|
||||
await processFiltersPage.checkFilterIsDisplayed(processFilter.running_old_first);
|
||||
await filtersPage.goToFilter(processFilter.running_old_first);
|
||||
processesQuery = await apiService.getInstance().activiti.processApi.getProcessInstances({
|
||||
processesQuery = await processInstancesApi.getProcessInstances({
|
||||
'processDefinitionId': null, 'appDefinitionId': null, 'state': 'running', 'sort': 'created-asc'
|
||||
});
|
||||
await expect(processesQuery.data[0].name).toEqual(firstProc.name);
|
||||
@@ -98,7 +109,7 @@ describe('Sorting for process filters', () => {
|
||||
});
|
||||
|
||||
it('[C260477] Should be able to create a filter on APS for completed processes - Oldest first and check on ADF', async () => {
|
||||
await apiService.getInstance().activiti.userFiltersApi.createUserProcessInstanceFilter({
|
||||
await userFiltersApi.createUserProcessInstanceFilter({
|
||||
'appId': null, 'name': processFilter.completed_old_first, 'icon': 'glyphicon-random',
|
||||
'filter': { 'sort': 'created-asc', 'name': '', 'state': 'completed' }
|
||||
});
|
||||
@@ -108,9 +119,9 @@ describe('Sorting for process filters', () => {
|
||||
const secondProc = await processUtil.startProcessOfApp(importedApp.name);
|
||||
const thirdProc = await processUtil.startProcessOfApp(importedApp.name);
|
||||
|
||||
await apiService.getInstance().activiti.processInstancesApi.deleteProcessInstance(firstProc.id);
|
||||
await apiService.getInstance().activiti.processInstancesApi.deleteProcessInstance(secondProc.id);
|
||||
await apiService.getInstance().activiti.processInstancesApi.deleteProcessInstance(thirdProc.id);
|
||||
await processUtil.cancelProcessInstance(firstProc.id);
|
||||
await processUtil.cancelProcessInstance(secondProc.id);
|
||||
await processUtil.cancelProcessInstance(thirdProc.id);
|
||||
|
||||
await (await (await navigationBarPage.navigateToProcessServicesPage()).goToTaskApp()).clickProcessButton();
|
||||
|
||||
@@ -118,7 +129,7 @@ describe('Sorting for process filters', () => {
|
||||
|
||||
await filtersPage.goToFilter(processFilter.completed_old_first);
|
||||
|
||||
processesQuery = await apiService.getInstance().activiti.processApi.getProcessInstances({
|
||||
processesQuery = await processInstancesApi.getProcessInstances({
|
||||
'processDefinitionId': null, 'appDefinitionId': null, 'state': 'completed', 'sort': 'created-asc'
|
||||
});
|
||||
await expect(processesQuery.data[0].name).toEqual(firstProc.name);
|
||||
@@ -127,7 +138,7 @@ describe('Sorting for process filters', () => {
|
||||
});
|
||||
|
||||
it('[C260478] Should be able to create a filter on APS for all processes - Oldest first and check on ADF', async () => {
|
||||
await apiService.getInstance().activiti.userFiltersApi.createUserProcessInstanceFilter({
|
||||
await userFiltersApi.createUserProcessInstanceFilter({
|
||||
'appId': null, 'name': processFilter.all_old_first, 'icon': 'glyphicon-random',
|
||||
'filter': { 'sort': 'created-asc', 'name': '', 'state': 'all' }
|
||||
});
|
||||
@@ -141,9 +152,9 @@ describe('Sorting for process filters', () => {
|
||||
const deleteSecondProc = await processUtil.startProcessOfApp(importedApp.name);
|
||||
const deleteThirdProc = await processUtil.startProcessOfApp(importedApp.name);
|
||||
|
||||
await apiService.getInstance().activiti.processInstancesApi.deleteProcessInstance(deleteFirstProc.id);
|
||||
await apiService.getInstance().activiti.processInstancesApi.deleteProcessInstance(deleteSecondProc.id);
|
||||
await apiService.getInstance().activiti.processInstancesApi.deleteProcessInstance(deleteThirdProc.id);
|
||||
await processUtil.cancelProcessInstance(deleteFirstProc.id);
|
||||
await processUtil.cancelProcessInstance(deleteSecondProc.id);
|
||||
await processUtil.cancelProcessInstance(deleteThirdProc.id);
|
||||
|
||||
await (await (await navigationBarPage.navigateToProcessServicesPage()).goToTaskApp()).clickProcessButton();
|
||||
|
||||
@@ -151,7 +162,7 @@ describe('Sorting for process filters', () => {
|
||||
|
||||
await filtersPage.goToFilter(processFilter.all_old_first);
|
||||
|
||||
processesQuery = await apiService.getInstance().activiti.processApi.getProcessInstances({
|
||||
processesQuery = await processInstancesApi.getProcessInstances({
|
||||
'processDefinitionId': null, 'appDefinitionId': null, 'state': 'all', 'sort': 'created-asc'
|
||||
});
|
||||
await expect(processesQuery.data[0].name).toEqual(firstProc.name);
|
||||
@@ -163,7 +174,7 @@ describe('Sorting for process filters', () => {
|
||||
});
|
||||
|
||||
it('[C260479] Should be able to create a filter on APS for running processes - Newest first and check on ADF', async () => {
|
||||
await apiService.getInstance().activiti.userFiltersApi.createUserProcessInstanceFilter({
|
||||
await userFiltersApi.createUserProcessInstanceFilter({
|
||||
'appId': null, 'name': processFilter.running_new_first, 'icon': 'glyphicon-random',
|
||||
'filter': { 'sort': 'created-desc', 'name': '', 'state': 'running' }
|
||||
});
|
||||
@@ -179,7 +190,7 @@ describe('Sorting for process filters', () => {
|
||||
|
||||
await filtersPage.goToFilter(processFilter.running_new_first);
|
||||
|
||||
processesQuery = await apiService.getInstance().activiti.processApi.getProcessInstances({
|
||||
processesQuery = await processInstancesApi.getProcessInstances({
|
||||
'processDefinitionId': null, 'appDefinitionId': null, 'state': 'running', 'sort': 'created-desc'
|
||||
});
|
||||
await expect(processesQuery.data[0].name).toEqual(thirdProc.name);
|
||||
@@ -188,7 +199,7 @@ describe('Sorting for process filters', () => {
|
||||
});
|
||||
|
||||
it('[C260480] Should be able to create a filter on APS for completed processes - Newest first and check on ADF', async () => {
|
||||
await apiService.getInstance().activiti.userFiltersApi.createUserProcessInstanceFilter({
|
||||
await userFiltersApi.createUserProcessInstanceFilter({
|
||||
'appId': null, 'name': processFilter.completed_new_first, 'icon': 'glyphicon-random',
|
||||
'filter': { 'sort': 'created-desc', 'name': '', 'state': 'completed' }
|
||||
});
|
||||
@@ -198,16 +209,16 @@ describe('Sorting for process filters', () => {
|
||||
const secondProc = await processUtil.startProcessOfApp(importedApp.name);
|
||||
const thirdProc = await processUtil.startProcessOfApp(importedApp.name);
|
||||
|
||||
await apiService.getInstance().activiti.processInstancesApi.deleteProcessInstance(firstProc.id);
|
||||
await apiService.getInstance().activiti.processInstancesApi.deleteProcessInstance(secondProc.id);
|
||||
await apiService.getInstance().activiti.processInstancesApi.deleteProcessInstance(thirdProc.id);
|
||||
await processUtil.cancelProcessInstance(firstProc.id);
|
||||
await processUtil.cancelProcessInstance(secondProc.id);
|
||||
await processUtil.cancelProcessInstance(thirdProc.id);
|
||||
|
||||
await (await (await navigationBarPage.navigateToProcessServicesPage()).goToTaskApp()).clickProcessButton();
|
||||
|
||||
await processFiltersPage.checkFilterIsDisplayed(processFilter.completed_new_first);
|
||||
|
||||
await filtersPage.goToFilter(processFilter.completed_new_first);
|
||||
processesQuery = await apiService.getInstance().activiti.processApi.getProcessInstances({
|
||||
processesQuery = await processInstancesApi.getProcessInstances({
|
||||
'processDefinitionId': null, 'appDefinitionId': null, 'state': 'completed', 'sort': 'created-desc'
|
||||
});
|
||||
await expect(processesQuery.data[0].name).toEqual(thirdProc.name);
|
||||
@@ -216,7 +227,7 @@ describe('Sorting for process filters', () => {
|
||||
});
|
||||
|
||||
it('[C260481] Should be able to create a filter on APS for all processes - Newest first and check on ADF', async () => {
|
||||
await apiService.getInstance().activiti.userFiltersApi.createUserProcessInstanceFilter({
|
||||
await userFiltersApi.createUserProcessInstanceFilter({
|
||||
'appId': null, 'name': processFilter.all_new_first, 'icon': 'glyphicon-random',
|
||||
'filter': { 'sort': 'created-desc', 'name': '', 'state': 'all' }
|
||||
});
|
||||
@@ -230,9 +241,9 @@ describe('Sorting for process filters', () => {
|
||||
const deleteSecondProc = await processUtil.startProcessOfApp(importedApp.name);
|
||||
const deleteThirdProc = await processUtil.startProcessOfApp(importedApp.name);
|
||||
|
||||
await apiService.getInstance().activiti.processInstancesApi.deleteProcessInstance(deleteFirstProc.id);
|
||||
await apiService.getInstance().activiti.processInstancesApi.deleteProcessInstance(deleteSecondProc.id);
|
||||
await apiService.getInstance().activiti.processInstancesApi.deleteProcessInstance(deleteThirdProc.id);
|
||||
await processUtil.cancelProcessInstance(deleteFirstProc.id);
|
||||
await processUtil.cancelProcessInstance(deleteSecondProc.id);
|
||||
await processUtil.cancelProcessInstance(deleteThirdProc.id);
|
||||
|
||||
await (await (await navigationBarPage.navigateToProcessServicesPage()).goToTaskApp()).clickProcessButton();
|
||||
|
||||
@@ -240,7 +251,7 @@ describe('Sorting for process filters', () => {
|
||||
|
||||
await filtersPage.goToFilter(processFilter.all_new_first);
|
||||
|
||||
processesQuery = await apiService.getInstance().activiti.processApi.getProcessInstances({
|
||||
processesQuery = await processInstancesApi.getProcessInstances({
|
||||
'processDefinitionId': null, 'appDefinitionId': null, 'state': 'all', 'sort': 'created-desc'
|
||||
});
|
||||
await expect(processesQuery.data[0].name).toEqual(deleteThirdProc.name);
|
||||
@@ -252,7 +263,7 @@ describe('Sorting for process filters', () => {
|
||||
});
|
||||
|
||||
it('[C272815] Should be able to create a filter on APS for completed processes - Completed most recently and check on ADF', async () => {
|
||||
await apiService.getInstance().activiti.userFiltersApi.createUserProcessInstanceFilter({
|
||||
await userFiltersApi.createUserProcessInstanceFilter({
|
||||
'appId': null, 'name': processFilter.completed_most_recently, 'icon': 'glyphicon-random',
|
||||
'filter': { 'sort': 'ended-asc', 'name': '', 'state': 'completed' }
|
||||
});
|
||||
@@ -262,9 +273,9 @@ describe('Sorting for process filters', () => {
|
||||
const secondProc = await processUtil.startProcessOfApp(importedApp.name);
|
||||
const thirdProc = await processUtil.startProcessOfApp(importedApp.name);
|
||||
|
||||
await apiService.getInstance().activiti.processInstancesApi.deleteProcessInstance(secondProc.id);
|
||||
await apiService.getInstance().activiti.processInstancesApi.deleteProcessInstance(firstProc.id);
|
||||
await apiService.getInstance().activiti.processInstancesApi.deleteProcessInstance(thirdProc.id);
|
||||
await processUtil.cancelProcessInstance(secondProc.id);
|
||||
await processUtil.cancelProcessInstance(firstProc.id);
|
||||
await processUtil.cancelProcessInstance(thirdProc.id);
|
||||
|
||||
await (await (await navigationBarPage.navigateToProcessServicesPage()).goToTaskApp()).clickProcessButton();
|
||||
|
||||
@@ -272,7 +283,7 @@ describe('Sorting for process filters', () => {
|
||||
|
||||
await filtersPage.goToFilter(processFilter.completed_most_recently);
|
||||
|
||||
processesQuery = await apiService.getInstance().activiti.processApi.getProcessInstances({
|
||||
processesQuery = await processInstancesApi.getProcessInstances({
|
||||
'processDefinitionId': null, 'appDefinitionId': null, 'state': 'completed', 'sort': 'ended-asc'
|
||||
});
|
||||
await expect(processesQuery.data[0].name).toEqual(secondProc.name);
|
||||
@@ -281,7 +292,7 @@ describe('Sorting for process filters', () => {
|
||||
});
|
||||
|
||||
it('[C272816] Should be able to create a filter on APS for completed processes - Completed least recently and check on ADF', async () => {
|
||||
await apiService.getInstance().activiti.userFiltersApi.createUserProcessInstanceFilter({
|
||||
await userFiltersApi.createUserProcessInstanceFilter({
|
||||
'appId': null, 'name': processFilter.completed_least_recently, 'icon': 'glyphicon-random',
|
||||
'filter': { 'sort': 'ended-desc', 'name': '', 'state': 'completed' }
|
||||
});
|
||||
@@ -291,9 +302,9 @@ describe('Sorting for process filters', () => {
|
||||
const secondProc = await processUtil.startProcessOfApp(importedApp.name);
|
||||
const thirdProc = await processUtil.startProcessOfApp(importedApp.name);
|
||||
|
||||
await apiService.getInstance().activiti.processInstancesApi.deleteProcessInstance(secondProc.id);
|
||||
await apiService.getInstance().activiti.processInstancesApi.deleteProcessInstance(firstProc.id);
|
||||
await apiService.getInstance().activiti.processInstancesApi.deleteProcessInstance(thirdProc.id);
|
||||
await processUtil.cancelProcessInstance(secondProc.id);
|
||||
await processUtil.cancelProcessInstance(firstProc.id);
|
||||
await processUtil.cancelProcessInstance(thirdProc.id);
|
||||
|
||||
await (await (await navigationBarPage.navigateToProcessServicesPage()).goToTaskApp()).clickProcessButton();
|
||||
|
||||
@@ -301,7 +312,7 @@ describe('Sorting for process filters', () => {
|
||||
|
||||
await filtersPage.goToFilter(processFilter.completed_least_recently);
|
||||
|
||||
processesQuery = await apiService.getInstance().activiti.processApi.getProcessInstances({
|
||||
processesQuery = await processInstancesApi.getProcessInstances({
|
||||
'processDefinitionId': null, 'appDefinitionId': null, 'state': 'completed', 'sort': 'ended-desc'
|
||||
});
|
||||
await expect(processesQuery.data[0].name).toEqual(thirdProc.name);
|
||||
|
||||
@@ -20,6 +20,7 @@ import { ProcessFiltersPage } from './../pages/process-filters.page';
|
||||
import { ProcessServiceTabBarPage } from './../pages/process-service-tab-bar.page';
|
||||
import { AppSettingsTogglesPage } from './../pages/dialog/app-settings-toggles.page';
|
||||
import { NavigationBarPage } from '../../core/pages/navigation-bar.page';
|
||||
import { UserFiltersApi } from '@alfresco/js-api';
|
||||
|
||||
describe('New Process Filters', () => {
|
||||
|
||||
@@ -31,6 +32,7 @@ describe('New Process Filters', () => {
|
||||
|
||||
const apiService = new ApiService();
|
||||
const usersActions = new UsersActions(apiService);
|
||||
const userFiltersApi = new UserFiltersApi(apiService.getInstance());
|
||||
|
||||
let tenantId, user, filterId, customProcessFilter;
|
||||
|
||||
@@ -59,7 +61,7 @@ describe('New Process Filters', () => {
|
||||
|
||||
afterAll(async () => {
|
||||
await apiService.loginWithProfile('admin');
|
||||
await apiService.getInstance().activiti.adminTenantsApi.deleteTenant(tenantId);
|
||||
await usersActions.deleteTenant(tenantId);
|
||||
});
|
||||
|
||||
it('[C279965] Should be able to view default filters on ADF', async () => {
|
||||
@@ -71,7 +73,7 @@ describe('New Process Filters', () => {
|
||||
});
|
||||
|
||||
it('[C260473] Should be able to create a new filter on APS and display it on ADF', async () => {
|
||||
customProcessFilter = await apiService.getInstance().activiti.userFiltersApi.createUserProcessInstanceFilter({
|
||||
customProcessFilter = await userFiltersApi.createUserProcessInstanceFilter({
|
||||
'appId': null,
|
||||
'name': processFilter.new_filter,
|
||||
'icon': 'glyphicon-random',
|
||||
@@ -86,7 +88,7 @@ describe('New Process Filters', () => {
|
||||
});
|
||||
|
||||
it('[C286450] Should display the process filter icon when a custom filter is added', async () => {
|
||||
customProcessFilter = await apiService.getInstance().activiti.userFiltersApi.createUserProcessInstanceFilter({
|
||||
customProcessFilter = await userFiltersApi.createUserProcessInstanceFilter({
|
||||
'appId': null,
|
||||
'name': processFilter.new_icon,
|
||||
'icon': 'glyphicon-cloud',
|
||||
@@ -108,7 +110,7 @@ describe('New Process Filters', () => {
|
||||
});
|
||||
|
||||
it('[C260474] Should be able to edit a filter on APS and check it on ADF', async () => {
|
||||
await apiService.getInstance().activiti.userFiltersApi.updateUserProcessInstanceFilter(filterId, {
|
||||
await userFiltersApi.updateUserProcessInstanceFilter(filterId, {
|
||||
'appId': null,
|
||||
'name': processFilter.edited,
|
||||
'icon': 'glyphicon-random',
|
||||
@@ -121,7 +123,7 @@ describe('New Process Filters', () => {
|
||||
});
|
||||
|
||||
it('[C286451] Should display changes on a process filter when this filter icon is edited', async () => {
|
||||
customProcessFilter = await apiService.getInstance().activiti.userFiltersApi.createUserProcessInstanceFilter({
|
||||
customProcessFilter = await userFiltersApi.createUserProcessInstanceFilter({
|
||||
'appId': null,
|
||||
'name': processFilter.edit_icon,
|
||||
'icon': 'glyphicon-random',
|
||||
@@ -134,7 +136,7 @@ describe('New Process Filters', () => {
|
||||
|
||||
await processFiltersPage.checkFilterIsDisplayed(processFilter.edit_icon);
|
||||
|
||||
await apiService.getInstance().activiti.userFiltersApi.updateUserProcessInstanceFilter(filterId, {
|
||||
await userFiltersApi.updateUserProcessInstanceFilter(filterId, {
|
||||
'appId': null,
|
||||
'name': processFilter.edit_icon,
|
||||
'icon': 'glyphicon-cloud',
|
||||
@@ -166,7 +168,7 @@ describe('New Process Filters', () => {
|
||||
});
|
||||
|
||||
it('[C260475] Should be able to delete a filter on APS and check it on ADF', async () => {
|
||||
customProcessFilter = await apiService.getInstance().activiti.userFiltersApi.createUserProcessInstanceFilter({
|
||||
customProcessFilter = await userFiltersApi.createUserProcessInstanceFilter({
|
||||
'appId': null,
|
||||
'name': processFilter.deleted,
|
||||
'icon': 'glyphicon-random',
|
||||
@@ -175,7 +177,7 @@ describe('New Process Filters', () => {
|
||||
|
||||
filterId = customProcessFilter.id;
|
||||
|
||||
await apiService.getInstance().activiti.userFiltersApi.deleteUserProcessInstanceFilter(filterId);
|
||||
await userFiltersApi.deleteUserProcessInstanceFilter(filterId);
|
||||
|
||||
await (await (await navigationBarPage.navigateToProcessServicesPage()).goToTaskApp()).clickProcessButton();
|
||||
|
||||
|
||||
@@ -22,7 +22,8 @@ import {
|
||||
LoginPage,
|
||||
ProcessUtil,
|
||||
UsersActions,
|
||||
ViewerPage
|
||||
ViewerPage,
|
||||
ModelsActions
|
||||
} from '@alfresco/adf-testing';
|
||||
import { ProcessFiltersPage } from './../pages/process-filters.page';
|
||||
import { ProcessDetailsPage } from './../pages/process-details.page';
|
||||
@@ -45,6 +46,7 @@ describe('Attachment list action menu for processes', () => {
|
||||
const apiService = new ApiService();
|
||||
const usersActions = new UsersActions(apiService);
|
||||
const applicationsService = new ApplicationsUtil(apiService);
|
||||
const modelsActions = new ModelsActions(apiService);
|
||||
|
||||
const pngFile = new FileModel({
|
||||
location: browser.params.resources.Files.ADF_DOCUMENTS.PNG.file_location,
|
||||
@@ -85,9 +87,9 @@ describe('Attachment list action menu for processes', () => {
|
||||
});
|
||||
|
||||
afterAll(async () => {
|
||||
await apiService.getInstance().activiti.modelsApi.deleteModel(appId);
|
||||
await modelsActions.deleteModel(appId);
|
||||
await apiService.loginWithProfile('admin');
|
||||
await apiService.getInstance().activiti.adminTenantsApi.deleteTenant(tenantId);
|
||||
await usersActions.deleteTenant(tenantId);
|
||||
});
|
||||
|
||||
it('[C260228] Should be able to access options of a file attached to an active process', async () => {
|
||||
|
||||
@@ -29,7 +29,7 @@ import { ProcessFiltersPage } from './../pages/process-filters.page';
|
||||
import { ProcessServiceTabBarPage } from './../pages/process-service-tab-bar.page';
|
||||
import { ProcessDetailsPage } from './../pages/process-details.page';
|
||||
import { ProcessListPage } from './../pages/process-list.page';
|
||||
import { UserProcessInstanceFilterRepresentation } from '@alfresco/js-api';
|
||||
import { RuntimeAppDefinitionsApi, UserFiltersApi, UserProcessInstanceFilterRepresentation } from '@alfresco/js-api';
|
||||
import { browser } from 'protractor';
|
||||
import { ProcessListDemoPage } from './../pages/process-list-demo.page';
|
||||
import CONSTANTS = require('../../util/constants');
|
||||
@@ -51,6 +51,8 @@ describe('Process Filters Test', () => {
|
||||
const apiService = new ApiService();
|
||||
const usersActions = new UsersActions(apiService);
|
||||
const applicationsService = new ApplicationsUtil(apiService);
|
||||
const userFiltersApi = new UserFiltersApi(apiService.getInstance());
|
||||
const appsApi = new RuntimeAppDefinitionsApi(apiService.getInstance());
|
||||
|
||||
let appModel, user;
|
||||
|
||||
@@ -137,15 +139,12 @@ describe('Process Filters Test', () => {
|
||||
|
||||
it('[C280407] Should be able to access the filters with URL', async () => {
|
||||
const defaultFiltersNumber = 3;
|
||||
let deployedApp, processFilterUrl;
|
||||
let processFilterUrl;
|
||||
|
||||
const appDefinitions = await apiService.getInstance().activiti.appsApi.getAppDefinitions();
|
||||
deployedApp = appDefinitions.data.find((currentApp) => {
|
||||
return currentApp.modelId === appModel.id;
|
||||
});
|
||||
const deployedAppId = await applicationsService.getAppDefinitionId(appModel.id);
|
||||
|
||||
processFilterUrl = browser.baseUrl + '/activiti/apps/' + deployedApp.id + '/processes/';
|
||||
const taskAppFilters = await apiService.getInstance().activiti.userFiltersApi.getUserProcessInstanceFilters({ appId: deployedApp.id });
|
||||
processFilterUrl = browser.baseUrl + '/activiti/apps/' + deployedAppId + '/processes/';
|
||||
const taskAppFilters = await userFiltersApi.getUserProcessInstanceFilters({ appId: deployedAppId });
|
||||
|
||||
await processServicesPage.goToApp(app.title);
|
||||
await processServiceTabBarPage.clickProcessButton();
|
||||
@@ -194,7 +193,7 @@ describe('Process Filters Test', () => {
|
||||
await processListDemoPage.checkProcessIsDisplayed(processTitle.one);
|
||||
await processFiltersPage.checkFilterIsHighlighted(processFilter.running);
|
||||
await processDetailsPage.propertiesList.waitVisible();
|
||||
await checkProcessInfoDrawer({ name: processTitle.one });
|
||||
await checkProcessInfoDrawer({ name: processTitle.one });
|
||||
|
||||
await processFiltersPage.clickCreateProcessButton();
|
||||
await processFiltersPage.clickNewProcessDropdown();
|
||||
@@ -220,8 +219,8 @@ describe('Process Filters Test', () => {
|
||||
});
|
||||
|
||||
it('[C260384] Edit default filter', async () => {
|
||||
const runningFilter = (await getFilter()).find(filter => filter.name === 'Running');
|
||||
await apiService.getInstance().activiti.userFiltersApi
|
||||
const runningFilter = (await getFilter()).find(filter => filter.name === 'Running');
|
||||
await userFiltersApi
|
||||
.updateUserProcessInstanceFilter(runningFilter.id, { ...runningFilter, name: 'Edited Running' });
|
||||
|
||||
await processServicesPage.goToApp(app.title);
|
||||
@@ -231,8 +230,8 @@ describe('Process Filters Test', () => {
|
||||
});
|
||||
|
||||
it('[C260385] Delete default filter', async () => {
|
||||
const allFilter = (await getFilter()).find(filter => filter.name === 'All');
|
||||
await apiService.getInstance().activiti.userFiltersApi.deleteUserProcessInstanceFilter(allFilter.id);
|
||||
const allFilter = (await getFilter()).find(filter => filter.name === 'All');
|
||||
await userFiltersApi.deleteUserProcessInstanceFilter(allFilter.id);
|
||||
|
||||
await processServicesPage.goToApp(app.title);
|
||||
await processServiceTabBarPage.clickProcessButton();
|
||||
@@ -240,9 +239,10 @@ describe('Process Filters Test', () => {
|
||||
});
|
||||
|
||||
async function getFilter(): Promise<UserProcessInstanceFilterRepresentation[]> {
|
||||
const apps = await apiService.getInstance().activiti.appsApi.getAppDefinitions();
|
||||
const apps = await appsApi.getAppDefinitions();
|
||||
const { id: appId = 0 } = apps.data.find((application) => application.name === appModel.name);
|
||||
const filters = await apiService.getInstance().activiti.userFiltersApi.getUserProcessInstanceFilters({ appId });
|
||||
|
||||
const filters = await userFiltersApi.getUserProcessInstanceFilters({ appId });
|
||||
return filters.data;
|
||||
}
|
||||
|
||||
|
||||
@@ -16,13 +16,21 @@
|
||||
*/
|
||||
|
||||
import { browser } from 'protractor';
|
||||
import { ApiService, ApplicationsUtil, LoginPage, ProcessUtil, UsersActions } from '@alfresco/adf-testing';
|
||||
import {
|
||||
ApiService,
|
||||
ApplicationsUtil,
|
||||
LoginPage,
|
||||
ModelsActions,
|
||||
ProcessUtil,
|
||||
UsersActions
|
||||
} from '@alfresco/adf-testing';
|
||||
import { ProcessServicesPage } from './../pages/process-services.page';
|
||||
import { NavigationBarPage } from '../../core/pages/navigation-bar.page';
|
||||
import { ProcessServiceTabBarPage } from './../pages/process-service-tab-bar.page';
|
||||
import { ProcessListPage } from './../pages/process-list.page';
|
||||
import { ProcessDetailsPage } from './../pages/process-details.page';
|
||||
import moment = require('moment');
|
||||
import { ProcessInstancesApi } from '@alfresco/js-api';
|
||||
|
||||
describe('Process Instance Details', () => {
|
||||
|
||||
@@ -38,6 +46,8 @@ describe('Process Instance Details', () => {
|
||||
const apiService = new ApiService();
|
||||
const usersActions = new UsersActions(apiService);
|
||||
const applicationsService = new ApplicationsUtil(apiService);
|
||||
const modelsActions = new ModelsActions(apiService);
|
||||
const processApi = new ProcessInstancesApi(apiService.getInstance());
|
||||
|
||||
let appModel, process, user;
|
||||
const PROCESS_DATE_FORMAT = 'll';
|
||||
@@ -60,13 +70,13 @@ describe('Process Instance Details', () => {
|
||||
await processServiceTabBarPage.clickProcessButton();
|
||||
await expect(await processListPage.isProcessListDisplayed()).toEqual(true);
|
||||
|
||||
process = await apiService.getInstance().activiti.processApi.getProcessInstance(processModel.id);
|
||||
process = await processApi.getProcessInstance(processModel.id);
|
||||
});
|
||||
|
||||
afterAll(async () => {
|
||||
await apiService.getInstance().activiti.modelsApi.deleteModel(appModel.id);
|
||||
await modelsActions.deleteModel(appModel.id);
|
||||
await apiService.loginWithProfile('admin');
|
||||
await apiService.getInstance().activiti.adminTenantsApi.deleteTenant(user.tenantId);
|
||||
await usersActions.deleteTenant(user.tenantId);
|
||||
});
|
||||
|
||||
it('[C307031] Should display the created date in the default format', async () => {
|
||||
|
||||
@@ -19,12 +19,13 @@ import {
|
||||
ApiService,
|
||||
ApplicationsUtil,
|
||||
BrowserActions,
|
||||
LoginPage,
|
||||
LoginPage, ModelsActions,
|
||||
ProcessUtil,
|
||||
UsersActions
|
||||
} from '@alfresco/adf-testing';
|
||||
import { ProcessListDemoPage } from './../pages/process-list-demo.page';
|
||||
import { browser } from 'protractor';
|
||||
import { TaskFormsApi } from '@alfresco/js-api';
|
||||
|
||||
describe('Process List Test', () => {
|
||||
|
||||
@@ -37,6 +38,8 @@ describe('Process List Test', () => {
|
||||
const apiService = new ApiService();
|
||||
const applicationsUtil = new ApplicationsUtil(apiService);
|
||||
const usersActions = new UsersActions(apiService);
|
||||
const modelsActions = new ModelsActions(apiService);
|
||||
const taskFormsApi = new TaskFormsApi(apiService.getInstance());
|
||||
|
||||
let appDateModel, appUserWidgetModel, user;
|
||||
|
||||
@@ -81,19 +84,19 @@ describe('Process List Test', () => {
|
||||
|
||||
const procWithUserWidgetTaskId = await processUtil.getProcessTaskId(completedProcWithUserWidget.id);
|
||||
|
||||
await apiService.getInstance().activiti.taskApi.completeTaskForm(procWithDateTaskId.id, { values: { label: null } });
|
||||
await apiService.getInstance().activiti.taskFormsApi.completeTaskForm(procWithUserWidgetTaskId.id, { values: { label: null } });
|
||||
await taskFormsApi.completeTaskForm(procWithDateTaskId.id, { values: { label: null } });
|
||||
await taskFormsApi.completeTaskForm(procWithUserWidgetTaskId.id, { values: { label: null } });
|
||||
|
||||
await loginPage.login(user.username, user.password);
|
||||
});
|
||||
|
||||
afterAll(async () => {
|
||||
await apiService.getInstance().activiti.modelsApi.deleteModel(appDateModel.id);
|
||||
await apiService.getInstance().activiti.modelsApi.deleteModel(appUserWidgetModel.id);
|
||||
await modelsActions.deleteModel(appDateModel.id);
|
||||
await modelsActions.deleteModel(appUserWidgetModel.id);
|
||||
|
||||
await apiService.loginWithProfile('admin');
|
||||
|
||||
await apiService.getInstance().activiti.adminTenantsApi.deleteTenant(user.tenantId);
|
||||
await usersActions.deleteTenant(user.tenantId);
|
||||
});
|
||||
|
||||
beforeEach(async () => {
|
||||
|
||||
@@ -21,7 +21,7 @@ import {
|
||||
ApplicationsUtil, BrowserActions,
|
||||
FileBrowserUtil,
|
||||
LocalStorageUtil,
|
||||
LoginPage,
|
||||
LoginPage, ModelsActions,
|
||||
ProcessInstanceTasksPage,
|
||||
SelectAppsDialog,
|
||||
StartProcessPage,
|
||||
@@ -40,6 +40,7 @@ import { ProcessServicesPage } from './../pages/process-services.page';
|
||||
import { ProcessServiceTabBarPage } from './../pages/process-service-tab-bar.page';
|
||||
import { ContentServicesPage } from '../../core/pages/content-services.page';
|
||||
import { UploadDialogPage } from '../../core/pages/dialog/upload-dialog.page';
|
||||
import { ProcessInstancesApi } from '@alfresco/js-api';
|
||||
|
||||
describe('Start Process Component', () => {
|
||||
|
||||
@@ -63,6 +64,9 @@ describe('Start Process Component', () => {
|
||||
|
||||
const apiService = new ApiService();
|
||||
const apiServiceUserTwo = new ApiService();
|
||||
const modelsActions = new ModelsActions(apiService);
|
||||
const usersActions = new UsersActions(apiService);
|
||||
const processApi = new ProcessInstancesApi(apiService.getInstance());
|
||||
|
||||
let procUserModel: UserModel;
|
||||
let secondProcUserModel: UserModel;
|
||||
@@ -85,7 +89,6 @@ describe('Start Process Component', () => {
|
||||
beforeAll(async () => {
|
||||
await apiService.loginWithProfile('admin');
|
||||
|
||||
const usersActions = new UsersActions(apiService);
|
||||
procUserModel = await usersActions.createUser();
|
||||
secondProcUserModel = await usersActions.createUser(new UserModel({ tenantId: procUserModel.tenantId }));
|
||||
|
||||
@@ -99,10 +102,10 @@ describe('Start Process Component', () => {
|
||||
|
||||
afterAll(async () => {
|
||||
await apiService.loginWithProfile('admin');
|
||||
await apiServiceUserTwo.getInstance().activiti.modelsApi.deleteModel(appCreated.id);
|
||||
await apiServiceUserTwo.getInstance().activiti.modelsApi.deleteModel(simpleAppCreated.id);
|
||||
await apiServiceUserTwo.getInstance().activiti.modelsApi.deleteModel(dateFormAppCreated.id);
|
||||
await apiService.getInstance().activiti.adminTenantsApi.deleteTenant(procUserModel.tenantId);
|
||||
await modelsActions.deleteModel(appCreated.id);
|
||||
await modelsActions.deleteModel(simpleAppCreated.id);
|
||||
await modelsActions.deleteModel(dateFormAppCreated.id);
|
||||
await usersActions.deleteTenant(procUserModel.tenantId);
|
||||
});
|
||||
|
||||
describe(' Once logged with user without apps', () => {
|
||||
@@ -205,7 +208,7 @@ describe('Start Process Component', () => {
|
||||
await processDetailsPage.checkProcessHeaderDetailsAreVisible();
|
||||
|
||||
const processId = await processDetailsPage.getId();
|
||||
const response = await apiService.getInstance().activiti.processApi.getProcessInstance(processId);
|
||||
const response = await processApi.getProcessInstance(processId);
|
||||
|
||||
await expect(await processDetailsPage.getProcessStatus()).toEqual(CONSTANTS.PROCESS_STATUS.RUNNING);
|
||||
await expect(await processDetailsPage.getEndDate()).toEqual(CONSTANTS.PROCESS_END_DATE);
|
||||
@@ -485,11 +488,11 @@ describe('Start Process Component', () => {
|
||||
hostBpm: browser.params.testConfig.appConfig.bpmHost
|
||||
});
|
||||
|
||||
const usersActions = new UsersActions(apiServiceAll);
|
||||
const usersActionsAll = new UsersActions(apiServiceAll);
|
||||
|
||||
await apiServiceAll.login(browser.params.testConfig.users.admin.username, browser.params.testConfig.users.admin.password);
|
||||
|
||||
processUserModel = await usersActions.createUser();
|
||||
processUserModel = await usersActionsAll.createUser();
|
||||
|
||||
const alfrescoJsBPMAdminUser = new ApiService({ hostBpm: browser.params.testConfig.appConfig.bpmHost });
|
||||
|
||||
|
||||
@@ -17,12 +17,19 @@
|
||||
|
||||
import { browser } from 'protractor';
|
||||
|
||||
import { ApiService, ApplicationsUtil, LoginPage, UserModel, UsersActions } from '@alfresco/adf-testing';
|
||||
import {
|
||||
ApiService,
|
||||
ApplicationsUtil,
|
||||
LoginPage,
|
||||
ModelsActions,
|
||||
TaskUtil,
|
||||
UserModel,
|
||||
UsersActions
|
||||
} from '@alfresco/adf-testing';
|
||||
import { TasksPage } from './../pages/tasks.page';
|
||||
import { CommentsPage } from '../../core/pages/comments.page';
|
||||
import { NavigationBarPage } from '../../core/pages/navigation-bar.page';
|
||||
|
||||
import { TaskRepresentation } from '@alfresco/js-api';
|
||||
import { ActivitiCommentsApi, TaskActionsApi } from '@alfresco/js-api';
|
||||
import CONSTANTS = require('../../util/constants');
|
||||
|
||||
describe('Comment component for Processes', () => {
|
||||
@@ -36,6 +43,10 @@ describe('Comment component for Processes', () => {
|
||||
|
||||
const apiService = new ApiService();
|
||||
const usersActions = new UsersActions(apiService);
|
||||
const taskUtil = new TaskUtil(apiService);
|
||||
const modelsActions = new ModelsActions(apiService);
|
||||
const activitiCommentsApi = new ActivitiCommentsApi(apiService.getInstance());
|
||||
const taskActionsApi = new TaskActionsApi(apiService.getInstance());
|
||||
|
||||
let user, appId, secondUser;
|
||||
|
||||
@@ -59,17 +70,17 @@ describe('Comment component for Processes', () => {
|
||||
});
|
||||
|
||||
afterAll(async () => {
|
||||
await apiService.getInstance().activiti.modelsApi.deleteModel(appId);
|
||||
await modelsActions.deleteModel(appId);
|
||||
await apiService.loginWithProfile('admin');
|
||||
await apiService.getInstance().activiti.adminTenantsApi.deleteTenant(user.tenantId);
|
||||
await usersActions.deleteTenant(user.tenantId);
|
||||
});
|
||||
|
||||
it('[C260237] Should not be able to add a comment on a completed task', async () => {
|
||||
const newTask = await apiService.getInstance().activiti.taskApi.createNewTask(new TaskRepresentation({ name: taskName.completed_task }));
|
||||
const newTask = await taskUtil.createStandaloneTask(taskName.completed_task);
|
||||
|
||||
const taskId = newTask.id;
|
||||
|
||||
await apiService.getInstance().activiti.taskActionsApi.completeTask(taskId);
|
||||
await taskActionsApi.completeTask(taskId);
|
||||
|
||||
await (await (await navigationBarPage.navigateToProcessServicesPage()).goToTaskApp()).clickTasksButton();
|
||||
|
||||
@@ -80,15 +91,15 @@ describe('Comment component for Processes', () => {
|
||||
});
|
||||
|
||||
it('[C212864] Should be able to add multiple comments on a single task using different users', async () => {
|
||||
const newTask = await apiService.getInstance().activiti.taskApi.createNewTask(new TaskRepresentation({ name: taskName.multiple_users }));
|
||||
const newTask = await taskUtil.createStandaloneTask(taskName.multiple_users);
|
||||
|
||||
await apiService.getInstance().activiti.taskApi.involveUser(newTask.id, { email: secondUser.email });
|
||||
await taskActionsApi.involveUser(newTask.id, { email: secondUser.email });
|
||||
|
||||
const taskComment = { message: 'Task Comment' };
|
||||
const secondTaskComment = { message: 'Second Task Comment' };
|
||||
|
||||
await apiService.getInstance().activiti.taskApi.addTaskComment(taskComment, newTask.id);
|
||||
await apiService.getInstance().activiti.taskApi.addTaskComment(secondTaskComment, newTask.id);
|
||||
await activitiCommentsApi.addTaskComment(taskComment, newTask.id);
|
||||
await activitiCommentsApi.addTaskComment(secondTaskComment, newTask.id);
|
||||
|
||||
await (await (await navigationBarPage.navigateToProcessServicesPage()).goToTaskApp()).clickTasksButton();
|
||||
|
||||
@@ -96,7 +107,7 @@ describe('Comment component for Processes', () => {
|
||||
await taskPage.tasksListPage().selectRow(taskName.multiple_users);
|
||||
await taskPage.taskDetails().selectActivityTab();
|
||||
|
||||
const totalCommentsLatest = await apiService.getInstance().activiti.taskApi.getTaskComments(newTask.id, { 'latestFirst': true });
|
||||
const totalCommentsLatest = await activitiCommentsApi.getTaskComments(newTask.id, { 'latestFirst': true });
|
||||
|
||||
const thirdTaskComment = { message: 'Third Task Comment' };
|
||||
|
||||
@@ -117,7 +128,7 @@ describe('Comment component for Processes', () => {
|
||||
await navigationBarPage.clickLogoutButton();
|
||||
await loginPage.login(secondUser.username, secondUser.password);
|
||||
|
||||
await apiService.getInstance().activiti.taskApi.addTaskComment(thirdTaskComment, newTask.id);
|
||||
await activitiCommentsApi.addTaskComment(thirdTaskComment, newTask.id);
|
||||
|
||||
await (await (await navigationBarPage.navigateToProcessServicesPage()).goToTaskApp()).clickTasksButton();
|
||||
|
||||
@@ -125,7 +136,7 @@ describe('Comment component for Processes', () => {
|
||||
await taskPage.tasksListPage().selectRow(taskName.multiple_users);
|
||||
await taskPage.taskDetails().selectActivityTab();
|
||||
|
||||
const totalComments = await apiService.getInstance().activiti.taskApi.getTaskComments(newTask.id, { 'latestFirst': true });
|
||||
const totalComments = await activitiCommentsApi.getTaskComments(newTask.id, { 'latestFirst': true });
|
||||
|
||||
await commentsPage.checkUserIconIsDisplayed();
|
||||
await commentsPage.checkUserIconIsDisplayed();
|
||||
|
||||
@@ -22,14 +22,13 @@ import {
|
||||
DateUtil,
|
||||
LoginPage,
|
||||
PaginationPage,
|
||||
ProcessUtil,
|
||||
ProcessUtil, TaskUtil,
|
||||
UsersActions
|
||||
} from '@alfresco/adf-testing';
|
||||
import { browser } from 'protractor';
|
||||
import { AppsRuntimeActions } from '../../actions/APS/apps-runtime.actions';
|
||||
import { TaskListDemoPage } from './../pages/task-list-demo.page';
|
||||
import { NavigationBarPage } from '../../core/pages/navigation-bar.page';
|
||||
import { TaskRepresentation } from '@alfresco/js-api';
|
||||
import { TaskActionsApi, TaskRepresentation, TasksApi } from '@alfresco/js-api';
|
||||
import moment = require('moment');
|
||||
|
||||
describe('Start Task - Custom App', () => {
|
||||
@@ -43,10 +42,13 @@ describe('Start Task - Custom App', () => {
|
||||
const paginationPage = new PaginationPage();
|
||||
|
||||
const apiService = new ApiService();
|
||||
const appsRuntime = new AppsRuntimeActions(apiService);
|
||||
const appsRuntime = new ApplicationsUtil(apiService);
|
||||
const usersActions = new UsersActions(apiService);
|
||||
const applicationsService = new ApplicationsUtil(apiService);
|
||||
const processUtil = new ProcessUtil(apiService);
|
||||
const taskUtil = new TaskUtil(apiService);
|
||||
const taskActionsApi = new TaskActionsApi(apiService.getInstance());
|
||||
const tasksApi = new TasksApi(apiService.getInstance());
|
||||
|
||||
let processUserModel;
|
||||
let appRuntime, secondAppRuntime;
|
||||
@@ -89,11 +91,11 @@ describe('Start Task - Custom App', () => {
|
||||
|
||||
appModel = await applicationsService.importPublishDeployApp(app.file_path);
|
||||
|
||||
appRuntime = await appsRuntime.getRuntimeAppByName(app.title);
|
||||
appRuntime = await appsRuntime.getAppDefinitionByName(app.title);
|
||||
|
||||
await applicationsService.importPublishDeployApp(secondApp.file_path);
|
||||
|
||||
secondAppRuntime = await appsRuntime.getRuntimeAppByName(secondApp.title);
|
||||
secondAppRuntime = await appsRuntime.getAppDefinitionByName(secondApp.title);
|
||||
|
||||
processDefinitionId = await processUtil.startProcessOfApp(appModel.name);
|
||||
await processUtil.startProcessOfApp(appModel.name);
|
||||
@@ -101,18 +103,18 @@ describe('Start Task - Custom App', () => {
|
||||
await processUtil.startProcessOfApp(appModel.name);
|
||||
|
||||
for (let i = 1; i < paginationTasksName.length; i++) {
|
||||
await apiService.getInstance().activiti.taskApi.createNewTask(new TaskRepresentation({ 'name': paginationTasksName[i] }));
|
||||
await taskUtil.createStandaloneTask(paginationTasksName[i]);
|
||||
}
|
||||
|
||||
for (let i = 0; i < 3; i++) {
|
||||
completedTasks[i] = await apiService.getInstance().activiti.taskApi.createNewTask(new TaskRepresentation({
|
||||
completedTasks[i] = await tasksApi.createNewTask(new TaskRepresentation({
|
||||
'name': completedTasksName[i],
|
||||
'dueDate': DateUtil.formatDate('YYYY-MM-DDTHH:mm:ss.SSSZ', new Date(), i + 2)
|
||||
}));
|
||||
await apiService.getInstance().activiti.taskActionsApi.completeTask(completedTasks[i].id);
|
||||
await taskActionsApi.completeTask(completedTasks[i].id);
|
||||
}
|
||||
|
||||
taskWithDueDate = await apiService.getInstance().activiti.taskApi.createNewTask(new TaskRepresentation({
|
||||
taskWithDueDate = await tasksApi.createNewTask(new TaskRepresentation({
|
||||
'name': paginationTasksName[0],
|
||||
'dueDate': currentDateStandardFormat
|
||||
}));
|
||||
|
||||
@@ -21,7 +21,7 @@ import {
|
||||
BrowserActions,
|
||||
BrowserVisibility,
|
||||
LocalStorageUtil,
|
||||
LoginPage,
|
||||
LoginPage, ModelsActions,
|
||||
StringUtil,
|
||||
UserModel,
|
||||
UsersActions
|
||||
@@ -47,6 +47,8 @@ describe('Info Drawer', () => {
|
||||
|
||||
const apiService = new ApiService();
|
||||
const applicationsService = new ApplicationsUtil(apiService);
|
||||
const modelsActions = new ModelsActions(apiService);
|
||||
const usersActions = new UsersActions(apiService);
|
||||
|
||||
const firstComment = 'comm1';
|
||||
|
||||
@@ -72,8 +74,6 @@ describe('Info Drawer', () => {
|
||||
let processUserModel;
|
||||
|
||||
beforeAll(async () => {
|
||||
const usersActions = new UsersActions(apiService);
|
||||
|
||||
await apiService.loginWithProfile('admin');
|
||||
|
||||
const assigneeUserModel = await usersActions.createUser();
|
||||
@@ -89,9 +89,9 @@ describe('Info Drawer', () => {
|
||||
});
|
||||
|
||||
afterAll(async () => {
|
||||
await apiService.getInstance().activiti.modelsApi.deleteModel(appCreated.id);
|
||||
await modelsActions.deleteModel(appCreated.id);
|
||||
await apiService.loginWithProfile('admin');
|
||||
await apiService.getInstance().activiti.adminTenantsApi.deleteTenant(processUserModel.tenantId);
|
||||
await usersActions.deleteTenant(processUserModel.tenantId);
|
||||
});
|
||||
|
||||
beforeEach(async () => {
|
||||
|
||||
@@ -20,13 +20,12 @@ import {
|
||||
ApplicationsUtil,
|
||||
LoginPage,
|
||||
PaginationPage,
|
||||
StringUtil,
|
||||
StringUtil, TaskUtil,
|
||||
UsersActions
|
||||
} from '@alfresco/adf-testing';
|
||||
import { browser } from 'protractor';
|
||||
import { NavigationBarPage } from '../../core/pages/navigation-bar.page';
|
||||
import { TasksPage } from './../pages/tasks.page';
|
||||
import { TaskRepresentation } from '@alfresco/js-api';
|
||||
import CONSTANTS = require('../../util/constants');
|
||||
|
||||
describe('Task List Pagination - Sorting', () => {
|
||||
@@ -40,6 +39,7 @@ describe('Task List Pagination - Sorting', () => {
|
||||
const apiService = new ApiService();
|
||||
const usersActions = new UsersActions(apiService);
|
||||
const applicationsService = new ApplicationsUtil(apiService);
|
||||
const taskUtil = new TaskUtil(apiService);
|
||||
|
||||
const nrOfTasks = 20;
|
||||
let processUserModel;
|
||||
@@ -65,11 +65,11 @@ describe('Task List Pagination - Sorting', () => {
|
||||
await applicationsService.importPublishDeployApp(app.file_path);
|
||||
|
||||
for (let i = 0; i < nrOfTasks; i++) {
|
||||
await apiService.getInstance().activiti.taskApi.createNewTask(new TaskRepresentation({ name: taskNames[i] }));
|
||||
await taskUtil.createStandaloneTask(taskNames[i]);
|
||||
}
|
||||
|
||||
await loginPage.login(processUserModel.username, processUserModel.password);
|
||||
});
|
||||
});
|
||||
|
||||
it('[C260308] Should be possible to sort tasks by name', async () => {
|
||||
await (await new NavigationBarPage().navigateToProcessServicesPage()).goToTaskApp();
|
||||
@@ -79,13 +79,12 @@ describe('Task List Pagination - Sorting', () => {
|
||||
await taskPage.tasksListPage().getDataTable().waitForTableBody();
|
||||
await taskPage.filtersPage().sortByName('ASC');
|
||||
await taskPage.tasksListPage().getDataTable().waitForTableBody();
|
||||
await taskPage.filtersPage().getAllRowsNameColumn().then(async (list) => {
|
||||
await expect(JSON.stringify(list) === JSON.stringify(taskNames)).toEqual(true);
|
||||
});
|
||||
const listAsc = await taskPage.filtersPage().getAllRowsNameColumn();
|
||||
await expect(JSON.stringify(listAsc) === JSON.stringify(taskNames)).toEqual(true);
|
||||
await taskPage.filtersPage().sortByName('DESC');
|
||||
await taskPage.filtersPage().getAllRowsNameColumn().then(async (list) => {
|
||||
taskNames.reverse();
|
||||
await expect(JSON.stringify(list) === JSON.stringify(taskNames)).toEqual(true);
|
||||
});
|
||||
const listDesc = await taskPage.filtersPage().getAllRowsNameColumn();
|
||||
|
||||
taskNames.reverse();
|
||||
await expect(JSON.stringify(listDesc) === JSON.stringify(taskNames)).toEqual(true);
|
||||
});
|
||||
});
|
||||
|
||||
@@ -17,13 +17,12 @@
|
||||
|
||||
import { browser } from 'protractor';
|
||||
|
||||
import { ApiService, LoginPage, UsersActions } from '@alfresco/adf-testing';
|
||||
import { ApiService, ApplicationsUtil, LoginPage, UsersActions } from '@alfresco/adf-testing';
|
||||
import { TasksPage } from './../pages/tasks.page';
|
||||
import { NavigationBarPage } from '../../core/pages/navigation-bar.page';
|
||||
import * as fs from 'fs';
|
||||
import * as path from 'path';
|
||||
import CONSTANTS = require('../../util/constants');
|
||||
import Task = require('../../models/APS/Task');
|
||||
import { TaskActionsApi, TasksApi } from '@alfresco/js-api';
|
||||
|
||||
describe('Start Task - Task App', () => {
|
||||
|
||||
@@ -34,24 +33,21 @@ describe('Start Task - Task App', () => {
|
||||
const taskPage = new TasksPage();
|
||||
|
||||
let processUserModel;
|
||||
const tasks = ['Standalone task', 'Completed standalone task', 'Add a form', 'Remove form'];
|
||||
const noFormMessage = 'No forms attached';
|
||||
|
||||
const apiService = new ApiService();
|
||||
const usersActions = new UsersActions(apiService);
|
||||
const applicationUtil = new ApplicationsUtil(apiService);
|
||||
const tasksApi = new TasksApi(apiService.getInstance());
|
||||
const taskActionsApi = new TaskActionsApi(apiService.getInstance());
|
||||
|
||||
beforeAll(async () => {
|
||||
|
||||
await apiService.loginWithProfile('admin');
|
||||
|
||||
processUserModel = await usersActions.createUser();
|
||||
|
||||
const pathFile = path.join(browser.params.testConfig.main.rootPath + app.file_location);
|
||||
const file = fs.createReadStream(pathFile);
|
||||
|
||||
await apiService.login(processUserModel.username, processUserModel.password);
|
||||
|
||||
await apiService.getInstance().activiti.appsApi.importAppDefinition(file);
|
||||
await applicationUtil.importApplication(app.file_path);
|
||||
|
||||
await loginPage.login(processUserModel.username, processUserModel.password);
|
||||
});
|
||||
@@ -64,9 +60,9 @@ describe('Start Task - Task App', () => {
|
||||
|
||||
it('[C260421] Should a standalone task be displayed when creating a new task without form', async () => {
|
||||
const task = await taskPage.createNewTask();
|
||||
await task.addName(tasks[0]);
|
||||
await task.addName('Standalone task');
|
||||
await task.clickStartButton();
|
||||
await taskPage.tasksListPage().checkContentIsDisplayed(tasks[0]);
|
||||
await taskPage.tasksListPage().checkContentIsDisplayed('Standalone task');
|
||||
await taskPage.taskDetails().noFormIsDisplayed();
|
||||
|
||||
const taskDetails = await taskPage.taskDetails();
|
||||
@@ -80,15 +76,16 @@ describe('Start Task - Task App', () => {
|
||||
|
||||
it('[C268910] Should a standalone task be displayed in completed tasks when completing it', async () => {
|
||||
const task = await taskPage.createNewTask();
|
||||
await task.addName(tasks[1]);
|
||||
await task.addName('Completed standalone task');
|
||||
await task.clickStartButton();
|
||||
await taskPage.tasksListPage().checkContentIsDisplayed(tasks[1]);
|
||||
|
||||
await taskPage.tasksListPage().checkContentIsDisplayed('Completed standalone task');
|
||||
await taskPage.formFields().noFormIsDisplayed();
|
||||
|
||||
await taskPage.completeTaskNoForm();
|
||||
await taskPage.filtersPage().goToFilter(CONSTANTS.TASK_FILTERS.COMPLETED_TASKS);
|
||||
await taskPage.tasksListPage().selectRow(tasks[1]);
|
||||
await expect(await taskPage.formFields().getCompletedTaskNoFormMessage()).toEqual('Task ' + tasks[1] + ' completed');
|
||||
await taskPage.tasksListPage().selectRow('Completed standalone task');
|
||||
await expect(await taskPage.formFields().getCompletedTaskNoFormMessage()).toEqual('Task ' + 'Completed standalone task' + ' completed');
|
||||
|
||||
await taskPage.formFields().noFormIsDisplayed();
|
||||
await taskPage.taskDetails().waitFormNameEqual(CONSTANTS.TASK_DETAILS.NO_FORM);
|
||||
@@ -96,10 +93,10 @@ describe('Start Task - Task App', () => {
|
||||
|
||||
it('[C268911] Should allow adding a form to a standalone task when clicking on Add form button', async () => {
|
||||
const task = await taskPage.createNewTask();
|
||||
await task.addName(tasks[2]);
|
||||
await task.addName('Add a form');
|
||||
await task.clickStartButton();
|
||||
|
||||
await taskPage.tasksListPage().checkContentIsDisplayed(tasks[2]);
|
||||
await taskPage.tasksListPage().checkContentIsDisplayed('Add a form');
|
||||
await taskPage.formFields().noFormIsDisplayed();
|
||||
await taskPage.taskDetails().clickAttachFormButton();
|
||||
|
||||
@@ -116,19 +113,19 @@ describe('Start Task - Task App', () => {
|
||||
it('[C268912] Should a standalone task be displayed when removing the form from APS', async () => {
|
||||
const task = await taskPage.createNewTask();
|
||||
const taskDetails = await taskPage.taskDetails();
|
||||
await task.addName(tasks[3]);
|
||||
await task.addName('Remove form');
|
||||
await task.selectForm(app.formName);
|
||||
await task.clickStartButton();
|
||||
|
||||
await taskPage.tasksListPage().checkContentIsDisplayed(tasks[3]);
|
||||
await taskPage.tasksListPage().checkContentIsDisplayed('Remove form');
|
||||
await taskPage.taskDetails().waitFormNameEqual(app.formName);
|
||||
|
||||
const listOfTasks = await apiService.getInstance().activiti.taskApi.listTasks(new Task({ sort: 'created-desc' }));
|
||||
await apiService.getInstance().activiti.taskApi.removeForm(listOfTasks.data[0].id);
|
||||
const listOfTasks = await tasksApi.listTasks(new Task({ sort: 'created-desc' }));
|
||||
await taskActionsApi.removeForm(listOfTasks.data[0].id);
|
||||
|
||||
await browser.refresh();
|
||||
await taskPage.tasksListPage().checkContentIsDisplayed(tasks[3]);
|
||||
await taskPage.checkTaskTitle(tasks[3]);
|
||||
await taskPage.tasksListPage().checkContentIsDisplayed('Remove form');
|
||||
await taskPage.checkTaskTitle('Remove form');
|
||||
|
||||
await taskPage.formFields().noFormIsDisplayed();
|
||||
await taskPage.taskDetails().waitFormNameEqual(CONSTANTS.TASK_DETAILS.NO_FORM);
|
||||
|
||||
@@ -15,7 +15,15 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { ApiService, LoginPage, StringUtil, UserModel, UsersActions } from '@alfresco/adf-testing';
|
||||
import {
|
||||
ApiService,
|
||||
ApplicationsUtil,
|
||||
LoginPage,
|
||||
StringUtil,
|
||||
TaskUtil,
|
||||
UserModel,
|
||||
UsersActions
|
||||
} from '@alfresco/adf-testing';
|
||||
import { browser, by } from 'protractor';
|
||||
import { FileModel } from '../../models/ACS/file.model';
|
||||
import { NavigationBarPage } from '../../core/pages/navigation-bar.page';
|
||||
@@ -23,9 +31,6 @@ import { AttachmentListPage } from './../pages/attachment-list.page';
|
||||
import { ChecklistDialog } from './../pages/dialog/create-checklist-dialog.page';
|
||||
import { ProcessServiceTabBarPage } from './../pages/process-service-tab-bar.page';
|
||||
import { TasksPage } from './../pages/tasks.page';
|
||||
import * as fs from 'fs';
|
||||
import * as path from 'path';
|
||||
import { TaskRepresentation } from '@alfresco/js-api';
|
||||
import CONSTANTS = require('../../util/constants');
|
||||
|
||||
describe('Start Task - Task App', () => {
|
||||
@@ -39,6 +44,8 @@ describe('Start Task - Task App', () => {
|
||||
|
||||
const apiService = new ApiService();
|
||||
const usersActions = new UsersActions(apiService);
|
||||
const taskUtil = new TaskUtil(apiService);
|
||||
const applicationsUtil = new ApplicationsUtil(apiService);
|
||||
|
||||
let processUserModel, assigneeUserModel;
|
||||
const formTextField = app.form_fields.form_fieldId;
|
||||
@@ -62,14 +69,11 @@ describe('Start Task - Task App', () => {
|
||||
|
||||
processUserModel = await usersActions.createUser(new UserModel({ tenantId: assigneeUserModel.tenantId }));
|
||||
|
||||
const pathFile = path.join(browser.params.testConfig.main.rootPath + app.file_location);
|
||||
const file = fs.createReadStream(pathFile);
|
||||
|
||||
await apiService.login(processUserModel.username, processUserModel.password);
|
||||
|
||||
await apiService.getInstance().activiti.appsApi.importAppDefinition(file);
|
||||
await applicationsUtil.importApplication(app.file_path);
|
||||
|
||||
await apiService.getInstance().activiti.taskApi.createNewTask(new TaskRepresentation({ name: showHeaderTask }));
|
||||
await taskUtil.createStandaloneTask(showHeaderTask);
|
||||
|
||||
await loginPage.login(processUserModel.username, processUserModel.password);
|
||||
});
|
||||
|
||||
@@ -33,6 +33,7 @@ import { ProcessListPage } from './../pages/process-list.page';
|
||||
import { browser } from 'protractor';
|
||||
import { TasksPage } from './../pages/tasks.page';
|
||||
import CONSTANTS = require('../../util/constants');
|
||||
import { AdminGroupsApi } from '@alfresco/js-api';
|
||||
|
||||
describe('Task Assignee', () => {
|
||||
|
||||
@@ -51,6 +52,7 @@ describe('Task Assignee', () => {
|
||||
const apiService = new ApiService();
|
||||
const usersActions = new UsersActions(apiService);
|
||||
const applicationsService = new ApplicationsUtil(apiService);
|
||||
const adminGroupsApi = new AdminGroupsApi(apiService.getInstance());
|
||||
|
||||
describe('Candidate User Assignee', () => {
|
||||
|
||||
@@ -65,7 +67,7 @@ describe('Task Assignee', () => {
|
||||
}));
|
||||
|
||||
try {// creates group if not available
|
||||
await apiService.getInstance().activiti.adminGroupsApi.createNewGroup({
|
||||
await adminGroupsApi.createNewGroup({
|
||||
'name': app.candidateGroup,
|
||||
'tenantId': user.tenantId,
|
||||
'type': 1
|
||||
@@ -81,7 +83,7 @@ describe('Task Assignee', () => {
|
||||
|
||||
afterAll(async () => {
|
||||
await apiService.loginWithProfile('admin');
|
||||
await apiService.getInstance().activiti.adminTenantsApi.deleteTenant(user.tenantId);
|
||||
await usersActions.deleteTenant(user.tenantId);
|
||||
await navigationBarPage.clickLogoutButton();
|
||||
});
|
||||
|
||||
@@ -132,21 +134,21 @@ describe('Task Assignee', () => {
|
||||
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(
|
||||
const adminGroup = await adminGroupsApi.createNewGroup(
|
||||
{ 'name': app.adminGroup, 'tenantId': user.tenantId }
|
||||
);
|
||||
|
||||
await apiService.getInstance().activiti.adminGroupsApi.addGroupMember(adminGroup.id, user.id);
|
||||
await adminGroupsApi.addGroupMember(adminGroup.id, user.id);
|
||||
|
||||
await apiService.getInstance().activiti.adminGroupsApi.addGroupCapabilities(adminGroup.id, { capabilities: app.adminCapabilities });
|
||||
await adminGroupsApi.addGroupCapabilities(adminGroup.id, { capabilities: app.adminCapabilities });
|
||||
|
||||
const candidateGroup = await apiService.getInstance().activiti.adminGroupsApi.createNewGroup(
|
||||
const candidateGroup = await 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);
|
||||
await adminGroupsApi.addGroupMember(candidateGroup.id, candidate1.id);
|
||||
await adminGroupsApi.addGroupMember(candidateGroup.id, candidate2.id);
|
||||
await adminGroupsApi.addGroupMember(candidateGroup.id, user.id);
|
||||
|
||||
try {// for creates user if not available
|
||||
await usersActions.createUser(new UserModel({
|
||||
@@ -165,7 +167,7 @@ describe('Task Assignee', () => {
|
||||
|
||||
afterAll(async () => {
|
||||
await apiService.loginWithProfile('admin');
|
||||
await apiService.getInstance().activiti.adminTenantsApi.deleteTenant(user.tenantId);
|
||||
await usersActions.deleteTenant(user.tenantId);
|
||||
});
|
||||
|
||||
it('[C216430] Start Task - Claim and Requeue a task', async () => {
|
||||
|
||||
@@ -20,7 +20,7 @@ import {
|
||||
ApiService,
|
||||
ApplicationsUtil,
|
||||
FileBrowserUtil,
|
||||
LoginPage,
|
||||
LoginPage, ModelsActions, TaskUtil,
|
||||
UsersActions,
|
||||
ViewerPage
|
||||
} from '@alfresco/adf-testing';
|
||||
@@ -30,8 +30,9 @@ import { AttachmentListPage } from './../pages/attachment-list.page';
|
||||
import * as fs from 'fs';
|
||||
import * as path from 'path';
|
||||
import { FileModel } from '../../models/ACS/file.model';
|
||||
import { TaskRepresentation } from '@alfresco/js-api';
|
||||
import CONSTANTS = require('../../util/constants');
|
||||
import { Activiti } from '@alfresco/js-api';
|
||||
import ContentApi = Activiti.ContentApi;
|
||||
|
||||
describe('Attachment list action menu for tasks', () => {
|
||||
|
||||
@@ -45,6 +46,10 @@ describe('Attachment list action menu for tasks', () => {
|
||||
|
||||
const apiService = new ApiService();
|
||||
const usersActions = new UsersActions(apiService);
|
||||
const modelsActions = new ModelsActions(apiService);
|
||||
const taskUtil = new TaskUtil(apiService);
|
||||
const contentApi = new ContentApi();
|
||||
contentApi.init(apiService.getInstance());
|
||||
|
||||
const pngFile = new FileModel({
|
||||
location: browser.params.resources.Files.ADF_DOCUMENTS.PNG.file_location,
|
||||
@@ -74,9 +79,9 @@ describe('Attachment list action menu for tasks', () => {
|
||||
});
|
||||
|
||||
afterAll(async () => {
|
||||
await apiService.getInstance().activiti.modelsApi.deleteModel(appId);
|
||||
await modelsActions.deleteModel(appId);
|
||||
await apiService.loginWithProfile('admin');
|
||||
await apiService.getInstance().activiti.adminTenantsApi.deleteTenant(tenantId);
|
||||
await usersActions.deleteTenant(tenantId);
|
||||
});
|
||||
|
||||
it('[C277311] Should be able to View /Download /Remove from Attachment List on an active task', async () => {
|
||||
@@ -166,12 +171,12 @@ describe('Attachment list action menu for tasks', () => {
|
||||
});
|
||||
|
||||
it('[C260234] Should be able to attache a file on a task on APS and check on ADF', async () => {
|
||||
const newTask = await apiService.getInstance().activiti.taskApi.createNewTask(new TaskRepresentation({ name: 'SHARE KNOWLEDGE' }));
|
||||
const newTask = await taskUtil.createStandaloneTask('SHARE KNOWLEDGE');
|
||||
const newTaskId = newTask.id;
|
||||
const filePath = path.join(browser.params.testConfig.main.rootPath + pngFile.location);
|
||||
const file = fs.createReadStream(filePath);
|
||||
|
||||
relatedContent = await apiService.getInstance().activiti.contentApi.createRelatedContentOnTask(newTaskId, file, { 'isRelatedContent': true });
|
||||
relatedContent = await contentApi.createRelatedContentOnTask(newTaskId, file, { 'isRelatedContent': true });
|
||||
relatedContentId = relatedContent.id;
|
||||
|
||||
await (await (await navigationBarPage.navigateToProcessServicesPage()).goToTaskApp()).clickTasksButton();
|
||||
@@ -181,7 +186,7 @@ describe('Attachment list action menu for tasks', () => {
|
||||
|
||||
await attachmentListPage.checkFileIsAttached(pngFile.name);
|
||||
|
||||
await apiService.getInstance().activiti.contentApi.deleteContent(relatedContentId);
|
||||
await contentApi.deleteContent(relatedContentId);
|
||||
|
||||
await (await (await navigationBarPage.navigateToProcessServicesPage()).goToTaskApp()).clickTasksButton();
|
||||
|
||||
|
||||
@@ -15,12 +15,19 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { LoginPage, BrowserActions, FileBrowserUtil, ApplicationsUtil, ApiService, UsersActions } from '@alfresco/adf-testing';
|
||||
import {
|
||||
LoginPage,
|
||||
BrowserActions,
|
||||
FileBrowserUtil,
|
||||
ApplicationsUtil,
|
||||
ApiService,
|
||||
UsersActions,
|
||||
TaskUtil
|
||||
} from '@alfresco/adf-testing';
|
||||
import { TasksPage } from './../pages/tasks.page';
|
||||
import { ProcessServicesPage } from './../pages/process-services.page';
|
||||
import CONSTANTS = require('../../util/constants');
|
||||
import { browser } from 'protractor';
|
||||
import { TaskRepresentation } from '@alfresco/js-api';
|
||||
|
||||
describe('Task Audit', () => {
|
||||
|
||||
@@ -32,6 +39,7 @@ describe('Task Audit', () => {
|
||||
|
||||
const apiService = new ApiService();
|
||||
const usersActions = new UsersActions(apiService);
|
||||
const taskUtil = new TaskUtil(apiService);
|
||||
|
||||
let processUserModel;
|
||||
|
||||
@@ -45,7 +53,7 @@ describe('Task Audit', () => {
|
||||
processUserModel = await usersActions.createUser();
|
||||
|
||||
await apiService.login(processUserModel.username, processUserModel.password);
|
||||
await apiService.getInstance().activiti.taskApi.createNewTask(new TaskRepresentation({ name: taskTaskApp }));
|
||||
await taskUtil.createStandaloneTask(taskTaskApp);
|
||||
const applicationsService = new ApplicationsUtil(apiService);
|
||||
await applicationsService.importPublishDeployApp(app.file_path);
|
||||
|
||||
@@ -54,7 +62,7 @@ describe('Task Audit', () => {
|
||||
|
||||
afterAll( async () => {
|
||||
await apiService.loginWithProfile('admin');
|
||||
await apiService.getInstance().activiti.adminTenantsApi.deleteTenant(processUserModel.tenantId);
|
||||
await usersActions.deleteTenant(processUserModel.tenantId);
|
||||
});
|
||||
|
||||
beforeEach(async () => {
|
||||
|
||||
@@ -18,25 +18,27 @@
|
||||
import {
|
||||
ApiService,
|
||||
ApplicationsUtil,
|
||||
LoginPage,
|
||||
LoginPage, ModelsActions,
|
||||
ProcessUtil,
|
||||
StringUtil,
|
||||
StringUtil, TaskUtil,
|
||||
UsersActions,
|
||||
Widget
|
||||
Widget,
|
||||
FormUtil
|
||||
} from '@alfresco/adf-testing';
|
||||
import { browser } from 'protractor';
|
||||
import { FormModelActions } from '../../actions/APS/form-model.actions';
|
||||
import { NavigationBarPage } from '../../core/pages/navigation-bar.page';
|
||||
import { FiltersPage } from './../pages/filters.page';
|
||||
import { TaskDetailsPage } from './../pages/task-details.page';
|
||||
import { TasksListPage } from './../pages/tasks-list.page';
|
||||
import { TasksPage } from './../pages/tasks.page';
|
||||
import { AttachFormPage } from './../pages/attach-form.page';
|
||||
import { TaskRepresentation } from '@alfresco/js-api';
|
||||
import CONSTANTS = require('../../util/constants');
|
||||
import { TaskActionsApi, TasksApi } from '@alfresco/js-api';
|
||||
|
||||
describe('Task Details - Form', () => {
|
||||
|
||||
const app = browser.params.resources.Files.SIMPLE_APP_WITH_USER_FORM;
|
||||
|
||||
const loginPage = new LoginPage();
|
||||
const tasksListPage = new TasksListPage();
|
||||
const taskDetailsPage = new TaskDetailsPage();
|
||||
@@ -46,9 +48,14 @@ describe('Task Details - Form', () => {
|
||||
const widget = new Widget();
|
||||
|
||||
const apiService = new ApiService();
|
||||
const formActions = new FormModelActions(apiService);
|
||||
const formActions = new FormUtil(apiService);
|
||||
const processUtil = new ProcessUtil(apiService);
|
||||
const usersActions = new UsersActions(apiService);
|
||||
const applicationsService = new ApplicationsUtil(apiService);
|
||||
const taskUtil = new TaskUtil(apiService);
|
||||
const modelsActions = new ModelsActions(apiService);
|
||||
const taskActionsApi = new TaskActionsApi(apiService.getInstance());
|
||||
const tasksApi = new TasksApi(apiService.getInstance());
|
||||
|
||||
let task, otherTask, user, newForm, attachedForm, otherAttachedForm;
|
||||
|
||||
@@ -76,27 +83,28 @@ describe('Task Details - Form', () => {
|
||||
user = await usersActions.createUser();
|
||||
await apiService.login(user.username, user.password);
|
||||
|
||||
attachedForm = await apiService.getInstance().activiti.modelsApi.createModel(attachedFormModel);
|
||||
newForm = await apiService.getInstance().activiti.modelsApi.createModel(newFormModel);
|
||||
attachedForm = await modelsActions.modelsApi.createModel(attachedFormModel);
|
||||
newForm = await modelsActions.modelsApi.createModel(newFormModel);
|
||||
|
||||
const otherEmptyTask = await apiService.getInstance().activiti.taskApi.createNewTask(new TaskRepresentation({ name: StringUtil.generateRandomString() }));
|
||||
otherAttachedForm = await apiService.getInstance().activiti.modelsApi.createModel(otherAttachedFormModel);
|
||||
const otherEmptyTask = await taskUtil.createStandaloneTask();
|
||||
|
||||
await apiService.getInstance().activiti.taskApi.attachForm(otherEmptyTask.id, { 'formId': otherAttachedForm.id });
|
||||
otherTask = await apiService.getInstance().activiti.taskApi.getTask(otherEmptyTask.id);
|
||||
otherAttachedForm = await modelsActions.modelsApi.createModel(otherAttachedFormModel);
|
||||
|
||||
await taskActionsApi.attachForm(otherEmptyTask.id, { 'formId': otherAttachedForm.id });
|
||||
otherTask = await tasksApi.getTask(otherEmptyTask.id);
|
||||
|
||||
await loginPage.login(user.username, user.password);
|
||||
});
|
||||
|
||||
afterAll(async () => {
|
||||
await apiService.loginWithProfile('admin');
|
||||
await apiService.getInstance().activiti.adminTenantsApi.deleteTenant(user.tenantId);
|
||||
await usersActions.deleteTenant(user.tenantId);
|
||||
});
|
||||
|
||||
beforeEach(async () => {
|
||||
const emptyTask = await apiService.getInstance().activiti.taskApi.createNewTask(new TaskRepresentation({ name: StringUtil.generateRandomString() }));
|
||||
await apiService.getInstance().activiti.taskApi.attachForm(emptyTask.id, { 'formId': attachedForm.id });
|
||||
task = await apiService.getInstance().activiti.taskApi.getTask(emptyTask.id);
|
||||
const emptyTask = await taskUtil.createStandaloneTask();
|
||||
await taskActionsApi.attachForm(emptyTask.id, { 'formId': attachedForm.id });
|
||||
task = await tasksApi.getTask(emptyTask.id);
|
||||
await (await new NavigationBarPage().navigateToProcessServicesPage()).goToTaskApp();
|
||||
await tasksListPage.checkTaskListIsLoaded();
|
||||
await filtersPage.goToFilter(CONSTANTS.TASK_FILTERS.INV_TASKS);
|
||||
@@ -176,17 +184,16 @@ describe('Task Details - Form', () => {
|
||||
tabFieldVar: 'tabBasicFieldVar'
|
||||
};
|
||||
|
||||
let app, newTask;
|
||||
let newTask, appModel;
|
||||
|
||||
beforeAll(async () => {
|
||||
app = browser.params.resources.Files.SIMPLE_APP_WITH_USER_FORM;
|
||||
await applicationsService.importPublishDeployApp(app.file_path);
|
||||
appModel = await applicationsService.importPublishDeployApp(app.file_path);
|
||||
});
|
||||
|
||||
beforeEach(async () => {
|
||||
newTask = await apiService.getInstance().activiti.taskApi.createNewTask(new TaskRepresentation({ name: StringUtil.generateRandomString() }));
|
||||
newTask = await taskUtil.createStandaloneTask();
|
||||
const form = await formActions.getFormByName(app.visibilityProcess.formName);
|
||||
await apiService.getInstance().activiti.taskApi.attachForm(newTask.id, { 'formId': form.id });
|
||||
await taskActionsApi.attachForm(newTask.id, { 'formId': form.id });
|
||||
|
||||
await browser.refresh();
|
||||
await (await new NavigationBarPage().navigateToProcessServicesPage()).goToTaskApp();
|
||||
@@ -350,7 +357,7 @@ describe('Task Details - Form', () => {
|
||||
});
|
||||
|
||||
it('[C315197] Should be able to complete a process task with visible tab with empty value for field', async () => {
|
||||
await new ProcessUtil(apiService).startProcessByDefinitionName(app.name, app.visibilityProcess.name);
|
||||
await processUtil.startProcessByDefinitionName(appModel.name, app.visibilityProcess.name);
|
||||
|
||||
await filtersPage.goToFilter(CONSTANTS.TASK_FILTERS.MY_TASKS);
|
||||
await tasksListPage.checkTaskListIsLoaded();
|
||||
@@ -384,7 +391,7 @@ describe('Task Details - Form', () => {
|
||||
});
|
||||
|
||||
it('[C212922] Should a User task form be refreshed, saved or completed.', async () => {
|
||||
await new ProcessUtil(apiService).startProcessByDefinitionName(app.name, app.processName);
|
||||
await processUtil.startProcessByDefinitionName(appModel.name, app.processName);
|
||||
|
||||
await filtersPage.goToFilter(CONSTANTS.TASK_FILTERS.MY_TASKS);
|
||||
await tasksListPage.checkTaskListIsLoaded();
|
||||
|
||||
@@ -27,16 +27,16 @@ describe('Task Details - No form', () => {
|
||||
|
||||
const loginPage = new LoginPage();
|
||||
const navigationBarPage = new NavigationBarPage();
|
||||
const taskPage = new TasksPage();
|
||||
|
||||
const apiService = new ApiService();
|
||||
const usersActions = new UsersActions(apiService);
|
||||
|
||||
let processUserModel;
|
||||
const taskPage = new TasksPage();
|
||||
const noFormMessage = 'No forms attached';
|
||||
let importedApp;
|
||||
|
||||
beforeAll(async () => {
|
||||
const usersActions = new UsersActions(apiService);
|
||||
|
||||
await apiService.loginWithProfile('admin');
|
||||
processUserModel = await usersActions.createUser();
|
||||
|
||||
@@ -49,7 +49,7 @@ describe('Task Details - No form', () => {
|
||||
|
||||
afterAll( async () => {
|
||||
await apiService.loginWithProfile('admin');
|
||||
await apiService.getInstance().activiti.adminTenantsApi.deleteTenant(processUserModel.tenantId);
|
||||
await usersActions.deleteTenant(processUserModel.tenantId);
|
||||
});
|
||||
|
||||
it('[C289311] Should attach form and complete buttons to be displayed when no form is attached', async () => {
|
||||
|
||||
@@ -19,15 +19,15 @@ import {
|
||||
ApiService,
|
||||
ApplicationsUtil,
|
||||
BrowserActions,
|
||||
LoginPage,
|
||||
LoginPage, ModelsActions,
|
||||
ProcessUtil,
|
||||
StringUtil,
|
||||
StringUtil, TaskUtil,
|
||||
UsersActions
|
||||
} from '@alfresco/adf-testing';
|
||||
import { ProcessServicesPage } from './../pages/process-services.page';
|
||||
import { TasksPage } from './../pages/tasks.page';
|
||||
import { browser } from 'protractor';
|
||||
import { TaskRepresentation } from '@alfresco/js-api';
|
||||
import { TaskActionsApi, TaskFormsApi, TasksApi } from '@alfresco/js-api';
|
||||
import Task = require('../../models/APS/Task');
|
||||
import TaskModel = require('../../models/APS/TaskModel');
|
||||
import FormModel = require('../../models/APS/FormModel');
|
||||
@@ -43,6 +43,12 @@ describe('Task Details component', () => {
|
||||
const taskPage = new TasksPage();
|
||||
|
||||
const apiService = new ApiService();
|
||||
const taskUtil = new TaskUtil(apiService);
|
||||
const modelsActions = new ModelsActions(apiService);
|
||||
const usersActions = new UsersActions(apiService);
|
||||
const tasksApi = new TasksApi(apiService.getInstance());
|
||||
const taskActionsApi = new TaskActionsApi(apiService.getInstance());
|
||||
const taskFormsApi = new TaskFormsApi(apiService.getInstance());
|
||||
|
||||
let processUserModel, appModel;
|
||||
const tasks = ['Modifying task', 'Information box', 'No form', 'Not Created', 'Refreshing form', 'Assignee task', 'Attach File'];
|
||||
@@ -57,8 +63,6 @@ describe('Task Details component', () => {
|
||||
};
|
||||
|
||||
beforeAll(async () => {
|
||||
const usersActions = new UsersActions(apiService);
|
||||
|
||||
await apiService.loginWithProfile('admin');
|
||||
processUserModel = await usersActions.createUser();
|
||||
|
||||
@@ -70,7 +74,7 @@ describe('Task Details component', () => {
|
||||
|
||||
afterAll(async () => {
|
||||
await apiService.loginWithProfile('admin');
|
||||
await apiService.getInstance().activiti.adminTenantsApi.deleteTenant(processUserModel.tenantId);
|
||||
await usersActions.deleteTenant(processUserModel.tenantId);
|
||||
});
|
||||
|
||||
beforeEach(async () => {
|
||||
@@ -85,7 +89,7 @@ describe('Task Details component', () => {
|
||||
await taskPage.createTask({ name: tasks[1], description: 'Description', formName: app.formName });
|
||||
await expect(await taskPage.taskDetails().getTitle()).toEqual('Activities');
|
||||
|
||||
const allTasks = await apiService.getInstance().activiti.taskApi.listTasks(new Task({ sort: 'created-desc' }));
|
||||
const allTasks = await tasksApi.listTasks(new Task({ sort: 'created-desc' }));
|
||||
|
||||
const taskModel = new TaskModel(allTasks.data[0]);
|
||||
await taskPage.tasksListPage().checkContentIsDisplayed(taskModel.getName());
|
||||
@@ -101,7 +105,7 @@ describe('Task Details component', () => {
|
||||
await expect(await taskPage.taskDetails().getEndDate()).toEqual('');
|
||||
await expect(await taskPage.taskDetails().getStatus()).toEqual(CONSTANTS.TASK_STATUS.RUNNING);
|
||||
|
||||
const taskForm = await apiService.getInstance().activiti.taskFormsApi.getTaskForm(allTasks.data[0].id);
|
||||
const taskForm = await taskFormsApi.getTaskForm(allTasks.data[0].id);
|
||||
formModel = new FormModel(taskForm);
|
||||
|
||||
await taskPage.taskDetails().waitFormNameEqual(formModel.getName());
|
||||
@@ -114,7 +118,7 @@ describe('Task Details component', () => {
|
||||
await taskPage.createTask({ name: tasks[1], description: 'Description', formName: app.formName });
|
||||
await expect(await taskPage.taskDetails().getTitle()).toEqual('Activities');
|
||||
|
||||
const allTasks = await apiService.getInstance().activiti.taskApi.listTasks(new Task({ sort: 'created-desc' }));
|
||||
const allTasks = await tasksApi.listTasks(new Task({ sort: 'created-desc' }));
|
||||
|
||||
const taskModel = new TaskModel(allTasks.data[0]);
|
||||
await taskPage.tasksListPage().checkContentIsDisplayed(taskModel.getName());
|
||||
@@ -132,7 +136,7 @@ describe('Task Details component', () => {
|
||||
await expect(await taskPage.taskDetails().getParentTaskId()).toEqual('');
|
||||
await expect(await taskPage.taskDetails().getStatus()).toEqual(CONSTANTS.TASK_STATUS.RUNNING);
|
||||
|
||||
const taskForm = await apiService.getInstance().activiti.taskFormsApi.getTaskForm(allTasks.data[0].id);
|
||||
const taskForm = await taskFormsApi.getTaskForm(allTasks.data[0].id);
|
||||
|
||||
formModel = new FormModel(taskForm);
|
||||
|
||||
@@ -148,7 +152,7 @@ describe('Task Details component', () => {
|
||||
|
||||
await expect(await taskPage.taskDetails().getTitle()).toEqual('Activities');
|
||||
|
||||
const allTasks = await apiService.getInstance().activiti.taskApi.listTasks(new Task({ sort: 'created-desc' }));
|
||||
const allTasks = await tasksApi.listTasks(new Task({ sort: 'created-desc' }));
|
||||
|
||||
const taskModel = new TaskModel(allTasks.data[0]);
|
||||
|
||||
@@ -165,7 +169,7 @@ describe('Task Details component', () => {
|
||||
await expect(await taskPage.taskDetails().getParentTaskId()).toEqual('');
|
||||
await expect(await taskPage.taskDetails().getStatus()).toEqual(CONSTANTS.TASK_STATUS.RUNNING);
|
||||
|
||||
const taskForm = await apiService.getInstance().activiti.taskFormsApi.getTaskForm(allTasks.data[0].id);
|
||||
const taskForm = await taskFormsApi.getTaskForm(allTasks.data[0].id);
|
||||
|
||||
formModel = new FormModel(taskForm);
|
||||
|
||||
@@ -180,7 +184,7 @@ describe('Task Details component', () => {
|
||||
|
||||
await expect(await taskPage.taskDetails().getTitle()).toEqual('Activities');
|
||||
|
||||
const allTasks = await apiService.getInstance().activiti.taskApi.listTasks(new Task({ sort: 'created-desc' }));
|
||||
const allTasks = await tasksApi.listTasks(new Task({ sort: 'created-desc' }));
|
||||
const taskModel = new TaskModel(allTasks.data[0]);
|
||||
|
||||
await taskPage.tasksListPage().checkContentIsDisplayed(taskModel.getName());
|
||||
@@ -196,7 +200,7 @@ describe('Task Details component', () => {
|
||||
await expect(await taskPage.taskDetails().getParentTaskId()).toEqual('');
|
||||
await expect(await taskPage.taskDetails().getStatus()).toEqual(CONSTANTS.TASK_STATUS.RUNNING);
|
||||
|
||||
const taskForm = await apiService.getInstance().activiti.taskFormsApi.getTaskForm(allTasks.data[0].id);
|
||||
const taskForm = await taskFormsApi.getTaskForm(allTasks.data[0].id);
|
||||
|
||||
formModel = new FormModel(taskForm);
|
||||
|
||||
@@ -206,8 +210,7 @@ describe('Task Details component', () => {
|
||||
it('[C286708] Should display task details for subtask - Task App', async () => {
|
||||
const taskName = 'TaskAppSubtask';
|
||||
const checklistName = 'TaskAppChecklist';
|
||||
await apiService.getInstance().activiti.taskApi.createNewTask(new TaskRepresentation({ 'name': taskName }));
|
||||
|
||||
await taskUtil.createStandaloneTask(taskName);
|
||||
await (await processServices.goToTaskApp()).clickTasksButton();
|
||||
|
||||
await taskPage.filtersPage().goToFilter(CONSTANTS.TASK_FILTERS.MY_TASKS);
|
||||
@@ -223,7 +226,7 @@ describe('Task Details component', () => {
|
||||
await taskPage.tasksListPage().checkContentIsDisplayed(checklistName);
|
||||
await taskPage.tasksListPage().selectRow(checklistName);
|
||||
|
||||
const allTasks = await apiService.getInstance().activiti.taskApi.listTasks(new Task({ sort: 'created-desc' }));
|
||||
const allTasks = await tasksApi.listTasks(new Task({ sort: 'created-desc' }));
|
||||
|
||||
const taskModel = new TaskModel(allTasks.data[0]);
|
||||
await taskPage.tasksListPage().checkContentIsDisplayed(taskModel.getName());
|
||||
@@ -260,7 +263,7 @@ describe('Task Details component', () => {
|
||||
await taskPage.tasksListPage().checkContentIsDisplayed(checklistName);
|
||||
await taskPage.tasksListPage().selectRow(checklistName);
|
||||
|
||||
const allTasks = await apiService.getInstance().activiti.taskApi.listTasks(new Task({ sort: 'created-desc' }));
|
||||
const allTasks = await tasksApi.listTasks(new Task({ sort: 'created-desc' }));
|
||||
|
||||
const taskModel = new TaskModel(allTasks.data[0]);
|
||||
await taskPage.tasksListPage().checkContentIsDisplayed(taskModel.getName());
|
||||
@@ -279,7 +282,7 @@ describe('Task Details component', () => {
|
||||
|
||||
it('[C286709] Should display task details for completed task - Task App', async () => {
|
||||
const taskName = 'TaskAppCompleted';
|
||||
const taskId = await apiService.getInstance().activiti.taskApi.createNewTask(new TaskRepresentation({ 'name': taskName }));
|
||||
const taskId = await taskUtil.createStandaloneTask(taskName);
|
||||
await (await processServices.goToTaskApp()).clickTasksButton();
|
||||
|
||||
await taskPage.filtersPage().goToFilter(CONSTANTS.TASK_FILTERS.MY_TASKS);
|
||||
@@ -291,7 +294,7 @@ describe('Task Details component', () => {
|
||||
await taskPage.filtersPage().goToFilter(CONSTANTS.TASK_FILTERS.COMPLETED_TASKS);
|
||||
await taskPage.tasksListPage().selectRow(taskName);
|
||||
|
||||
const getTaskResponse = await apiService.getInstance().activiti.taskApi.getTask(taskId.id);
|
||||
const getTaskResponse = await tasksApi.getTask(taskId.id);
|
||||
|
||||
const taskModel = new TaskModel(getTaskResponse);
|
||||
await taskPage.tasksListPage().checkContentIsDisplayed(taskModel.getName());
|
||||
@@ -310,10 +313,11 @@ describe('Task Details component', () => {
|
||||
|
||||
it('[C260321] Should not be able to edit a completed task\'s details', async () => {
|
||||
const taskName = 'TaskCompleted';
|
||||
const form = await apiService.getInstance().activiti.modelsApi.createModel(taskFormModel);
|
||||
const task = await apiService.getInstance().activiti.taskApi.createNewTask(new TaskRepresentation({ 'name': taskName }));
|
||||
await apiService.getInstance().activiti.taskApi.attachForm(task.id, { 'formId': form.id });
|
||||
await apiService.getInstance().activiti.taskApi.completeTaskForm(task.id, { values: { label: null } });
|
||||
const form = await modelsActions.modelsApi.createModel(taskFormModel);
|
||||
const task = await taskUtil.createStandaloneTask(taskName);
|
||||
|
||||
await taskActionsApi.attachForm(task.id, { 'formId': form.id });
|
||||
await taskFormsApi.completeTaskForm(task.id, { values: { label: null } });
|
||||
|
||||
await (await processServices.goToTaskApp()).clickTasksButton();
|
||||
|
||||
|
||||
@@ -15,7 +15,14 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { ApiService, ApplicationsUtil, LoginPage, UserModel, UsersActions } from '@alfresco/adf-testing';
|
||||
import {
|
||||
ApiService,
|
||||
ApplicationsUtil,
|
||||
LoginPage, ModelsActions,
|
||||
UserFiltersUtil,
|
||||
UserModel,
|
||||
UsersActions
|
||||
} from '@alfresco/adf-testing';
|
||||
import { NavigationBarPage } from '../../core/pages/navigation-bar.page';
|
||||
import { ProcessServicesPage } from './../pages/process-services.page';
|
||||
import { TasksPage } from './../pages/tasks.page';
|
||||
@@ -43,6 +50,7 @@ describe('Task', () => {
|
||||
|
||||
const apiService = new ApiService();
|
||||
const usersActions = new UsersActions(apiService);
|
||||
const modelsActions = new ModelsActions(apiService);
|
||||
|
||||
let appId: number, user: UserModel;
|
||||
|
||||
@@ -62,9 +70,9 @@ describe('Task', () => {
|
||||
});
|
||||
|
||||
afterEach(async () => {
|
||||
await apiService.getInstance().activiti.modelsApi.deleteModel(appId);
|
||||
await modelsActions.deleteModel(appId);
|
||||
await apiService.loginWithProfile('admin');
|
||||
await apiService.getInstance().activiti.adminTenantsApi.deleteTenant(user.tenantId);
|
||||
await usersActions.deleteTenant(user.tenantId);
|
||||
await navigationBarPage.clickLogoutButton();
|
||||
});
|
||||
|
||||
@@ -177,7 +185,10 @@ describe('Task', () => {
|
||||
const processServiceTabBarPage = new ProcessServiceTabBarPage();
|
||||
const appSettingsToggles = new AppSettingsTogglesPage();
|
||||
const taskFiltersDemoPage = new TaskFiltersDemoPage();
|
||||
|
||||
const apiService = new ApiService();
|
||||
const userFiltersApi = new UserFiltersUtil(apiService);
|
||||
const usersActions = new UsersActions(apiService);
|
||||
|
||||
let user;
|
||||
let appId: number;
|
||||
@@ -185,22 +196,20 @@ describe('Task', () => {
|
||||
const app = browser.params.resources.Files.APP_WITH_PROCESSES;
|
||||
|
||||
beforeAll(async () => {
|
||||
const usersActions = new UsersActions(apiService);
|
||||
await apiService.loginWithProfile('admin');
|
||||
user = await usersActions.createUser();
|
||||
|
||||
await apiService.login(user.username, user.password);
|
||||
const applicationsService = new ApplicationsUtil(apiService);
|
||||
const importedApp = await applicationsService.importPublishDeployApp(app.file_path);
|
||||
const appDefinitions = await apiService.getInstance().activiti.appsApi.getAppDefinitions();
|
||||
appId = appDefinitions.data.find((currentApp) => currentApp.modelId === importedApp.id).id;
|
||||
appId = await applicationsService.getAppDefinitionId(importedApp.id);
|
||||
|
||||
await loginPage.login(user.username, user.password);
|
||||
});
|
||||
|
||||
afterAll(async () => {
|
||||
await apiService.loginWithProfile('admin');
|
||||
await apiService.getInstance().activiti.adminTenantsApi.deleteTenant(user.tenantId);
|
||||
await usersActions.deleteTenant(user.tenantId);
|
||||
});
|
||||
|
||||
beforeEach(async () => {
|
||||
@@ -216,11 +225,11 @@ describe('Task', () => {
|
||||
icon: 'glyphicon-filter',
|
||||
filter: { sort: 'created-desc', state: 'completed', assignment: 'involved' }
|
||||
});
|
||||
const { id } = await apiService.getInstance().activiti.userFiltersApi.createUserTaskFilter(newFilter);
|
||||
const { id } = await userFiltersApi.createUserTaskFilter(newFilter);
|
||||
|
||||
await browser.refresh();
|
||||
await taskFiltersDemoPage.customTaskFilter('New Task Filter').checkTaskFilterIsDisplayed();
|
||||
await apiService.getInstance().activiti.userFiltersApi.deleteUserTaskFilter(id);
|
||||
await userFiltersApi.deleteUserTaskFilter(id);
|
||||
});
|
||||
|
||||
it('[C286447] Should display the task filter icon when a custom filter is added', async () => {
|
||||
@@ -230,7 +239,7 @@ describe('Task', () => {
|
||||
icon: 'glyphicon-cloud',
|
||||
filter: { sort: 'created-desc', state: 'completed', assignment: 'involved' }
|
||||
});
|
||||
const { id } = await apiService.getInstance().activiti.userFiltersApi.createUserTaskFilter(newFilter);
|
||||
const { id } = await userFiltersApi.createUserTaskFilter(newFilter);
|
||||
|
||||
await browser.refresh();
|
||||
await processServiceTabBarPage.clickSettingsButton();
|
||||
@@ -240,7 +249,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 apiService.getInstance().activiti.userFiltersApi.deleteUserTaskFilter(id);
|
||||
await userFiltersApi.deleteUserTaskFilter(id);
|
||||
});
|
||||
|
||||
it('[C286449] Should display task filter icons only when showIcon property is set on true', async () => {
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { ApiService, ApplicationsUtil, LoginPage, UsersActions } from '@alfresco/adf-testing';
|
||||
import { ApiService, ApplicationsUtil, LoginPage, UserFiltersUtil, UsersActions } from '@alfresco/adf-testing';
|
||||
import { NavigationBarPage } from '../../core/pages/navigation-bar.page';
|
||||
import { ProcessServicesPage } from './../pages/process-services.page';
|
||||
import { TasksPage } from './../pages/tasks.page';
|
||||
@@ -39,6 +39,7 @@ describe('Task Filters Sorting', () => {
|
||||
|
||||
const apiService = new ApiService();
|
||||
const usersActions = new UsersActions(apiService);
|
||||
const userFiltersUtil = new UserFiltersUtil(apiService);
|
||||
|
||||
let user;
|
||||
let appId;
|
||||
@@ -57,9 +58,9 @@ describe('Task Filters Sorting', () => {
|
||||
|
||||
await apiService.login(user.username, user.password);
|
||||
const applicationsService = new ApplicationsUtil(apiService);
|
||||
const importedApp = await applicationsService.importPublishDeployApp(app.file_path);
|
||||
const appDefinitions = await apiService.getInstance().activiti.appsApi.getAppDefinitions();
|
||||
appId = appDefinitions.data.find((currentApp) => currentApp.modelId === importedApp.id).id;
|
||||
|
||||
const appModel = await applicationsService.importPublishDeployApp(app.file_path);
|
||||
appId = await applicationsService.getAppDefinitionId(appModel.id);
|
||||
|
||||
await loginPage.login(user.username, user.password);
|
||||
await navigationBarPage.navigateToProcessServicesPage();
|
||||
@@ -82,7 +83,7 @@ describe('Task Filters Sorting', () => {
|
||||
|
||||
afterAll( async () => {
|
||||
await apiService.loginWithProfile('admin');
|
||||
await apiService.getInstance().activiti.adminTenantsApi.deleteTenant(user.tenantId);
|
||||
await usersActions.deleteTenant(user.tenantId);
|
||||
});
|
||||
|
||||
it('[C277254] Should display tasks under new filter from newest to oldest when they are completed', async () => {
|
||||
@@ -92,7 +93,7 @@ describe('Task Filters Sorting', () => {
|
||||
icon: 'glyphicon-filter',
|
||||
filter: { sort: 'created-desc', state: 'completed', assignment: 'involved' }
|
||||
});
|
||||
await apiService.getInstance().activiti.userFiltersApi.createUserTaskFilter(newFilter);
|
||||
await userFiltersUtil.createUserTaskFilter(newFilter);
|
||||
|
||||
await browser.refresh();
|
||||
await taskFiltersDemoPage.customTaskFilter(newFilter.name).clickTaskFilter();
|
||||
@@ -109,7 +110,7 @@ describe('Task Filters Sorting', () => {
|
||||
icon: 'glyphicon-filter',
|
||||
filter: { sort: 'created-asc', state: 'completed', assignment: 'involved' }
|
||||
});
|
||||
await apiService.getInstance().activiti.userFiltersApi.createUserTaskFilter(newFilter);
|
||||
await userFiltersUtil.createUserTaskFilter(newFilter);
|
||||
|
||||
await browser.refresh();
|
||||
await taskFiltersDemoPage.customTaskFilter(newFilter.name).clickTaskFilter();
|
||||
@@ -126,7 +127,7 @@ describe('Task Filters Sorting', () => {
|
||||
icon: 'glyphicon-filter',
|
||||
filter: { sort: 'due-desc', state: 'completed', assignment: 'involved' }
|
||||
});
|
||||
await apiService.getInstance().activiti.userFiltersApi.createUserTaskFilter(newFilter);
|
||||
await userFiltersUtil.createUserTaskFilter(newFilter);
|
||||
|
||||
await browser.refresh();
|
||||
await taskFiltersDemoPage.customTaskFilter(newFilter.name).clickTaskFilter();
|
||||
@@ -143,7 +144,7 @@ describe('Task Filters Sorting', () => {
|
||||
icon: 'glyphicon-filter',
|
||||
filter: { sort: 'due-asc', state: 'completed', assignment: 'involved' }
|
||||
});
|
||||
await apiService.getInstance().activiti.userFiltersApi.createUserTaskFilter(newFilter);
|
||||
await userFiltersUtil.createUserTaskFilter(newFilter);
|
||||
|
||||
await browser.refresh();
|
||||
await taskFiltersDemoPage.customTaskFilter(newFilter.name).clickTaskFilter();
|
||||
@@ -160,7 +161,7 @@ describe('Task Filters Sorting', () => {
|
||||
icon: 'glyphicon-filter',
|
||||
filter: { sort: 'created-desc', state: 'open', assignment: 'involved' }
|
||||
});
|
||||
await apiService.getInstance().activiti.userFiltersApi.createUserTaskFilter(newFilter);
|
||||
await userFiltersUtil.createUserTaskFilter(newFilter);
|
||||
|
||||
await browser.refresh();
|
||||
await taskFiltersDemoPage.customTaskFilter(newFilter.name).clickTaskFilter();
|
||||
@@ -177,7 +178,7 @@ describe('Task Filters Sorting', () => {
|
||||
icon: 'glyphicon-filter',
|
||||
filter: { sort: 'created-asc', state: 'open', assignment: 'involved' }
|
||||
});
|
||||
await apiService.getInstance().activiti.userFiltersApi.createUserTaskFilter(newFilter);
|
||||
await userFiltersUtil.createUserTaskFilter(newFilter);
|
||||
|
||||
await browser.refresh();
|
||||
await taskFiltersDemoPage.customTaskFilter(newFilter.name).clickTaskFilter();
|
||||
@@ -194,7 +195,7 @@ describe('Task Filters Sorting', () => {
|
||||
icon: 'glyphicon-filter',
|
||||
filter: { sort: 'due-desc', state: 'open', assignment: 'involved' }
|
||||
});
|
||||
await apiService.getInstance().activiti.userFiltersApi.createUserTaskFilter(newFilter);
|
||||
await userFiltersUtil.createUserTaskFilter(newFilter);
|
||||
|
||||
await browser.refresh();
|
||||
await taskFiltersDemoPage.customTaskFilter(newFilter.name).clickTaskFilter();
|
||||
@@ -211,7 +212,7 @@ describe('Task Filters Sorting', () => {
|
||||
icon: 'glyphicon-filter',
|
||||
filter: { sort: 'due-asc', state: 'open', assignment: 'involved' }
|
||||
});
|
||||
await apiService.getInstance().activiti.userFiltersApi.createUserTaskFilter(newFilter);
|
||||
await userFiltersUtil.createUserTaskFilter(newFilter);
|
||||
|
||||
await browser.refresh();
|
||||
await taskFiltersDemoPage.customTaskFilter(newFilter.name).clickTaskFilter();
|
||||
|
||||
@@ -35,7 +35,9 @@ describe('Task List Pagination', () => {
|
||||
const navigationBarPage = new NavigationBarPage();
|
||||
const taskPage = new TasksPage();
|
||||
const paginationPage = new PaginationPage();
|
||||
|
||||
const apiService = new ApiService();
|
||||
const usersActions = new UsersActions(apiService);
|
||||
|
||||
let processUserModel: UserModel;
|
||||
const app = browser.params.resources.Files.SIMPLE_APP_WITH_USER_FORM;
|
||||
@@ -56,8 +58,6 @@ describe('Task List Pagination', () => {
|
||||
};
|
||||
|
||||
beforeAll(async () => {
|
||||
const usersActions = new UsersActions(apiService);
|
||||
|
||||
await apiService.loginWithProfile('admin');
|
||||
processUserModel = await usersActions.createUser();
|
||||
|
||||
@@ -74,7 +74,7 @@ describe('Task List Pagination', () => {
|
||||
|
||||
afterAll( async () => {
|
||||
await apiService.loginWithProfile('admin');
|
||||
await apiService.getInstance().activiti.adminTenantsApi.deleteTenant(processUserModel.tenantId);
|
||||
await usersActions.deleteTenant(processUserModel.tenantId);
|
||||
});
|
||||
|
||||
it('[C260301] Should display default pagination', async () => {
|
||||
|
||||
@@ -29,7 +29,7 @@ describe('Amount Widget', () => {
|
||||
const widget = new Widget();
|
||||
|
||||
let appModel;
|
||||
let deployedApp, process;
|
||||
let deployedAppId, process;
|
||||
let processUserModel;
|
||||
|
||||
const apiService = new ApiService();
|
||||
@@ -45,16 +45,14 @@ describe('Amount Widget', () => {
|
||||
await apiService.login(processUserModel.username, processUserModel.password);
|
||||
appModel = await applicationsService.importPublishDeployApp(browser.params.resources.Files.WIDGET_CHECK_APP.file_path);
|
||||
|
||||
const appDefinitions = await apiService.getInstance().activiti.appsApi.getAppDefinitions();
|
||||
deployedApp = appDefinitions.data.find((currentApp) => {
|
||||
return currentApp.modelId === appModel.id;
|
||||
});
|
||||
deployedAppId = await applicationsService.getAppDefinitionId(appModel.id);
|
||||
|
||||
process = await processUtil.startProcessByDefinitionName(appModel.name, app.processName);
|
||||
await loginPage.login(processUserModel.username, processUserModel.password);
|
||||
});
|
||||
|
||||
beforeEach(async() => {
|
||||
const urlToNavigateTo = `${browser.baseUrl}/activiti/apps/${deployedApp.id}/tasks/`;
|
||||
const urlToNavigateTo = `${browser.baseUrl}/activiti/apps/${deployedAppId}/tasks/`;
|
||||
await BrowserActions.getUrl(urlToNavigateTo);
|
||||
await taskPage.tasksListPage().checkTaskListIsLoaded();
|
||||
|
||||
@@ -63,9 +61,9 @@ describe('Amount Widget', () => {
|
||||
});
|
||||
|
||||
afterAll(async () => {
|
||||
await apiService.getInstance().activiti.processApi.deleteProcessInstance(process.id);
|
||||
await processUtil.cancelProcessInstance(process.id);
|
||||
await apiService.loginWithProfile('admin');
|
||||
await apiService.getInstance().activiti.adminTenantsApi.deleteTenant(processUserModel.tenantId);
|
||||
await usersActions.deleteTenant(processUserModel.tenantId);
|
||||
});
|
||||
|
||||
it('[C274703] Should be possible to set general, advance and visibility properties for Amount Widget', async () => {
|
||||
|
||||
@@ -80,7 +80,7 @@ describe('Attach widget - File', () => {
|
||||
|
||||
afterAll(async () => {
|
||||
await apiService.loginWithProfile('admin');
|
||||
await apiService.getInstance().activiti.adminTenantsApi.deleteTenant(processUserModel.tenantId);
|
||||
await usersActions.deleteTenant(processUserModel.tenantId);
|
||||
});
|
||||
|
||||
it('[C268067] Should be able to preview, download and remove attached files from an active form', async () => {
|
||||
|
||||
@@ -39,7 +39,7 @@ describe('Attach Folder widget', () => {
|
||||
const navigationBarPage = new NavigationBarPage();
|
||||
|
||||
let appModel;
|
||||
let deployedApp, process;
|
||||
let deployedAppId, process;
|
||||
let processUserModel;
|
||||
|
||||
const apiService = new ApiService();
|
||||
@@ -55,26 +55,24 @@ describe('Attach Folder widget', () => {
|
||||
await apiService.login(processUserModel.username, processUserModel.password);
|
||||
appModel = await applicationsService.importPublishDeployApp(browser.params.resources.Files.WIDGET_CHECK_APP.file_path);
|
||||
|
||||
const appDefinitions = await apiService.getInstance().activiti.appsApi.getAppDefinitions();
|
||||
deployedApp = appDefinitions.data.find((currentApp) => {
|
||||
return currentApp.modelId === appModel.id;
|
||||
});
|
||||
deployedAppId = await applicationsService.getAppDefinitionId(appModel.id);
|
||||
|
||||
process = await processUtil.startProcessByDefinitionName(appModel.name, app.processName);
|
||||
await loginPage.login(processUserModel.username, processUserModel.password);
|
||||
});
|
||||
|
||||
beforeEach(async () => {
|
||||
await navigationBarPage.clickHomeButton();
|
||||
await (new ProcessServicesPage()).goToAppByAppId(deployedApp.id);
|
||||
await (new ProcessServicesPage()).goToAppByAppId(deployedAppId);
|
||||
|
||||
await taskPage.filtersPage().goToFilter(CONSTANTS.TASK_FILTERS.MY_TASKS);
|
||||
await taskPage.formFields().checkFormIsDisplayed();
|
||||
});
|
||||
|
||||
afterAll(async () => {
|
||||
await apiService.getInstance().activiti.processApi.deleteProcessInstance(process.id);
|
||||
await processUtil.cancelProcessInstance(process.id);
|
||||
await apiService.loginWithProfile('admin');
|
||||
await apiService.getInstance().activiti.adminTenantsApi.deleteTenant(processUserModel.tenantId);
|
||||
await usersActions.deleteTenant(processUserModel.tenantId);
|
||||
});
|
||||
|
||||
it('[C276745] Should be possible to set visibility properties for Attach Folder Widget', async () => {
|
||||
|
||||
@@ -38,11 +38,12 @@ describe('Checkbox Widget', () => {
|
||||
|
||||
let processUserModel;
|
||||
let appModel;
|
||||
let deployedApp, process;
|
||||
let deployedAppId, process;
|
||||
|
||||
const apiService = new ApiService();
|
||||
const usersActions = new UsersActions(apiService);
|
||||
const applicationsService = new ApplicationsUtil(apiService);
|
||||
const processUtil = new ProcessUtil(apiService);
|
||||
|
||||
beforeAll(async () => {
|
||||
await apiService.loginWithProfile('admin');
|
||||
@@ -52,24 +53,22 @@ describe('Checkbox Widget', () => {
|
||||
await apiService.login(processUserModel.username, processUserModel.password);
|
||||
appModel = await applicationsService.importPublishDeployApp(browser.params.resources.Files.WIDGET_CHECK_APP.file_path);
|
||||
|
||||
const appDefinitions = await apiService.getInstance().activiti.appsApi.getAppDefinitions();
|
||||
deployedApp = appDefinitions.data.find((currentApp) => {
|
||||
return currentApp.modelId === appModel.id;
|
||||
});
|
||||
process = await new ProcessUtil(apiService).startProcessByDefinitionName(appModel.name, app.processName);
|
||||
deployedAppId = await applicationsService.getAppDefinitionId(appModel.id);
|
||||
|
||||
process = await processUtil.startProcessByDefinitionName(appModel.name, app.processName);
|
||||
await loginPage.login(processUserModel.username, processUserModel.password);
|
||||
});
|
||||
|
||||
beforeEach(async () => {
|
||||
await (new ProcessServicesPage()).goToAppByAppId(deployedApp.id);
|
||||
await (new ProcessServicesPage()).goToAppByAppId(deployedAppId);
|
||||
await taskPage.filtersPage().goToFilter(CONSTANTS.TASK_FILTERS.MY_TASKS);
|
||||
await taskPage.formFields().checkFormIsDisplayed();
|
||||
});
|
||||
|
||||
afterAll(async () => {
|
||||
await apiService.getInstance().activiti.processApi.deleteProcessInstance(process.id);
|
||||
await processUtil.cancelProcessInstance(process.id);
|
||||
await apiService.loginWithProfile('admin');
|
||||
await apiService.getInstance().activiti.adminTenantsApi.deleteTenant(processUserModel.tenantId);
|
||||
await usersActions.deleteTenant(processUserModel.tenantId);
|
||||
});
|
||||
|
||||
it('[C268554] Should be able to set general settings for Checkbox widget ', async () => {
|
||||
|
||||
@@ -41,10 +41,11 @@ describe('Date and time widget', () => {
|
||||
const apiService = new ApiService();
|
||||
const usersActions = new UsersActions(apiService);
|
||||
const applicationsService = new ApplicationsUtil(apiService);
|
||||
const processUtil = new ProcessUtil(apiService);
|
||||
|
||||
let processUserModel;
|
||||
let appModel;
|
||||
let deployedApp, process;
|
||||
let deployedAppId, process;
|
||||
|
||||
beforeAll(async () => {
|
||||
await apiService.loginWithProfile('admin');
|
||||
@@ -54,26 +55,24 @@ describe('Date and time widget', () => {
|
||||
await apiService.login(processUserModel.username, processUserModel.password);
|
||||
appModel = await applicationsService.importPublishDeployApp(browser.params.resources.Files.WIDGET_CHECK_APP.file_path);
|
||||
|
||||
const appDefinitions = await apiService.getInstance().activiti.appsApi.getAppDefinitions();
|
||||
deployedApp = appDefinitions.data.find((currentApp) => {
|
||||
return currentApp.modelId === appModel.id;
|
||||
});
|
||||
process = await new ProcessUtil(apiService).startProcessByDefinitionName(appModel.name, app.processName);
|
||||
deployedAppId = await applicationsService.getAppDefinitionId(appModel.id);
|
||||
|
||||
process = await processUtil.startProcessByDefinitionName(appModel.name, app.processName);
|
||||
await loginPage.login(processUserModel.username, processUserModel.password);
|
||||
});
|
||||
|
||||
beforeEach(async () => {
|
||||
await navigationBarPage.clickHomeButton();
|
||||
await (new ProcessServicesPage()).goToAppByAppId(deployedApp.id);
|
||||
await (new ProcessServicesPage()).goToAppByAppId(deployedAppId);
|
||||
|
||||
await taskPage.filtersPage().goToFilter(CONSTANTS.TASK_FILTERS.MY_TASKS);
|
||||
await taskPage.formFields().checkFormIsDisplayed();
|
||||
});
|
||||
|
||||
afterAll(async () => {
|
||||
await apiService.getInstance().activiti.processApi.deleteProcessInstance(process.id);
|
||||
await processUtil.cancelProcessInstance(process.id);
|
||||
await apiService.loginWithProfile('admin');
|
||||
await apiService.getInstance().activiti.adminTenantsApi.deleteTenant(processUserModel.tenantId);
|
||||
await usersActions.deleteTenant(processUserModel.tenantId);
|
||||
});
|
||||
|
||||
it('[C268818] Should be able to set general settings for Date Time widget', async () => {
|
||||
|
||||
@@ -45,11 +45,12 @@ describe('Date widget', () => {
|
||||
const dateWidget = widget.dateWidget();
|
||||
let appModel;
|
||||
let processUserModel;
|
||||
let deployedApp, process;
|
||||
let deployedAppId, process;
|
||||
|
||||
const apiService = new ApiService();
|
||||
const usersActions = new UsersActions(apiService);
|
||||
const applicationsService = new ApplicationsUtil(apiService);
|
||||
const processUtil = new ProcessUtil(apiService);
|
||||
|
||||
beforeAll(async () => {
|
||||
await apiService.loginWithProfile('admin');
|
||||
@@ -59,24 +60,22 @@ describe('Date widget', () => {
|
||||
await apiService.login(processUserModel.username, processUserModel.password);
|
||||
appModel = await applicationsService.importPublishDeployApp(browser.params.resources.Files.WIDGET_CHECK_APP.file_path);
|
||||
|
||||
const appDefinitions = await apiService.getInstance().activiti.appsApi.getAppDefinitions();
|
||||
deployedApp = appDefinitions.data.find((currentApp) => {
|
||||
return currentApp.modelId === appModel.id;
|
||||
});
|
||||
process = await new ProcessUtil(apiService).startProcessByDefinitionName(appModel.name, app.processName);
|
||||
deployedAppId = await applicationsService.getAppDefinitionId(appModel.id);
|
||||
|
||||
process = await processUtil.startProcessByDefinitionName(appModel.name, app.processName);
|
||||
await loginPage.login(processUserModel.username, processUserModel.password);
|
||||
});
|
||||
|
||||
afterAll(async () => {
|
||||
await apiService.getInstance().activiti.processApi.deleteProcessInstance(process.id);
|
||||
await processUtil.cancelProcessInstance(process.id);
|
||||
await apiService.loginWithProfile('admin');
|
||||
await apiService.getInstance().activiti.adminTenantsApi.deleteTenant(processUserModel.tenantId);
|
||||
await usersActions.deleteTenant(processUserModel.tenantId);
|
||||
});
|
||||
|
||||
describe('Simple App', () => {
|
||||
beforeEach(async () => {
|
||||
await navigationBarPage.clickHomeButton();
|
||||
await (new ProcessServicesPage()).goToAppByAppId(deployedApp.id);
|
||||
await (new ProcessServicesPage()).goToAppByAppId(deployedAppId);
|
||||
|
||||
await taskPage.filtersPage().goToFilter(CONSTANTS.TASK_FILTERS.MY_TASKS);
|
||||
await taskPage.formFields().checkFormIsDisplayed();
|
||||
|
||||
@@ -41,9 +41,10 @@ describe('Document Template widget', () => {
|
||||
const apiService = new ApiService();
|
||||
const usersActions = new UsersActions(apiService);
|
||||
const applicationsService = new ApplicationsUtil(apiService);
|
||||
const processUtil = new ProcessUtil(apiService);
|
||||
|
||||
let appModel;
|
||||
let deployedApp, process;
|
||||
let deployedAppId, process;
|
||||
let processUserModel;
|
||||
|
||||
beforeAll(async () => {
|
||||
@@ -54,26 +55,24 @@ describe('Document Template widget', () => {
|
||||
await apiService.login(processUserModel.username, processUserModel.password);
|
||||
appModel = await applicationsService.importPublishDeployApp( app.file_path);
|
||||
|
||||
const appDefinitions = await apiService.getInstance().activiti.appsApi.getAppDefinitions();
|
||||
deployedApp = appDefinitions.data.find((currentApp) => {
|
||||
return currentApp.modelId === appModel.id;
|
||||
});
|
||||
process = await new ProcessUtil(apiService).startProcessOfApp(appModel.name);
|
||||
deployedAppId = await applicationsService.getAppDefinitionId(appModel.id);
|
||||
|
||||
process = await processUtil.startProcessOfApp(appModel.name);
|
||||
await loginPage.login(processUserModel.username, processUserModel.password);
|
||||
});
|
||||
|
||||
beforeEach(async () => {
|
||||
await navigationBarPage.clickHomeButton();
|
||||
await (new ProcessServicesPage()).goToAppByAppId(deployedApp.id);
|
||||
await (new ProcessServicesPage()).goToAppByAppId(deployedAppId);
|
||||
|
||||
await taskPage.filtersPage().goToFilter(CONSTANTS.TASK_FILTERS.MY_TASKS);
|
||||
await taskPage.formFields().checkFormIsDisplayed();
|
||||
});
|
||||
|
||||
afterAll(async () => {
|
||||
await apiService.getInstance().activiti.processApi.deleteProcessInstance(process.id);
|
||||
await processUtil.cancelProcessInstance(process.id);
|
||||
await apiService.loginWithProfile('admin');
|
||||
await apiService.getInstance().activiti.adminTenantsApi.deleteTenant(processUserModel.tenantId);
|
||||
await usersActions.deleteTenant(processUserModel.tenantId);
|
||||
});
|
||||
|
||||
it('[C260406] should check that the template contains assigned file ', async () => {
|
||||
|
||||
@@ -40,9 +40,10 @@ describe('Dropdown widget', () => {
|
||||
const apiService = new ApiService();
|
||||
const usersActions = new UsersActions(apiService);
|
||||
const applicationsService = new ApplicationsUtil(apiService);
|
||||
const processUtil = new ProcessUtil(apiService);
|
||||
|
||||
let appModel;
|
||||
let deployedApp, process;
|
||||
let deployedAppId, process;
|
||||
let processUserModel;
|
||||
|
||||
beforeAll(async () => {
|
||||
@@ -53,26 +54,24 @@ describe('Dropdown widget', () => {
|
||||
await apiService.login(processUserModel.username, processUserModel.password);
|
||||
appModel = await applicationsService.importPublishDeployApp(browser.params.resources.Files.WIDGET_CHECK_APP.file_path);
|
||||
|
||||
const appDefinitions = await apiService.getInstance().activiti.appsApi.getAppDefinitions();
|
||||
deployedApp = appDefinitions.data.find((currentApp) => {
|
||||
return currentApp.modelId === appModel.id;
|
||||
});
|
||||
process = await new ProcessUtil(apiService).startProcessByDefinitionName(appModel.name, app.processName);
|
||||
deployedAppId = await applicationsService.getAppDefinitionId(appModel.id);
|
||||
|
||||
process = await processUtil.startProcessByDefinitionName(appModel.name, app.processName);
|
||||
await loginPage.login(processUserModel.username, processUserModel.password);
|
||||
});
|
||||
|
||||
beforeEach(async () => {
|
||||
await navigationBarPage.clickHomeButton();
|
||||
await (new ProcessServicesPage()).goToAppByAppId(deployedApp.id);
|
||||
await (new ProcessServicesPage()).goToAppByAppId(deployedAppId);
|
||||
|
||||
await taskPage.filtersPage().goToFilter(CONSTANTS.TASK_FILTERS.MY_TASKS);
|
||||
await taskPage.formFields().checkFormIsDisplayed();
|
||||
});
|
||||
|
||||
afterAll(async () => {
|
||||
await apiService.getInstance().activiti.processApi.deleteProcessInstance(process.id);
|
||||
await processUtil.cancelProcessInstance(process.id);
|
||||
await apiService.loginWithProfile('admin');
|
||||
await apiService.getInstance().activiti.adminTenantsApi.deleteTenant(processUserModel.tenantId);
|
||||
await usersActions.deleteTenant(processUserModel.tenantId);
|
||||
});
|
||||
|
||||
it('[C269051] Should be possible to set general and options properties for Dropdown widget ', async () => {
|
||||
|
||||
@@ -39,13 +39,12 @@ describe('Dynamic Table widget ', () => {
|
||||
const apiService = new ApiService();
|
||||
const usersActions = new UsersActions(apiService);
|
||||
const applicationsService = new ApplicationsUtil(apiService);
|
||||
const processUtil = new ProcessUtil(apiService);
|
||||
|
||||
let processUserModel;
|
||||
let appModel;
|
||||
let deployedApp, process;
|
||||
let deployedAppId, process;
|
||||
|
||||
describe('with Date Time Widget App', () => {
|
||||
|
||||
const app = browser.params.resources.Files.WIDGET_CHECK_APP.DYNAMIC_TABLE;
|
||||
|
||||
beforeAll(async () => {
|
||||
@@ -53,26 +52,26 @@ describe('Dynamic Table widget ', () => {
|
||||
processUserModel = await usersActions.createUser();
|
||||
|
||||
await apiService.login(processUserModel.username, processUserModel.password);
|
||||
appModel = await applicationsService.importPublishDeployApp(browser.params.resources.Files.WIDGET_CHECK_APP.file_path);
|
||||
const appModel = await applicationsService.importPublishDeployApp(browser.params.resources.Files.WIDGET_CHECK_APP.file_path);
|
||||
|
||||
const appDefinitions = await apiService.getInstance().activiti.appsApi.getAppDefinitions();
|
||||
deployedApp = appDefinitions.data.find((currentApp) => currentApp.modelId === appModel.id);
|
||||
process = await new ProcessUtil(apiService).startProcessByDefinitionName(appModel.name, app.processName);
|
||||
deployedAppId = await applicationsService.getAppDefinitionId(appModel.id);
|
||||
|
||||
process = await processUtil.startProcessByDefinitionName(appModel.name, app.processName);
|
||||
await loginPage.login(processUserModel.username, processUserModel.password);
|
||||
});
|
||||
|
||||
beforeEach(async () => {
|
||||
await navigationBarPage.clickHomeButton();
|
||||
await (new ProcessServicesPage()).goToAppByAppId(deployedApp.id);
|
||||
await (new ProcessServicesPage()).goToAppByAppId(deployedAppId);
|
||||
|
||||
await taskPage.filtersPage().goToFilter(CONSTANTS.TASK_FILTERS.MY_TASKS);
|
||||
await taskPage.formFields().checkFormIsDisplayed();
|
||||
});
|
||||
|
||||
afterAll(async () => {
|
||||
await apiService.getInstance().activiti.processApi.deleteProcessInstance(process.id);
|
||||
await processUtil.cancelProcessInstance(process.id);
|
||||
await apiService.loginWithProfile('admin');
|
||||
await apiService.getInstance().activiti.adminTenantsApi.deleteTenant(processUserModel.tenantId);
|
||||
await usersActions.deleteTenant(processUserModel.tenantId);
|
||||
await navigationBarPage.clickLogoutButton();
|
||||
});
|
||||
|
||||
@@ -103,24 +102,24 @@ describe('Dynamic Table widget ', () => {
|
||||
processUserModel = await usersActions.createUser();
|
||||
|
||||
await apiService.login(processUserModel.username, processUserModel.password);
|
||||
appModel = await applicationsService.importPublishDeployApp(browser.params.resources.Files.WIDGET_CHECK_APP.file_path);
|
||||
const appModel = await applicationsService.importPublishDeployApp(browser.params.resources.Files.WIDGET_CHECK_APP.file_path);
|
||||
|
||||
const appDefinitions = await apiService.getInstance().activiti.appsApi.getAppDefinitions();
|
||||
deployedApp = appDefinitions.data.find((currentApp) => currentApp.modelId === appModel.id);
|
||||
process = await new ProcessUtil(apiService).startProcessByDefinitionName(appModel.name, app.processName);
|
||||
deployedAppId = await applicationsService.getAppDefinitionId(appModel.id);
|
||||
|
||||
process = await processUtil.startProcessByDefinitionName(appModel.name, app.processName);
|
||||
await loginPage.login(processUserModel.username, processUserModel.password);
|
||||
});
|
||||
|
||||
afterAll(async () => {
|
||||
await apiService.getInstance().activiti.processApi.deleteProcessInstance(process.id);
|
||||
await processUtil.cancelProcessInstance(process.id);
|
||||
await apiService.loginWithProfile('admin');
|
||||
await apiService.getInstance().activiti.adminTenantsApi.deleteTenant(processUserModel.tenantId);
|
||||
await usersActions.deleteTenant(processUserModel.tenantId);
|
||||
await navigationBarPage.clickLogoutButton();
|
||||
});
|
||||
|
||||
beforeEach(async () => {
|
||||
await navigationBarPage.clickHomeButton();
|
||||
await (new ProcessServicesPage()).goToAppByAppId(deployedApp.id);
|
||||
await (new ProcessServicesPage()).goToAppByAppId(deployedAppId);
|
||||
|
||||
await taskPage.filtersPage().goToFilter(CONSTANTS.TASK_FILTERS.MY_TASKS);
|
||||
await taskPage.tasksListPage().checkTaskListIsLoaded();
|
||||
@@ -159,24 +158,24 @@ describe('Dynamic Table widget ', () => {
|
||||
processUserModel = await usersActions.createUser();
|
||||
|
||||
await apiService.login(processUserModel.username, processUserModel.password);
|
||||
const application = await applicationsService.importPublishDeployApp(app.file_path);
|
||||
const appModel = await applicationsService.importPublishDeployApp(app.file_path);
|
||||
|
||||
const appDefinitions = await apiService.getInstance().activiti.appsApi.getAppDefinitions();
|
||||
deployedApp = appDefinitions.data.find((currentApp) => currentApp.modelId === application.id);
|
||||
process = await new ProcessUtil(apiService).startProcessByDefinitionName(application.name, app.CUSTOM_VALIDATOR.processName);
|
||||
deployedAppId = await applicationsService.getAppDefinitionId(appModel.id);
|
||||
|
||||
process = await processUtil.startProcessByDefinitionName(appModel.name, app.CUSTOM_VALIDATOR.processName);
|
||||
});
|
||||
|
||||
afterAll(async () => {
|
||||
await apiService.getInstance().activiti.processApi.deleteProcessInstance(process.id);
|
||||
await processUtil.cancelProcessInstance(process.id);
|
||||
await apiService.loginWithProfile('admin');
|
||||
await apiService.getInstance().activiti.adminTenantsApi.deleteTenant(processUserModel.tenantId);
|
||||
await usersActions.deleteTenant(processUserModel.tenantId);
|
||||
});
|
||||
|
||||
beforeEach(async () => {
|
||||
await loginPage.login(processUserModel.username, processUserModel.password);
|
||||
|
||||
await navigationBarPage.clickHomeButton();
|
||||
await (new ProcessServicesPage()).goToAppByAppId(deployedApp.id);
|
||||
await (new ProcessServicesPage()).goToAppByAppId(deployedAppId);
|
||||
|
||||
await taskPage.filtersPage().goToFilter(CONSTANTS.TASK_FILTERS.MY_TASKS);
|
||||
await taskPage.tasksListPage().checkTaskListIsLoaded();
|
||||
@@ -195,7 +194,7 @@ describe('Dynamic Table widget ', () => {
|
||||
|
||||
await widget.dynamicTable().setDatatableInput('id', app.CUSTOM_VALIDATOR.FIELD.ID);
|
||||
await widget.dynamicTable().clickSaveButton();
|
||||
await expect(await widget.dynamicTable().checkErrorMessage()).toBe('Field \'Number\' is required.' );
|
||||
await expect(await widget.dynamicTable().checkErrorMessage()).toBe('Field \'Number\' is required.');
|
||||
|
||||
await widget.dynamicTable().setDatatableInput('12', app.CUSTOM_VALIDATOR.FIELD.NUM);
|
||||
await widget.dynamicTable().clickSaveButton();
|
||||
|
||||
@@ -41,9 +41,10 @@ describe('Header widget', async () => {
|
||||
const apiService = new ApiService();
|
||||
const usersActions = new UsersActions(apiService);
|
||||
const applicationsService = new ApplicationsUtil(apiService);
|
||||
const processUtil = new ProcessUtil(apiService);
|
||||
|
||||
let appModel;
|
||||
let deployedApp, process;
|
||||
let deployedAppId, process;
|
||||
let processUserModel;
|
||||
|
||||
beforeAll(async () => {
|
||||
@@ -54,26 +55,24 @@ describe('Header widget', async () => {
|
||||
await apiService.login(processUserModel.username, processUserModel.password);
|
||||
appModel = await applicationsService.importPublishDeployApp(browser.params.resources.Files.WIDGET_CHECK_APP.file_path);
|
||||
|
||||
const appDefinitions = await apiService.getInstance().activiti.appsApi.getAppDefinitions();
|
||||
deployedApp = appDefinitions.data.find((currentApp) => {
|
||||
return currentApp.modelId === appModel.id;
|
||||
});
|
||||
process = await new ProcessUtil(apiService).startProcessByDefinitionName(appModel.name, app.processName);
|
||||
deployedAppId = await applicationsService.getAppDefinitionId(appModel.id);
|
||||
|
||||
process = await processUtil.startProcessByDefinitionName(appModel.name, app.processName);
|
||||
await loginPage.login(processUserModel.username, processUserModel.password);
|
||||
});
|
||||
|
||||
beforeEach(async () => {
|
||||
await navigationBarPage.clickHomeButton();
|
||||
await (new ProcessServicesPage()).goToAppByAppId(deployedApp.id);
|
||||
await (new ProcessServicesPage()).goToAppByAppId(deployedAppId);
|
||||
|
||||
await taskPage.filtersPage().goToFilter(CONSTANTS.TASK_FILTERS.MY_TASKS);
|
||||
await taskPage.formFields().checkFormIsDisplayed();
|
||||
});
|
||||
|
||||
afterAll(async () => {
|
||||
await apiService.getInstance().activiti.processApi.deleteProcessInstance(process.id);
|
||||
await processUtil.cancelProcessInstance(process.id);
|
||||
await apiService.loginWithProfile('admin');
|
||||
await apiService.getInstance().activiti.adminTenantsApi.deleteTenant(processUserModel.tenantId);
|
||||
await usersActions.deleteTenant(processUserModel.tenantId);
|
||||
});
|
||||
|
||||
it('[C276737] Should be able to set general and visibility properties for Header widget', async () => {
|
||||
|
||||
@@ -41,10 +41,11 @@ describe('Hyperlink widget', () => {
|
||||
const apiService = new ApiService();
|
||||
const usersActions = new UsersActions(apiService);
|
||||
const applicationsService = new ApplicationsUtil(apiService);
|
||||
const processUtil = new ProcessUtil(apiService);
|
||||
|
||||
let appModel;
|
||||
let processUserModel;
|
||||
let deployedApp, process;
|
||||
let deployedAppId, process;
|
||||
|
||||
beforeAll(async () => {
|
||||
await apiService.loginWithProfile('admin');
|
||||
@@ -54,26 +55,24 @@ describe('Hyperlink widget', () => {
|
||||
await apiService.login(processUserModel.username, processUserModel.password);
|
||||
appModel = await applicationsService.importPublishDeployApp(browser.params.resources.Files.WIDGET_CHECK_APP.file_path);
|
||||
|
||||
const appDefinitions = await apiService.getInstance().activiti.appsApi.getAppDefinitions();
|
||||
deployedApp = appDefinitions.data.find((currentApp) => {
|
||||
return currentApp.modelId === appModel.id;
|
||||
});
|
||||
process = await new ProcessUtil(apiService).startProcessByDefinitionName(appModel.name, app.processName);
|
||||
deployedAppId = await applicationsService.getAppDefinitionId(appModel.id);
|
||||
|
||||
process = await processUtil.startProcessByDefinitionName(appModel.name, app.processName);
|
||||
await loginPage.login(processUserModel.username, processUserModel.password);
|
||||
});
|
||||
|
||||
beforeEach(async () => {
|
||||
await navigationBarPage.clickHomeButton();
|
||||
await (new ProcessServicesPage()).goToAppByAppId(deployedApp.id);
|
||||
await (new ProcessServicesPage()).goToAppByAppId(deployedAppId);
|
||||
|
||||
await taskPage.filtersPage().goToFilter(CONSTANTS.TASK_FILTERS.MY_TASKS);
|
||||
await taskPage.formFields().checkFormIsDisplayed();
|
||||
});
|
||||
|
||||
afterAll(async () => {
|
||||
await apiService.getInstance().activiti.processApi.deleteProcessInstance(process.id);
|
||||
await processUtil.cancelProcessInstance(process.id);
|
||||
await apiService.loginWithProfile('admin');
|
||||
await apiService.getInstance().activiti.adminTenantsApi.deleteTenant(processUserModel.tenantId);
|
||||
await usersActions.deleteTenant(processUserModel.tenantId);
|
||||
});
|
||||
|
||||
it('[C276728] Should be able to set visibility properties for Hyperlink widget', async () => {
|
||||
|
||||
@@ -40,10 +40,11 @@ describe('Multi-line Widget', () => {
|
||||
const apiService = new ApiService();
|
||||
const usersActions = new UsersActions(apiService);
|
||||
const applicationsService = new ApplicationsUtil(apiService);
|
||||
const processUtil = new ProcessUtil(apiService);
|
||||
|
||||
let appModel;
|
||||
let processUserModel;
|
||||
let deployedApp, process;
|
||||
let deployedAppId, process;
|
||||
|
||||
beforeAll(async () => {
|
||||
await apiService.loginWithProfile('admin');
|
||||
@@ -53,26 +54,24 @@ describe('Multi-line Widget', () => {
|
||||
await apiService.login(processUserModel.username, processUserModel.password);
|
||||
appModel = await applicationsService.importPublishDeployApp(browser.params.resources.Files.WIDGET_CHECK_APP.file_path);
|
||||
|
||||
const appDefinitions = await apiService.getInstance().activiti.appsApi.getAppDefinitions();
|
||||
deployedApp = appDefinitions.data.find((currentApp) => {
|
||||
return currentApp.modelId === appModel.id;
|
||||
});
|
||||
process = await new ProcessUtil(apiService).startProcessByDefinitionName(appModel.name, app.processName);
|
||||
deployedAppId = await applicationsService.getAppDefinitionId(appModel.id);
|
||||
|
||||
process = await processUtil.startProcessByDefinitionName(appModel.name, app.processName);
|
||||
await loginPage.login(processUserModel.username, processUserModel.password);
|
||||
});
|
||||
|
||||
beforeEach(async () => {
|
||||
await navigationBarPage.clickHomeButton();
|
||||
await (new ProcessServicesPage()).goToAppByAppId(deployedApp.id);
|
||||
await (new ProcessServicesPage()).goToAppByAppId(deployedAppId);
|
||||
|
||||
await taskPage.filtersPage().goToFilter(CONSTANTS.TASK_FILTERS.MY_TASKS);
|
||||
await taskPage.formFields().checkFormIsDisplayed();
|
||||
});
|
||||
|
||||
afterAll(async () => {
|
||||
await apiService.getInstance().activiti.processApi.deleteProcessInstance(process.id);
|
||||
await processUtil.cancelProcessInstance(process.id);
|
||||
await apiService.loginWithProfile('admin');
|
||||
await apiService.getInstance().activiti.adminTenantsApi.deleteTenant(processUserModel.tenantId);
|
||||
await usersActions.deleteTenant(processUserModel.tenantId);
|
||||
});
|
||||
|
||||
it('[C268182] Should be able to set general properties for Multi-line Text Widget', async () => {
|
||||
|
||||
@@ -41,9 +41,10 @@ describe('Number widget', () => {
|
||||
const apiService = new ApiService();
|
||||
const usersActions = new UsersActions(apiService);
|
||||
const applicationsService = new ApplicationsUtil(apiService);
|
||||
const processUtil = new ProcessUtil(apiService);
|
||||
|
||||
let appModel;
|
||||
let deployedApp, process;
|
||||
let deployedAppId, process;
|
||||
let processUserModel;
|
||||
|
||||
beforeAll(async () => {
|
||||
@@ -54,26 +55,24 @@ describe('Number widget', () => {
|
||||
await apiService.login(processUserModel.username, processUserModel.password);
|
||||
appModel = await applicationsService.importPublishDeployApp(browser.params.resources.Files.WIDGET_CHECK_APP.file_path);
|
||||
|
||||
const appDefinitions = await apiService.getInstance().activiti.appsApi.getAppDefinitions();
|
||||
deployedApp = appDefinitions.data.find((currentApp) => {
|
||||
return currentApp.modelId === appModel.id;
|
||||
});
|
||||
process = await new ProcessUtil(apiService).startProcessByDefinitionName(appModel.name, app.processName);
|
||||
deployedAppId = await applicationsService.getAppDefinitionId(appModel.id);
|
||||
|
||||
process = await processUtil.startProcessByDefinitionName(appModel.name, app.processName);
|
||||
await loginPage.login(processUserModel.username, processUserModel.password);
|
||||
});
|
||||
|
||||
beforeEach(async () => {
|
||||
await navigationBarPage.clickHomeButton();
|
||||
await (new ProcessServicesPage()).goToAppByAppId(deployedApp.id);
|
||||
await (new ProcessServicesPage()).goToAppByAppId(deployedAppId);
|
||||
|
||||
await taskPage.filtersPage().goToFilter(CONSTANTS.TASK_FILTERS.MY_TASKS);
|
||||
await taskPage.formFields().checkFormIsDisplayed();
|
||||
});
|
||||
|
||||
afterAll(async () => {
|
||||
await apiService.getInstance().activiti.processApi.deleteProcessInstance(process.id);
|
||||
await processUtil.cancelProcessInstance(process.id);
|
||||
await apiService.loginWithProfile('admin');
|
||||
await apiService.getInstance().activiti.adminTenantsApi.deleteTenant(processUserModel.tenantId);
|
||||
await usersActions.deleteTenant(processUserModel.tenantId);
|
||||
});
|
||||
|
||||
it('[C269111] Should be able to set general properties for Number Widget', async () => {
|
||||
|
||||
@@ -20,6 +20,7 @@ import { TasksPage } from '../pages/tasks.page';
|
||||
import { browser } from 'protractor';
|
||||
import { NavigationBarPage } from '../../core/pages/navigation-bar.page';
|
||||
import CONSTANTS = require('../../util/constants');
|
||||
import { AdminGroupsApi } from '@alfresco/js-api';
|
||||
|
||||
describe('People and Group widget', () => {
|
||||
|
||||
@@ -33,6 +34,7 @@ describe('People and Group widget', () => {
|
||||
const apiService = new ApiService();
|
||||
const usersActions = new UsersActions(apiService);
|
||||
const applicationsService = new ApplicationsUtil(apiService);
|
||||
const adminGroupsApi = new AdminGroupsApi(apiService.getInstance());
|
||||
|
||||
let user: UserModel;
|
||||
|
||||
@@ -129,16 +131,16 @@ describe('People and Group widget', () => {
|
||||
tenantId: tenantId, firstName: app.subGroupUser.firstName, lastName: app.subGroupUser.lastName
|
||||
}));
|
||||
|
||||
const group = await apiService.getInstance().activiti.adminGroupsApi.createNewGroup({
|
||||
const group = await adminGroupsApi.createNewGroup({
|
||||
name: app.group.name,
|
||||
tenantId,
|
||||
type: 1
|
||||
});
|
||||
|
||||
await Promise.all(userCreated.map((userToAddGroup: UserModel) => apiService.getInstance().activiti.adminGroupsApi.addGroupMember(group.id, userToAddGroup.id)));
|
||||
await Promise.all(userCreated.map((userToAddGroup: UserModel) => adminGroupsApi.addGroupMember(group.id, userToAddGroup.id)));
|
||||
|
||||
const subgroups: any[] = await Promise.all(getSubGroupsName().map((name) =>
|
||||
apiService.getInstance().activiti.adminGroupsApi.createNewGroup({
|
||||
adminGroupsApi.createNewGroup({
|
||||
name,
|
||||
tenantId,
|
||||
type: 1,
|
||||
@@ -146,7 +148,7 @@ describe('People and Group widget', () => {
|
||||
})
|
||||
));
|
||||
|
||||
await Promise.all(subgroups.map((subgroup) => apiService.getInstance().activiti.adminGroupsApi.addGroupMember(subgroup.id, subgroupUser.id)));
|
||||
await Promise.all(subgroups.map((subgroup) => adminGroupsApi.addGroupMember(subgroup.id, subgroupUser.id)));
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -41,9 +41,10 @@ describe('People widget', () => {
|
||||
const apiService = new ApiService();
|
||||
const usersActions = new UsersActions(apiService);
|
||||
const applicationsService = new ApplicationsUtil(apiService);
|
||||
const processUtil = new ProcessUtil(apiService);
|
||||
|
||||
let appModel;
|
||||
let deployedApp, process;
|
||||
let deployedAppId, process;
|
||||
let processUserModel;
|
||||
|
||||
beforeAll(async () => {
|
||||
@@ -54,26 +55,24 @@ describe('People widget', () => {
|
||||
await apiService.login(processUserModel.username, processUserModel.password);
|
||||
appModel = await applicationsService.importPublishDeployApp(browser.params.resources.Files.WIDGET_CHECK_APP.file_path);
|
||||
|
||||
const appDefinitions = await apiService.getInstance().activiti.appsApi.getAppDefinitions();
|
||||
deployedApp = appDefinitions.data.find((currentApp) => {
|
||||
return currentApp.modelId === appModel.id;
|
||||
});
|
||||
process = await new ProcessUtil(apiService).startProcessOfApp(appModel.name, app.processName);
|
||||
deployedAppId = await applicationsService.getAppDefinitionId(appModel.id);
|
||||
|
||||
process = await processUtil.startProcessOfApp(appModel.name, app.processName);
|
||||
await loginPage.login(processUserModel.username, processUserModel.password);
|
||||
});
|
||||
|
||||
beforeEach(async () => {
|
||||
await navigationBarPage.clickHomeButton();
|
||||
await (new ProcessServicesPage()).goToAppByAppId(deployedApp.id);
|
||||
await (new ProcessServicesPage()).goToAppByAppId(deployedAppId);
|
||||
|
||||
await taskPage.filtersPage().goToFilter(CONSTANTS.TASK_FILTERS.MY_TASKS);
|
||||
await taskPage.formFields().checkFormIsDisplayed();
|
||||
});
|
||||
|
||||
afterAll(async () => {
|
||||
await apiService.getInstance().activiti.processApi.deleteProcessInstance(process.id);
|
||||
await processUtil.cancelProcessInstance(process.id);
|
||||
await apiService.loginWithProfile('admin');
|
||||
await apiService.getInstance().activiti.adminTenantsApi.deleteTenant(processUserModel.tenantId);
|
||||
await usersActions.deleteTenant(processUserModel.tenantId);
|
||||
});
|
||||
|
||||
it('[C260435][C274707] Should be possible to set visibility properties for People Widget', async () => {
|
||||
|
||||
@@ -41,9 +41,10 @@ describe('Radio Buttons Widget', () => {
|
||||
const apiService = new ApiService();
|
||||
const usersActions = new UsersActions(apiService);
|
||||
const applicationsService = new ApplicationsUtil(apiService);
|
||||
const processUtil = new ProcessUtil(apiService);
|
||||
|
||||
let appModel;
|
||||
let deployedApp, process;
|
||||
let appId, process;
|
||||
let processUserModel;
|
||||
|
||||
beforeAll(async () => {
|
||||
@@ -53,28 +54,24 @@ describe('Radio Buttons Widget', () => {
|
||||
|
||||
await apiService.login(processUserModel.username, processUserModel.password);
|
||||
appModel = await applicationsService.importPublishDeployApp(browser.params.resources.Files.WIDGET_CHECK_APP.file_path);
|
||||
appId = await applicationsService.getAppDefinitionId(appModel.id);
|
||||
|
||||
const appDefinitions = await apiService.getInstance().activiti.appsApi.getAppDefinitions();
|
||||
deployedApp = appDefinitions.data.find((currentApp) => {
|
||||
return currentApp.modelId === appModel.id;
|
||||
});
|
||||
|
||||
process = await new ProcessUtil(apiService).startProcessByDefinitionName(appModel.name, app.processName);
|
||||
process = await processUtil.startProcessByDefinitionName(appModel.name, app.processName);
|
||||
await loginPage.login(processUserModel.username, processUserModel.password);
|
||||
});
|
||||
|
||||
beforeEach(async () => {
|
||||
await navigationBarPage.clickHomeButton();
|
||||
await (new ProcessServicesPage()).goToAppByAppId(deployedApp.id);
|
||||
await (new ProcessServicesPage()).goToAppByAppId(appId);
|
||||
|
||||
await taskPage.filtersPage().goToFilter(CONSTANTS.TASK_FILTERS.MY_TASKS);
|
||||
await taskPage.formFields().checkFormIsDisplayed();
|
||||
});
|
||||
|
||||
afterAll(async () => {
|
||||
await apiService.getInstance().activiti.processApi.deleteProcessInstance(process.id);
|
||||
await processUtil.cancelProcessInstance(process.id);
|
||||
await apiService.loginWithProfile('admin');
|
||||
await apiService.getInstance().activiti.adminTenantsApi.deleteTenant(processUserModel.tenantId);
|
||||
await usersActions.deleteTenant(processUserModel.tenantId);
|
||||
});
|
||||
|
||||
it('[C277316] Should display empty radio buttons when no preselection is configured', async () => {
|
||||
|
||||
@@ -41,9 +41,10 @@ describe('Text widget', () => {
|
||||
const apiService = new ApiService();
|
||||
const usersActions = new UsersActions(apiService);
|
||||
const applicationsService = new ApplicationsUtil(apiService);
|
||||
const processUtil = new ProcessUtil(apiService);
|
||||
|
||||
let appModel;
|
||||
let deployedApp, process;
|
||||
let deployedAppId, process;
|
||||
let processUserModel;
|
||||
|
||||
beforeAll(async () => {
|
||||
@@ -54,26 +55,24 @@ describe('Text widget', () => {
|
||||
await apiService.login(processUserModel.username, processUserModel.password);
|
||||
appModel = await applicationsService.importPublishDeployApp(browser.params.resources.Files.WIDGET_CHECK_APP.file_path);
|
||||
|
||||
const appDefinitions = await apiService.getInstance().activiti.appsApi.getAppDefinitions();
|
||||
deployedApp = appDefinitions.data.find((currentApp) => {
|
||||
return currentApp.modelId === appModel.id;
|
||||
});
|
||||
process = await new ProcessUtil(apiService).startProcessByDefinitionName(appModel.name, app.processName);
|
||||
deployedAppId = await applicationsService.getAppDefinitionId(appModel.id);
|
||||
|
||||
process = await processUtil.startProcessByDefinitionName(appModel.name, app.processName);
|
||||
await loginPage.login(processUserModel.username, processUserModel.password);
|
||||
});
|
||||
|
||||
beforeEach(async () => {
|
||||
await navigationBarPage.clickHomeButton();
|
||||
await (new ProcessServicesPage()).goToAppByAppId(deployedApp.id);
|
||||
await (new ProcessServicesPage()).goToAppByAppId(deployedAppId);
|
||||
|
||||
await taskPage.filtersPage().goToFilter(CONSTANTS.TASK_FILTERS.MY_TASKS);
|
||||
await taskPage.formFields().checkFormIsDisplayed();
|
||||
});
|
||||
|
||||
afterAll(async () => {
|
||||
await apiService.getInstance().activiti.processApi.deleteProcessInstance(process.id);
|
||||
await processUtil.cancelProcessInstance(process.id);
|
||||
await apiService.loginWithProfile('admin');
|
||||
await apiService.getInstance().activiti.adminTenantsApi.deleteTenant(processUserModel.tenantId);
|
||||
await usersActions.deleteTenant(processUserModel.tenantId);
|
||||
});
|
||||
|
||||
it('[C268157] Should be able to set general properties for Text widget', async () => {
|
||||
|
||||
@@ -1,89 +0,0 @@
|
||||
/*!
|
||||
* @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, ApplicationsUtil, LoginPage, UserModel, UsersActions, Widget } from '@alfresco/adf-testing';
|
||||
import { TasksPage } from '../pages/tasks.page';
|
||||
import { browser } from 'protractor';
|
||||
import { NavigationBarPage } from '../../core/pages/navigation-bar.page';
|
||||
import CONSTANTS = require('../../util/constants');
|
||||
|
||||
describe('Typeahead widget', () => {
|
||||
|
||||
const app = browser.params.resources.Files.WIDGET_CHECK_APP;
|
||||
|
||||
const loginPage = new LoginPage();
|
||||
const taskPage = new TasksPage();
|
||||
const navigationBarPage = new NavigationBarPage();
|
||||
const widget = new Widget();
|
||||
|
||||
const apiService = new ApiService();
|
||||
const usersActions = new UsersActions(apiService);
|
||||
const applicationsService = new ApplicationsUtil(apiService);
|
||||
|
||||
let user: UserModel;
|
||||
|
||||
beforeAll(async () => {
|
||||
await apiService.loginWithProfile('admin');
|
||||
user = await usersActions.createUser();
|
||||
|
||||
await apiService.login(user.username, user.password);
|
||||
await applicationsService.importPublishDeployApp(app.file_path, { renewIdmEntries: true });
|
||||
await loginPage.login(user.username, user.password);
|
||||
});
|
||||
|
||||
afterAll(async () => {
|
||||
await apiService.loginWithProfile('admin');
|
||||
await apiService.getInstance().activiti.adminTenantsApi.deleteTenant(user.tenantId);
|
||||
});
|
||||
|
||||
beforeEach(async () => {
|
||||
await (await navigationBarPage.navigateToProcessServicesPage()).goToTaskApp();
|
||||
await taskPage.tasksListPage().checkTaskListIsLoaded();
|
||||
});
|
||||
|
||||
it('[C307988] Type ahead form control should work for URLs', async () => {
|
||||
const name = 'typahead widget task';
|
||||
const typeaheadWidget = app.TYPE_AHEAD_WIDGET;
|
||||
await taskPage.createTask({name, formName: typeaheadWidget.formName});
|
||||
await expect(await taskPage.taskDetails().getTitle()).toEqual('Activities');
|
||||
|
||||
await widget.typeahedWidget().checkTypeaheadFieldIsDisplayed();
|
||||
await widget.typeahedWidget().fillTypeaheadField(typeaheadWidget.case1.searchTerm);
|
||||
await widget.typeahedWidget().checkDropDownListIsDisplayed();
|
||||
let suggestions = await widget.typeahedWidget().getDropDownList();
|
||||
await expect(suggestions.sort()).toEqual(typeaheadWidget.case1.result.sort());
|
||||
|
||||
await widget.typeahedWidget().fillTypeaheadField(typeaheadWidget.case2.searchTerm);
|
||||
|
||||
await widget.typeahedWidget().checkDropDownListIsDisplayed();
|
||||
suggestions = await widget.typeahedWidget().getDropDownList();
|
||||
await expect(suggestions.sort()).toEqual(typeaheadWidget.case2.result);
|
||||
|
||||
await widget.typeahedWidget().selectOptionFromDropdown();
|
||||
await taskPage.taskDetails().clickCompleteFormTask();
|
||||
|
||||
await taskPage.filtersPage().goToFilter(CONSTANTS.TASK_FILTERS.COMPLETED_TASKS);
|
||||
await taskPage.tasksListPage().checkTaskListIsLoaded();
|
||||
|
||||
await taskPage.tasksListPage().selectRow(name);
|
||||
await widget.typeahedWidget().checkTypeaheadFieldIsDisplayed();
|
||||
|
||||
await browser.sleep(1000);
|
||||
|
||||
await expect(await widget.typeahedWidget().getFieldValue('1583773306434')).toBe(typeaheadWidget.case2.result[0]);
|
||||
});
|
||||
});
|
||||
@@ -63,9 +63,10 @@ describe('Process-Services - Visibility conditions', () => {
|
||||
const apiService = new ApiService();
|
||||
const usersActions = new UsersActions(apiService);
|
||||
const applicationsService = new ApplicationsUtil(apiService);
|
||||
const processUtil = new ProcessUtil(apiService);
|
||||
|
||||
let appModel;
|
||||
let deployedApp, process;
|
||||
let deployedAppId, process;
|
||||
let processUserModel;
|
||||
|
||||
beforeAll(async () => {
|
||||
@@ -76,25 +77,23 @@ describe('Process-Services - Visibility conditions', () => {
|
||||
await apiService.login(processUserModel.username, processUserModel.password);
|
||||
appModel = await applicationsService.importPublishDeployApp(browser.params.resources.Files.WIDGET_CHECK_APP.file_path);
|
||||
|
||||
const appDefinitions = await apiService.getInstance().activiti.appsApi.getAppDefinitions();
|
||||
deployedApp = appDefinitions.data.find((currentApp) => {
|
||||
return currentApp.modelId === appModel.id;
|
||||
});
|
||||
process = await new ProcessUtil(apiService).startProcessByDefinitionName(appModel.name, app.processName);
|
||||
deployedAppId = await applicationsService.getAppDefinitionId(appModel.id);
|
||||
|
||||
process = await processUtil.startProcessByDefinitionName(appModel.name, app.processName);
|
||||
await loginPage.login(processUserModel.username, processUserModel.password);
|
||||
});
|
||||
|
||||
beforeEach(async () => {
|
||||
await navigationBarPage.clickHomeButton();
|
||||
await (new ProcessServicesPage()).goToAppByAppId(deployedApp.id);
|
||||
await (new ProcessServicesPage()).goToAppByAppId(deployedAppId);
|
||||
await taskPage.filtersPage().goToFilter(CONSTANTS.TASK_FILTERS.MY_TASKS);
|
||||
await taskPage.formFields().checkFormIsDisplayed();
|
||||
});
|
||||
|
||||
afterAll(async () => {
|
||||
await apiService.getInstance().activiti.processApi.deleteProcessInstance(process.id);
|
||||
await processUtil.cancelProcessInstance(process.id);
|
||||
await apiService.loginWithProfile('admin');
|
||||
await apiService.getInstance().activiti.adminTenantsApi.deleteTenant(processUserModel.tenantId);
|
||||
await usersActions.deleteTenant(processUserModel.tenantId);
|
||||
});
|
||||
|
||||
it('[C309647] Should be able to see Checkbox widget when visibility condition refers to another field with specific value', async () => {
|
||||
|
||||
Reference in New Issue
Block a user