mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-24 17:32:15 +00:00
[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:
committed by
Eugenio Romano
parent
9a5165599d
commit
53dc5f0b91
@@ -25,6 +25,24 @@ export class RolesService {
|
|||||||
this.api = api;
|
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> {
|
async getRoleIdByRoleName(roleName): Promise<any> {
|
||||||
const path = `/roles`;
|
const path = `/roles`;
|
||||||
const method = 'GET';
|
const method = 'GET';
|
||||||
|
@@ -41,6 +41,7 @@ export class PaginationPage {
|
|||||||
await browser.executeScript(`document.querySelector('div[class*="adf-pagination__perpage-block"] button').click();`);
|
await browser.executeScript(`document.querySelector('div[class*="adf-pagination__perpage-block"] button').click();`);
|
||||||
await BrowserVisibility.waitUntilElementIsVisible(this.pageSelectorDropDown);
|
await BrowserVisibility.waitUntilElementIsVisible(this.pageSelectorDropDown);
|
||||||
const itemsPerPage = element.all(by.cssContainingText('.mat-menu-item', numberOfItem)).first();
|
const itemsPerPage = element.all(by.cssContainingText('.mat-menu-item', numberOfItem)).first();
|
||||||
|
await BrowserVisibility.waitUntilElementIsPresent(itemsPerPage);
|
||||||
await BrowserActions.click(itemsPerPage);
|
await BrowserActions.click(itemsPerPage);
|
||||||
await BrowserVisibility.waitUntilElementIsNotVisible(this.pageSelectorDropDown);
|
await BrowserVisibility.waitUntilElementIsNotVisible(this.pageSelectorDropDown);
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user