diff --git a/test/cypress/e2e/multi-datasources/multi_datasources_enabled.spec.js b/test/cypress/e2e/multi-datasources/multi_datasources_enabled.spec.js index 261a879b7..41006569e 100644 --- a/test/cypress/e2e/multi-datasources/multi_datasources_enabled.spec.js +++ b/test/cypress/e2e/multi-datasources/multi_datasources_enabled.spec.js @@ -46,15 +46,25 @@ const closeToast = () => { }; const deleteAllDataSources = () => { - cy.visit('http://localhost:5601/app/management/opensearch-dashboards/dataSources'); - - closeToast(); - - cy.get('[data-test-subj="checkboxSelectAll"]').should('exist'); - cy.get('[data-test-subj="checkboxSelectAll"]').click(); - cy.get('[data-test-subj="checkboxSelectAll"]').should('be.checked'); - cy.get('[data-test-subj="deleteDataSourceConnections"]').click(); - cy.get('[data-test-subj="confirmModalConfirmButton"]').click(); + cy.request( + 'GET', + `${Cypress.config( + 'baseUrl' + )}/api/saved_objects/_find?fields=id&fields=description&fields=title&per_page=10000&type=data-source` + ).then((resp) => { + if (resp && resp.body && resp.body.saved_objects) { + resp.body.saved_objects.map(({ id }) => { + cy.request({ + method: 'DELETE', + url: `${Cypress.config('baseUrl')}/api/saved_objects/data-source/${id}`, + body: { force: false }, + headers: { + 'osd-xsrf': true, + }, + }); + }); + } + }); }; describe('Multi-datasources enabled', () => { diff --git a/test/jest_integration/security_entity_api.test.ts b/test/jest_integration/security_entity_api.test.ts index 4857920e5..4f745c9de 100644 --- a/test/jest_integration/security_entity_api.test.ts +++ b/test/jest_integration/security_entity_api.test.ts @@ -643,6 +643,17 @@ describe('start OpenSearch Dashboards server multi datasources enabled', () => { 'some_allowed_action' ); + // verify that this AG is not created in Local Cluster + const getActionGroupsResponseLocalCluster = await getAllEntitiesAsAdminWithDataSource( + root, + entityType, + '' + ); + expect(getActionGroupsResponseLocalCluster.status).toEqual(200); + expect(getActionGroupsResponseLocalCluster.body.data?.hasOwnProperty(testActionGroupName)).toBe( + false + ); + const updatePermissionResponse = await createOrUpdateEntityAsAdminWithDataSource( root, entityType,