Skip to content

Commit

Permalink
Delete role mapping
Browse files Browse the repository at this point in the history
Signed-off-by: Lin Wang <[email protected]>
  • Loading branch information
wanglam committed Nov 13, 2024
1 parent aa95152 commit 79df578
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ if (Cypress.env('WORKSPACE_ENABLED')) {
after(() => {
cy.deleteWorkspaceById(workspaceId);
if (Cypress.env('SECURITY_ENABLED')) {
cy.deleteRoleMapping(WORKSPACE_TEST_ROLE_NAME);
cy.deleteInternalUser(NONE_DASHBOARDS_ADMIN_USERNAME);
cy.deleteRole(WORKSPACE_TEST_ROLE_NAME);
}
Expand Down
8 changes: 8 additions & 0 deletions cypress/utils/plugins/security-dashboards-plugin/commands.js
Original file line number Diff line number Diff line change
Expand Up @@ -62,3 +62,11 @@ Cypress.Commands.add('createRoleMapping', (roleID, rolemappingJson) => {
);
cy.wait(10000);
});

Cypress.Commands.add('deleteRoleMapping', (roleID) => {
cy.request(
'DELETE',
`${Cypress.env('openSearchUrl')}${SEC_API.ROLE_MAPPING_BASE}/${roleID}`
);
cy.wait(10000);
});

0 comments on commit 79df578

Please sign in to comment.