[ADF-4576]Add new tests for application cloud component (#4873)

* Add a new test

* Revert file

* Fix lint errors

* Add a wait

* fix roles constant uppercase

* fix lint
This commit is contained in:
cristinaj
2019-06-26 21:47:09 +03:00
committed by Eugenio Romano
parent 069e4297ea
commit 5c5bb7f9b7
25 changed files with 146 additions and 63 deletions

View File

@@ -126,7 +126,8 @@
"uncheck",
"subfolders",
"ECMBPM",
"processwithvariables"
"processwithvariables",
"devops"
],
"dictionaries": [
"html",

View File

@@ -16,7 +16,7 @@
*/
import { browser } from 'protractor';
import { ApiService, IdentityService, LoginSSOPage, SettingsPage } from '@alfresco/adf-testing';
import { ApiService, IdentityService, LoginSSOPage, SettingsPage, LocalStorageUtil, ApplicationsService } from '@alfresco/adf-testing';
import { AppListCloudPage } from '@alfresco/adf-testing';
import { NavigationBarPage } from '../pages/adf/navigationBarPage';
import resources = require('../util/resources');
@@ -29,18 +29,31 @@ describe('Applications list', () => {
const appListCloudPage = new AppListCloudPage();
const simpleApp = resources.ACTIVITI7_APPS.SIMPLE_APP.name;
let identityService: IdentityService;
let applicationsService: ApplicationsService;
let testUser;
const appNames = [];
let applications;
const apiService = new ApiService(browser.params.config.oauth2.clientId, browser.params.config.bpmHost, browser.params.config.oauth2.host, 'BPM');
beforeAll(async (done) => {
await apiService.login(browser.params.identityAdmin.email, browser.params.identityAdmin.password);
identityService = new IdentityService(apiService);
testUser = await identityService.createIdentityUserWithRole(apiService, [identityService.roles.aps_user]);
testUser = await identityService.createIdentityUserWithRole(apiService, [identityService.ROLES.APS_USER, identityService.ROLES.APS_DEVOPS_USER]);
await settingsPage.setProviderBpmSso(
browser.params.config.bpmHost,
browser.params.config.oauth2.host,
browser.params.config.identityHost);
loginSSOPage.loginSSOIdentityService(testUser.email, testUser.password);
await apiService.login(testUser.email, testUser.password);
applicationsService = new ApplicationsService(apiService);
applications = await applicationsService.getApplicationsByStatus('RUNNING');
applications.list.entries.forEach(async (app) => {
appNames.push(app.entry.name.toLowerCase());
});
await LocalStorageUtil.setConfigField('alfresco-deployed-apps', '[]');
done();
});
@@ -50,11 +63,24 @@ describe('Applications list', () => {
done();
});
it('[C310373] Should all the app with running state be displayed on dashboard when alfresco-deployed-apps is not used in config file', async () => {
navigationBarPage.navigateToProcessServicesCloudPage();
appListCloudPage.checkApsContainer();
appListCloudPage.getNameOfTheApplications().then((list) => {
expect(JSON.stringify(list) === JSON.stringify(appNames)).toEqual(true);
});
});
it('[C289910] Should the app be displayed on dashboard when is deployed on APS', () => {
browser.refresh();
navigationBarPage.navigateToProcessServicesCloudPage();
appListCloudPage.checkApsContainer();
appListCloudPage.checkAppIsDisplayed(simpleApp);
appListCloudPage.goToApp(simpleApp);
appListCloudPage.checkAppIsDisplayed(resources.ACTIVITI7_APPS.CANDIDATE_BASE_APP.name);
appListCloudPage.checkAppIsDisplayed(resources.ACTIVITI7_APPS.SUB_PROCESS_APP.name);
expect(appListCloudPage.countAllApps()).toEqual(3);
});
});

View File

@@ -43,7 +43,7 @@ describe('Edit process filters cloud', () => {
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]);
testUser = await identityService.createIdentityUserWithRole(apiService, [identityService.ROLES.APS_USER]);
groupInfo = await groupIdentityService.getGroupInfoByGroupName('hr');
await identityService.addUserToGroup(testUser.idIdentityService, groupInfo.id);

View File

@@ -44,7 +44,7 @@ describe('Edit task filters cloud', () => {
identityService = new IdentityService(apiService);
groupIdentityService = new GroupIdentityService(apiService);
tasksService = new TasksService(apiService);
testUser = await identityService.createIdentityUserWithRole(apiService, [identityService.roles.aps_user]);
testUser = await identityService.createIdentityUserWithRole(apiService, [identityService.ROLES.APS_USER]);
groupInfo = await groupIdentityService.getGroupInfoByGroupName('hr');
await identityService.addUserToGroup(testUser.idIdentityService, groupInfo.id);

View File

@@ -56,7 +56,7 @@ describe('Form Field Component - Dropdown Widget', () => {
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]);
testUser = await identityService.createIdentityUserWithRole(apiService, [identityService.ROLES.APS_USER]);
groupInfo = await groupIdentityService.getGroupInfoByGroupName('hr');
await identityService.addUserToGroup(testUser.idIdentityService, groupInfo.id);

View File

@@ -62,27 +62,27 @@ describe('People Groups Cloud Component', () => {
groupIdentityService = new GroupIdentityService(apiService);
clientId = await groupIdentityService.getClientIdByApplicationName(resources.ACTIVITI7_APPS.SIMPLE_APP.name);
groupActiviti = await groupIdentityService.createIdentityGroup();
clientActivitiAdminRoleId = await rolesService.getClientRoleIdByRoleName(groupActiviti.id, clientId, identityService.roles.activiti_admin);
clientActivitiUserRoleId = await rolesService.getClientRoleIdByRoleName(groupActiviti.id, clientId, identityService.roles.activiti_user);
clientActivitiAdminRoleId = await rolesService.getClientRoleIdByRoleName(groupActiviti.id, clientId, identityService.ROLES.ACTIVITI_ADMIN);
clientActivitiUserRoleId = await rolesService.getClientRoleIdByRoleName(groupActiviti.id, clientId, identityService.ROLES.ACTIVITI_USER);
testUser = await identityService.createIdentityUserWithRole(apiService, [identityService.roles.aps_user]);
apsUser = await identityService.createIdentityUserWithRole(apiService, [identityService.roles.aps_user]);
activitiUser = await identityService.createIdentityUserWithRole(apiService, [identityService.roles.activiti_user]);
testUser = await identityService.createIdentityUserWithRole(apiService, [identityService.ROLES.APS_USER]);
apsUser = await identityService.createIdentityUserWithRole(apiService, [identityService.ROLES.APS_USER]);
activitiUser = await identityService.createIdentityUserWithRole(apiService, [identityService.ROLES.ACTIVITI_USER]);
noRoleUser = await identityService.createIdentityUser();
await identityService.deleteClientRole(noRoleUser.idIdentityService, clientId, clientActivitiAdminRoleId, identityService.roles.activiti_admin);
await identityService.deleteClientRole(noRoleUser.idIdentityService, clientId, clientActivitiUserRoleId, identityService.roles.activiti_user);
await identityService.deleteClientRole(noRoleUser.idIdentityService, clientId, clientActivitiAdminRoleId, identityService.ROLES.ACTIVITI_ADMIN);
await identityService.deleteClientRole(noRoleUser.idIdentityService, clientId, clientActivitiUserRoleId, identityService.ROLES.ACTIVITI_USER);
groupAps = await groupIdentityService.createIdentityGroup();
apsAdminRoleId = await rolesService.getRoleIdByRoleName(identityService.roles.aps_admin);
apsUserRoleId = await rolesService.getRoleIdByRoleName(identityService.roles.aps_user);
await groupIdentityService.assignRole(groupAps.id, apsAdminRoleId, identityService.roles.aps_admin);
await groupIdentityService.assignRole(groupAps.id, apsUserRoleId, identityService.roles.aps_user);
activitiAdminRoleId = await rolesService.getRoleIdByRoleName(identityService.roles.activiti_admin);
await groupIdentityService.assignRole(groupActiviti.id, activitiAdminRoleId, identityService.roles.activiti_admin);
apsAdminRoleId = await rolesService.getRoleIdByRoleName(identityService.ROLES.APS_ADMIN);
apsUserRoleId = await rolesService.getRoleIdByRoleName(identityService.ROLES.APS_USER);
await groupIdentityService.assignRole(groupAps.id, apsAdminRoleId, identityService.ROLES.APS_ADMIN);
await groupIdentityService.assignRole(groupAps.id, apsUserRoleId, identityService.ROLES.APS_USER);
activitiAdminRoleId = await rolesService.getRoleIdByRoleName(identityService.ROLES.ACTIVITI_ADMIN);
await groupIdentityService.assignRole(groupActiviti.id, activitiAdminRoleId, identityService.ROLES.ACTIVITI_ADMIN);
groupNoRole = await groupIdentityService.createIdentityGroup();
await groupIdentityService.addClientRole(groupAps.id, clientId, clientActivitiAdminRoleId, identityService.roles.activiti_admin);
await groupIdentityService.addClientRole(groupActiviti.id, clientId, clientActivitiAdminRoleId, identityService.roles.activiti_admin);
await groupIdentityService.addClientRole(groupAps.id, clientId, clientActivitiAdminRoleId, identityService.ROLES.ACTIVITI_ADMIN);
await groupIdentityService.addClientRole(groupActiviti.id, clientId, clientActivitiAdminRoleId, identityService.ROLES.ACTIVITI_ADMIN);
users = [`${apsUser.idIdentityService}`, `${activitiUser.idIdentityService}`, `${noRoleUser.idIdentityService}`, `${testUser.idIdentityService}`];
groups = [`${groupAps.id}`, `${groupActiviti.id}`, `${groupNoRole.id}`];
@@ -134,7 +134,7 @@ describe('People Groups Cloud Component', () => {
});
it('One role filtering', () => {
peopleGroupCloudComponentPage.enterPeopleRoles(`["${identityService.roles.aps_user}"]`);
peopleGroupCloudComponentPage.enterPeopleRoles(`["${identityService.ROLES.APS_USER}"]`);
peopleCloudComponent.searchAssignee(apsUser.lastName);
peopleCloudComponent.checkUserIsDisplayed(`${apsUser.firstName} ${apsUser.lastName}`);
peopleCloudComponent.searchAssignee(activitiUser.lastName);
@@ -144,7 +144,7 @@ describe('People Groups Cloud Component', () => {
});
it('Multiple roles filtering', () => {
peopleGroupCloudComponentPage.enterPeopleRoles(`["${identityService.roles.aps_user}", "${identityService.roles.activiti_user}"]`);
peopleGroupCloudComponentPage.enterPeopleRoles(`["${identityService.ROLES.APS_USER}", "${identityService.ROLES.ACTIVITI_USER}"]`);
peopleCloudComponent.searchAssignee(apsUser.lastName);
peopleCloudComponent.checkUserIsDisplayed(`${apsUser.firstName} ${apsUser.lastName}`);
peopleCloudComponent.searchAssignee(activitiUser.lastName);
@@ -172,7 +172,7 @@ describe('People Groups Cloud Component', () => {
});
it('One role filtering', () => {
peopleGroupCloudComponentPage.enterGroupRoles(`["${identityService.roles.aps_admin}"]`);
peopleGroupCloudComponentPage.enterGroupRoles(`["${identityService.ROLES.APS_ADMIN}"]`);
groupCloudComponentPage.searchGroups(groupAps.name);
groupCloudComponentPage.checkGroupIsDisplayed(groupAps.name);
groupCloudComponentPage.searchGroups(groupActiviti.name);
@@ -182,7 +182,7 @@ describe('People Groups Cloud Component', () => {
});
it('[C309996] Should be able to filter groups based on composite roles Activit_Admin', () => {
peopleGroupCloudComponentPage.enterGroupRoles(`["${identityService.roles.activiti_admin}"]`);
peopleGroupCloudComponentPage.enterGroupRoles(`["${identityService.ROLES.ACTIVITI_ADMIN}"]`);
groupCloudComponentPage.searchGroups(groupActiviti.name);
groupCloudComponentPage.checkGroupIsDisplayed(groupActiviti.name);
groupCloudComponentPage.searchGroups(groupNoRole.name);
@@ -192,7 +192,7 @@ describe('People Groups Cloud Component', () => {
});
it('[C309996] Should be able to filter groups based on composite roles Aps_User', () => {
peopleGroupCloudComponentPage.enterGroupRoles(`["${identityService.roles.aps_user}"]`);
peopleGroupCloudComponentPage.enterGroupRoles(`["${identityService.ROLES.APS_USER}"]`);
groupCloudComponentPage.searchGroups(groupActiviti.name);
groupCloudComponentPage.checkGroupIsNotDisplayed(groupActiviti.name);
groupCloudComponentPage.searchGroups(groupNoRole.name);
@@ -202,7 +202,7 @@ describe('People Groups Cloud Component', () => {
});
it('[C309996] Should be able to filter groups based on composite roles Activiti_User', () => {
peopleGroupCloudComponentPage.enterGroupRoles(`["${identityService.roles.activiti_user}"]`);
peopleGroupCloudComponentPage.enterGroupRoles(`["${identityService.ROLES.ACTIVITI_USER}"]`);
groupCloudComponentPage.searchGroups(groupActiviti.name);
groupCloudComponentPage.checkGroupIsNotDisplayed(groupActiviti.name);
groupCloudComponentPage.searchGroups(groupNoRole.name);
@@ -212,7 +212,7 @@ describe('People Groups Cloud Component', () => {
});
it('Multiple roles filtering', () => {
peopleGroupCloudComponentPage.enterGroupRoles(`["${identityService.roles.aps_admin}", "${identityService.roles.activiti_admin}"]`);
peopleGroupCloudComponentPage.enterGroupRoles(`["${identityService.ROLES.APS_ADMIN}", "${identityService.ROLES.ACTIVITI_ADMIN}"]`);
groupCloudComponentPage.searchGroups(groupActiviti.name);
groupCloudComponentPage.checkGroupIsDisplayed(groupActiviti.name);
groupCloudComponentPage.searchGroups(groupAps.name);

View File

@@ -60,25 +60,25 @@ describe('People Groups Cloud Component', () => {
groupIdentityService = new GroupIdentityService(apiService);
clientId = await groupIdentityService.getClientIdByApplicationName(resources.ACTIVITI7_APPS.SIMPLE_APP.name);
groupActiviti = await groupIdentityService.createIdentityGroup();
clientActivitiAdminRoleId = await rolesService.getClientRoleIdByRoleName(groupActiviti.id, clientId, identityService.roles.activiti_admin);
clientActivitiUserRoleId = await rolesService.getClientRoleIdByRoleName(groupActiviti.id, clientId, identityService.roles.activiti_user);
clientActivitiAdminRoleId = await rolesService.getClientRoleIdByRoleName(groupActiviti.id, clientId, identityService.ROLES.ACTIVITI_ADMIN);
clientActivitiUserRoleId = await rolesService.getClientRoleIdByRoleName(groupActiviti.id, clientId, identityService.ROLES.ACTIVITI_USER);
testUser = await identityService.createIdentityUserWithRole(apiService, [identityService.roles.aps_user]);
apsUser = await identityService.createIdentityUserWithRole(apiService, [identityService.roles.aps_user]);
activitiUser = await identityService.createIdentityUserWithRole(apiService, [identityService.roles.activiti_user]);
testUser = await identityService.createIdentityUserWithRole(apiService, [identityService.ROLES.APS_USER]);
apsUser = await identityService.createIdentityUserWithRole(apiService, [identityService.ROLES.APS_USER]);
activitiUser = await identityService.createIdentityUserWithRole(apiService, [identityService.ROLES.ACTIVITI_USER]);
noRoleUser = await identityService.createIdentityUser();
await identityService.deleteClientRole(noRoleUser.idIdentityService, clientId, clientActivitiAdminRoleId, identityService.roles.activiti_admin);
await identityService.deleteClientRole(noRoleUser.idIdentityService, clientId, clientActivitiUserRoleId, identityService.roles.activiti_user);
await identityService.deleteClientRole(noRoleUser.idIdentityService, clientId, clientActivitiAdminRoleId, identityService.ROLES.ACTIVITI_ADMIN);
await identityService.deleteClientRole(noRoleUser.idIdentityService, clientId, clientActivitiUserRoleId, identityService.ROLES.ACTIVITI_USER);
groupAps = await groupIdentityService.createIdentityGroup();
apsAdminRoleId = await rolesService.getRoleIdByRoleName(identityService.roles.aps_admin);
await groupIdentityService.assignRole(groupAps.id, apsAdminRoleId, identityService.roles.aps_admin);
activitiAdminRoleId = await rolesService.getRoleIdByRoleName(identityService.roles.activiti_admin);
await groupIdentityService.assignRole(groupActiviti.id, activitiAdminRoleId, identityService.roles.activiti_admin);
apsAdminRoleId = await rolesService.getRoleIdByRoleName(identityService.ROLES.APS_ADMIN);
await groupIdentityService.assignRole(groupAps.id, apsAdminRoleId, identityService.ROLES.APS_ADMIN);
activitiAdminRoleId = await rolesService.getRoleIdByRoleName(identityService.ROLES.ACTIVITI_ADMIN);
await groupIdentityService.assignRole(groupActiviti.id, activitiAdminRoleId, identityService.ROLES.ACTIVITI_ADMIN);
groupNoRole = await groupIdentityService.createIdentityGroup();
await groupIdentityService.addClientRole(groupAps.id, clientId, clientActivitiAdminRoleId, identityService.roles.activiti_admin );
await groupIdentityService.addClientRole(groupActiviti.id, clientId, clientActivitiAdminRoleId, identityService.roles.activiti_admin );
await groupIdentityService.addClientRole(groupAps.id, clientId, clientActivitiAdminRoleId, identityService.ROLES.ACTIVITI_ADMIN );
await groupIdentityService.addClientRole(groupActiviti.id, clientId, clientActivitiAdminRoleId, identityService.ROLES.ACTIVITI_ADMIN );
users = [`${apsUser.idIdentityService}`, `${activitiUser.idIdentityService}`, `${noRoleUser.idIdentityService}`, `${testUser.idIdentityService}`];
groups = [`${groupAps.id}`, `${groupActiviti.id}`, `${groupNoRole.id}`];

View File

@@ -61,7 +61,7 @@ describe('Process list cloud', () => {
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]);
testUser = await identityService.createIdentityUserWithRole(apiService, [identityService.ROLES.APS_USER]);
groupInfo = await groupIdentityService.getGroupInfoByGroupName('hr');
await identityService.addUserToGroup(testUser.idIdentityService, groupInfo.id);

View File

@@ -67,8 +67,8 @@ describe('Process filters cloud', () => {
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]);
anotherUser = await identityService.createIdentityUserWithRole(apiService, [identityService.roles.aps_user]);
testUser = await identityService.createIdentityUserWithRole(apiService, [identityService.ROLES.APS_USER]);
anotherUser = await identityService.createIdentityUserWithRole(apiService, [identityService.ROLES.APS_USER]);
groupInfo = await groupIdentityService.getGroupInfoByGroupName('hr');
await identityService.addUserToGroup(testUser.idIdentityService, groupInfo.id);

View File

@@ -61,7 +61,7 @@ describe('Process filters cloud', () => {
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]);
testUser = await identityService.createIdentityUserWithRole(apiService, [identityService.ROLES.APS_USER]);
groupInfo = await groupIdentityService.getGroupInfoByGroupName('hr');
await identityService.addUserToGroup(testUser.idIdentityService, groupInfo.id);

View File

@@ -73,7 +73,7 @@ describe('Process Header cloud component', () => {
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]);
testUser = await identityService.createIdentityUserWithRole(apiService, [identityService.ROLES.APS_USER]);
groupInfo = await groupIdentityService.getGroupInfoByGroupName('hr');
await identityService.addUserToGroup(testUser.idIdentityService, groupInfo.id);

View File

@@ -55,7 +55,7 @@ describe('Process list cloud', () => {
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]);
testUser = await identityService.createIdentityUserWithRole(apiService, [identityService.ROLES.APS_USER]);
groupInfo = await groupIdentityService.getGroupInfoByGroupName('hr');
await identityService.addUserToGroup(testUser.idIdentityService, groupInfo.id);

View File

@@ -52,7 +52,7 @@ describe('Process list cloud', () => {
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]);
testUser = await identityService.createIdentityUserWithRole(apiService, [identityService.ROLES.APS_USER]);
groupInfo = await groupIdentityService.getGroupInfoByGroupName('hr');
await identityService.addUserToGroup(testUser.idIdentityService, groupInfo.id);

View File

@@ -51,7 +51,7 @@ describe('Start Process', () => {
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]);
testUser = await identityService.createIdentityUserWithRole(apiService, [identityService.ROLES.APS_USER]);
groupInfo = await groupIdentityService.getGroupInfoByGroupName('hr');
await identityService.addUserToGroup(testUser.idIdentityService, groupInfo.id);
await settingsPage.setProviderBpmSso(

View File

@@ -58,8 +58,8 @@ describe('Start Task', () => {
identityService = new IdentityService(apiService);
groupIdentityService = new GroupIdentityService(apiService);
testUser = await identityService.createIdentityUserWithRole(apiService, [identityService.roles.aps_user]);
apsUser = await identityService.createIdentityUserWithRole(apiService, [identityService.roles.aps_user, identityService.roles.activiti_user]);
testUser = await identityService.createIdentityUserWithRole(apiService, [identityService.ROLES.APS_USER]);
apsUser = await identityService.createIdentityUserWithRole(apiService, [identityService.ROLES.APS_USER, identityService.ROLES.ACTIVITI_USER]);
activitiUser = await identityService.createIdentityUser();
groupInfo = await groupIdentityService.getGroupInfoByGroupName('hr');

View File

@@ -70,7 +70,7 @@ describe('Start Task Form', () => {
identityService = new IdentityService(apiService);
groupIdentityService = new GroupIdentityService(apiService);
testUser = await identityService.createIdentityUserWithRole(apiService, [identityService.roles.aps_user]);
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);

View File

@@ -43,7 +43,7 @@ describe('Task filters cloud', () => {
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]);
testUser = await identityService.createIdentityUserWithRole(apiService, [identityService.ROLES.APS_USER]);
groupInfo = await groupIdentityService.getGroupInfoByGroupName('hr');
await identityService.addUserToGroup(testUser.idIdentityService, groupInfo.id);

View File

@@ -57,7 +57,7 @@ describe('Task Header cloud component', () => {
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]);
testUser = await identityService.createIdentityUserWithRole(apiService, [identityService.ROLES.APS_USER]);
groupInfo = await groupIdentityService.getGroupInfoByGroupName('hr');
await identityService.addUserToGroup(testUser.idIdentityService, groupInfo.id);

View File

@@ -64,7 +64,7 @@ describe('Edit task filters and task list properties', () => {
tasksService = new TasksService(apiService);
const settingsPage = new SettingsPage();
testUser = await identityService.createIdentityUserWithRole(apiService, [identityService.roles.aps_user]);
testUser = await identityService.createIdentityUserWithRole(apiService, [identityService.ROLES.APS_USER]);
groupInfo = await groupIdentityService.getGroupInfoByGroupName('hr');
await identityService.addUserToGroup(testUser.idIdentityService, groupInfo.id);

View File

@@ -50,7 +50,7 @@ describe('Task list cloud - selection', () => {
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]);
testUser = await identityService.createIdentityUserWithRole(apiService, [identityService.ROLES.APS_USER]);
groupInfo = await groupIdentityService.getGroupInfoByGroupName('hr');
await identityService.addUserToGroup(testUser.idIdentityService, groupInfo.id);

View File

@@ -64,7 +64,7 @@ describe('Task filters cloud', () => {
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]);
testUser = await identityService.createIdentityUserWithRole(apiService, [identityService.ROLES.APS_USER]);
groupInfo = await groupIdentityService.getGroupInfoByGroupName('hr');
await identityService.addUserToGroup(testUser.idIdentityService, groupInfo.id);

View File

@@ -0,0 +1,42 @@
/*!
* @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 } from '../api.service';
export class ApplicationsService {
api: ApiService;
constructor(api: ApiService) {
this.api = api;
}
async getApplicationsByStatus(status) {
try {
const path = '/deployment-service/v1/applications';
const method = 'GET';
const queryParams = {'status': status}, postBody = {};
return await this.api.performBpmOperation(path, method, queryParams, postBody);
} catch (error) {
// tslint:disable-next-line:no-console
console.log('Get Applications - Service error, Response: ', JSON.parse(JSON.stringify(error)).response.text);
}
}
}

View File

@@ -28,11 +28,12 @@ export class IdentityService {
this.api = api;
}
roles = {
aps_user: 'APS_USER',
activiti_user: 'ACTIVITI_USER',
aps_admin: 'APS_ADMIN',
activiti_admin: 'ACTIVITI_ADMIN'
ROLES = {
APS_USER: 'APS_USER',
ACTIVITI_USER: 'ACTIVITI_USER',
APS_ADMIN: 'APS_ADMIN',
ACTIVITI_ADMIN: 'ACTIVITI_ADMIN',
APS_DEVOPS_USER: 'APS_DEVOPS'
};
async createIdentityUserWithRole(apiService: ApiService, roles: string[]) {

View File

@@ -15,6 +15,7 @@
* limitations under the License.
*/
export * from './applications.service';
export * from './identity.service';
export * from './group-identity.service';
export * from './roles.service';

View File

@@ -22,15 +22,27 @@ import { BrowserActions } from '../../core/utils/browser-actions';
export class AppListCloudPage {
apsAppsContainer = element(by.css('adf-cloud-app-list'));
allApps = element.all(by.css('adf-cloud-app-details'));
nameOfAllApps = element.all(by.css('adf-cloud-app-details div[class*="item-card-title"] h1'));
firstApp = element.all(by.css('adf-cloud-app-details div[class*="item-card-title"] h1')).first();
checkApsContainer() {
BrowserVisibility.waitUntilElementIsVisible(this.apsAppsContainer);
BrowserVisibility.waitUntilElementIsVisible(this.firstApp);
}
goToApp(applicationName) {
BrowserActions.clickExecuteScript('mat-card[title="' + applicationName + '"]');
}
countAllApps() {
return this.allApps.count();
}
getNameOfTheApplications() {
return this.nameOfAllApps.getText();
}
checkAppIsNotDisplayed(applicationName) {
const app = element(by.css('mat-card[title="' + applicationName + '"]'));
return BrowserVisibility.waitUntilElementIsNotOnPage(app);