-
Notifications
You must be signed in to change notification settings - Fork 113
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adding test for opensearch_security.multitenancy.enabled disabled (#653)
Signed-off-by: Abhi Kalra <abhivka@amazon.com> Co-authored-by: Abhi Kalra <abhivka@amazon.com>
- Loading branch information
Showing
1 changed file
with
25 additions
and
0 deletions.
There are no files selected for viewing
25 changes: 25 additions & 0 deletions
25
cypress/integration/plugins/security-dashboards-plugin/inaccessible_tenancy_features.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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'); | ||
}); | ||
}); | ||
} |