Skip to content

Commit

Permalink
Adding test for opensearch_security.multitenancy.enabled disabled (op…
Browse files Browse the repository at this point in the history
…ensearch-project#653) (opensearch-project#655)

Signed-off-by: Abhi Kalra <abhivka@amazon.com>
Co-authored-by: Abhi Kalra <abhivka@amazon.com>
(cherry picked from commit e601884)

Co-authored-by: Abhi Kalra <99718513+abhivka7@users.noreply.github.com>
Signed-off-by: leanne.laceybyrne@eliatra.com <leanne.laceybyrne@eliatra.com>
  • Loading branch information
2 people authored and leanneeliatra committed Sep 15, 2023
1 parent 0771ec6 commit d13fc58
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 d13fc58

Please sign in to comment.