mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-24 17:32:15 +00:00
[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:
committed by
Eugenio Romano
parent
069e4297ea
commit
5c5bb7f9b7
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
@@ -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[]) {
|
||||
|
@@ -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';
|
||||
|
@@ -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);
|
||||
|
Reference in New Issue
Block a user