diff --git a/cypress/integration/core-opensearch-dashboards/opensearch-dashboards/workspace-plugin/mds_workspace_detail.spec.js b/cypress/integration/core-opensearch-dashboards/opensearch-dashboards/workspace-plugin/mds_workspace_detail.spec.js index 5f2fa12b1..9bc7420f3 100644 --- a/cypress/integration/core-opensearch-dashboards/opensearch-dashboards/workspace-plugin/mds_workspace_detail.spec.js +++ b/cypress/integration/core-opensearch-dashboards/opensearch-dashboards/workspace-plugin/mds_workspace_detail.spec.js @@ -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); } }); diff --git a/cypress/utils/plugins/security-dashboards-plugin/commands.js b/cypress/utils/plugins/security-dashboards-plugin/commands.js index 25fa2a5f4..8a407ec65 100644 --- a/cypress/utils/plugins/security-dashboards-plugin/commands.js +++ b/cypress/utils/plugins/security-dashboards-plugin/commands.js @@ -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',