Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding test for opensearch_security.multitenancy.enabled disabled #653

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
/*
Copy link
Member

@cwperks cwperks May 5, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@abhivka7 Where is the setup for this test? Is it set to multi-tenancy disabled by default?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That will be done through workflow in Security Dashboards plugin. Here is the commit: opensearch-project/security-dashboards-plugin@b70c248

PR: https://github.com/opensearch-project/security-dashboards-plugin/pull/1419/commits

* 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');
});
});
}