mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-24 17:32:15 +00:00
Enable tests and add a newly created user to run the tests. (#4796)
* enabled tests and added the new user to run the tests. * lint fix * adding a new user and add the user to hr group which will be used when deploying the apps. * Test commit * adding a new user and add the user to hr group which will be used when deploying the apps. * linting fixes * crc's moved the roles constants to identityService. * crc's moved the roles constants to identityService. * wrapped the createIdentityUser and assign Role calls into 1 method and used in the tests. * wrapped the createIdentityUser and assign Role calls into 1 method and used in the tests. * Added a method in identityService to pass the required roles to be added in a string array. * linting fixes * added the command line arguments to run the e2e tests -identity_admin_email and -identity_admin_password * added the command line arguments to run the e2e tests -identity_admin_email and -identity_admin_password * crc's, removed the step to add user to the hr group, as not needed in this test. * renamed the E2E travis variable to end with identity. * replaced the candidateuserapp with candidatebaseapp * replaced candidateuserapp with candidatebaseapp * replaced candidateuserapp with candidatebaseapp * replaced candidateuserapp with candidatebaseapp * timeout wait for the test to pass. * crc's
This commit is contained in:
committed by
Eugenio Romano
parent
3d73e94b5d
commit
e65e32e0cf
@@ -20,7 +20,17 @@ import CONSTANTS = require('../util/constants');
|
||||
import moment = require('moment');
|
||||
|
||||
import { NavigationBarPage } from '../pages/adf/navigationBarPage';
|
||||
import { ApiService, StringUtil, LoginSSOPage, ProcessDefinitionsService, ProcessInstancesService, QueryService, SettingsPage } from '@alfresco/adf-testing';
|
||||
import {
|
||||
ApiService,
|
||||
StringUtil,
|
||||
LoginSSOPage,
|
||||
ProcessDefinitionsService,
|
||||
ProcessInstancesService,
|
||||
QueryService,
|
||||
SettingsPage,
|
||||
IdentityService,
|
||||
GroupIdentityService
|
||||
} from '@alfresco/adf-testing';
|
||||
import { AppListCloudPage } from '@alfresco/adf-testing';
|
||||
import { TasksCloudDemoPage } from '../pages/adf/demo-shell/process-services/tasksCloudDemoPage';
|
||||
import { ProcessHeaderCloudPage } from '@alfresco/adf-testing';
|
||||
@@ -44,20 +54,30 @@ describe('Process Header cloud component', () => {
|
||||
const tasksCloudDemoPage = new TasksCloudDemoPage();
|
||||
const processCloudDemoPage = new ProcessCloudDemoPage();
|
||||
const settingsPage = new SettingsPage();
|
||||
const apiService = new ApiService(
|
||||
browser.params.config.oauth2.clientId,
|
||||
browser.params.config.bpmHost, browser.params.config.oauth2.host, browser.params.config.providers
|
||||
);
|
||||
|
||||
let processDefinitionService: ProcessDefinitionsService;
|
||||
let processInstancesService: ProcessInstancesService;
|
||||
let queryService: QueryService;
|
||||
let identityService: IdentityService;
|
||||
let groupIdentityService: GroupIdentityService;
|
||||
let testUser, groupInfo;
|
||||
|
||||
let runningProcess, runningCreatedDate, parentCompleteProcess, childCompleteProcess, completedCreatedDate;
|
||||
|
||||
beforeAll(async (done) => {
|
||||
const apiService = new ApiService(
|
||||
browser.params.config.oauth2.clientId,
|
||||
browser.params.config.bpmHost, browser.params.config.oauth2.host, browser.params.config.providers
|
||||
);
|
||||
await apiService.login(browser.params.identityUser.email, browser.params.identityUser.password);
|
||||
|
||||
await apiService.login(browser.params.identityAdmin.email, browser.params.identityAdmin.password);
|
||||
identityService = new IdentityService(apiService);
|
||||
groupIdentityService = new GroupIdentityService(apiService);
|
||||
testUser = await identityService.createIdentityUserWithRole(apiService, [identityService.roles.aps_user]);
|
||||
groupInfo = await groupIdentityService.getGroupInfoByGroupName('hr');
|
||||
await identityService.addUserToGroup(testUser.idIdentityService, groupInfo.id);
|
||||
|
||||
await apiService.login(testUser.email, testUser.password);
|
||||
processDefinitionService = new ProcessDefinitionsService(apiService);
|
||||
const processDefinition = await processDefinitionService.getProcessDefinitions(simpleApp);
|
||||
const childProcessDefinition = await processDefinitionService.getProcessDefinitions(subProcessApp);
|
||||
@@ -80,7 +100,13 @@ describe('Process Header cloud component', () => {
|
||||
browser.params.config.bpmHost,
|
||||
browser.params.config.oauth2.host,
|
||||
browser.params.config.identityHost);
|
||||
loginSSOPage.loginSSOIdentityService(browser.params.identityUser.email, browser.params.identityUser.password);
|
||||
loginSSOPage.loginSSOIdentityService(testUser.email, testUser.password);
|
||||
done();
|
||||
});
|
||||
|
||||
afterAll(async(done) => {
|
||||
await apiService.login(browser.params.identityAdmin.email, browser.params.identityAdmin.password);
|
||||
await identityService.deleteIdentityUser(testUser.idIdentityService);
|
||||
done();
|
||||
});
|
||||
|
||||
|
Reference in New Issue
Block a user