[DW-1328] added the create and delete role api for test preconditions (#5052)

* added the create and delete role api for test preconditions

* added the required visibility conditions, for the method to work consistently across apps

* removed the visibility conditions that are not necessary
This commit is contained in:
Geeta Mandakini Ayyalasomayajula
2019-09-04 18:43:39 +01:00
committed by Eugenio Romano
parent 9a5165599d
commit 53dc5f0b91
2 changed files with 19 additions and 0 deletions

View File

@@ -25,6 +25,24 @@ export class RolesService {
this.api = api;
}
async createRole(roleName: string): Promise<any> {
const path = '/roles';
const method = 'POST';
const queryParams = {}, postBody = {
name: roleName + 'TestRole'
};
const data = await this.api.performIdentityOperation(path, method, queryParams, postBody);
return data;
}
async deleteRole(roleId): Promise<any> {
const path = `/roles-by-id/${roleId}`;
const method = 'DELETE';
const queryParams = {}, postBody = {};
const data = await this.api.performIdentityOperation(path, method, queryParams, postBody);
return data;
}
async getRoleIdByRoleName(roleName): Promise<any> {
const path = `/roles`;
const method = 'GET';

View File

@@ -41,6 +41,7 @@ export class PaginationPage {
await browser.executeScript(`document.querySelector('div[class*="adf-pagination__perpage-block"] button').click();`);
await BrowserVisibility.waitUntilElementIsVisible(this.pageSelectorDropDown);
const itemsPerPage = element.all(by.cssContainingText('.mat-menu-item', numberOfItem)).first();
await BrowserVisibility.waitUntilElementIsPresent(itemsPerPage);
await BrowserActions.click(itemsPerPage);
await BrowserVisibility.waitUntilElementIsNotVisible(this.pageSelectorDropDown);
}