Skip to content

Commit

Permalink
Adding test for opensearch_security.multitenancy.enabled disabled (#653)
Browse files Browse the repository at this point in the history
Signed-off-by: Abhi Kalra <abhivka@amazon.com>
Co-authored-by: Abhi Kalra <abhivka@amazon.com>
  • Loading branch information
abhivka7 and Abhi Kalra authored May 5, 2023
1 parent d8b381b commit e601884
Showing 1 changed file with 25 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
/*
* Copyright OpenSearch Contributors
* SPDX-License-Identifier: Apache-2.0
*/

import { TENANTS_MANAGE_PATH } from '../../../utils/dashboards/constants';

if (Cypress.env('SECURITY_ENABLED')) {
describe('Multi Tenancy Tests: ', () => {
before(() => {
cy.server();
});
it('Test Dashboards tenancy features should not be accessible ', () => {
// This test is to ensure tenancy related features are not accessible when opensearch_security.multitenancy.enabled is disabled in the opensearchdashboard.yaml
cy.visit(TENANTS_MANAGE_PATH);
cy.waitForLoader();

cy.contains('You have not enabled multi tenancy').should('exist');

// Switch tenants button should not exist when multi-tenancy is disabled.
cy.get('#user-icon-btn').click();
cy.contains('button', 'Switch tenants').should('not.exist');
});
});
}

0 comments on commit e601884

Please sign in to comment.