[MIGRATION] - Solving a funny comment issue part 2

This commit is contained in:
VitoAlbano
2024-08-06 00:52:07 +01:00
parent 3e00a1fe65
commit 530b2be382
5 changed files with 64 additions and 31 deletions

View File

@@ -22,7 +22,6 @@ import { Logger } from '../../utils/logger';
import { browser } from 'protractor';
export class GroupIdentityService {
api: ApiService;
constructor(api: ApiService) {
@@ -42,7 +41,9 @@ export class GroupIdentityService {
async createGroup(groupName: string): Promise<any> {
const path = '/groups';
const method = 'POST';
const queryParams = { /* empty */ };
const queryParams = {
/* empty */
};
const postBody = {
name: `${groupName}-${browser.params.groupSuffix}`
};
@@ -53,8 +54,12 @@ export class GroupIdentityService {
async deleteGroup(groupId: string): Promise<any> {
const path = `/groups/${groupId}`;
const method = 'DELETE';
const queryParams = { /* empty */ };
const postBody = { /* empty */ };
const queryParams = {
/* empty */
};
const postBody = {
/* empty */
};
const data = await this.api.performIdentityOperation(path, method, queryParams, postBody);
return data;
}
@@ -69,15 +74,18 @@ export class GroupIdentityService {
const path = `/groups`;
const method = 'GET';
const queryParams = { search: groupName };
const postBody = { /* empty */ };
const postBody = {
/* empty */
};
const data = await this.api.performIdentityOperation(path, method, queryParams, postBody);
Logger.log(`Data ${JSON.stringify(data)}`);
return data[0]; Logger.error('Group not found');
return data[0];
Logger.error('Group not found');
} catch (error) {
/* ignore */
}
};
@@ -89,7 +97,9 @@ export class GroupIdentityService {
const path = `/groups/${groupId}/role-mappings/realm`;
const method = 'POST';
const queryParams = { /* empty */ };
const queryParams = {
/* empty */
};
const postBody = [{ id: roleId, name: roleName }];
const data = await this.api.performIdentityOperation(path, method, queryParams, postBody);
@@ -107,7 +117,9 @@ export class GroupIdentityService {
async addClientRole(groupId: string, clientId: string, roleId: string, roleName: string): Promise<any> {
const path = `/groups/${groupId}/role-mappings/clients/${clientId}`;
const method = 'POST';
const queryParams = { /* empty */ };
const queryParams = {
/* empty */
};
const postBody = [
{
id: roleId,
@@ -130,10 +142,11 @@ export class GroupIdentityService {
const path = `/clients`;
const method = 'GET';
const queryParams = { clientId: applicationName };
const postBody = { /* empty */ };
const postBody = {
/* empty */
};
const data = await this.api.performIdentityOperation(path, method, queryParams, postBody);
return data[0].id;
}
}

View File

@@ -43,6 +43,7 @@ export class LoginPage {
try {
currentUrl = await browser.getCurrentUrl();
} catch (e) {
/* empty */
}
if (!currentUrl || currentUrl.indexOf(this.loginUrl) === -1) {
@@ -87,7 +88,7 @@ export class LoginPage {
if (oauth2 && oauth2.silentLogin === false) {
Logger.log(`Login SSO`);
await this.clickOnSSOButton();
}else{
} else {
Logger.log(`Login SSO silent login`);
}