mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-24 17:32:15 +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 () => {
|
||||
|
Reference in New Issue
Block a user