Skip to content

Commit

Permalink
Delete role after test finish
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 4aaa782 commit 2db785f
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 @@ -52,6 +52,7 @@ if (Cypress.env('WORKSPACE_ENABLED')) {
cy.deleteWorkspaceById(workspaceId);
if (Cypress.env('SECURITY_ENABLED')) {
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 @@ -46,6 +46,14 @@ Cypress.Commands.add('createRole', (roleID, roleJson) => {
cy.wait(10000);
});

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

Cypress.Commands.add('createRoleMapping', (roleID, rolemappingJson) => {
cy.request(
'PUT',
Expand Down

0 comments on commit 2db785f

Please sign in to comment.