Skip to content

Commit

Permalink
update oidc_auth_test.spec.js
Browse files Browse the repository at this point in the history
Signed-off-by: Craig Perkins <[email protected]>
  • Loading branch information
cwperks committed Apr 20, 2024
1 parent beb2dd6 commit d4e2fa6
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions test/cypress/e2e/oidc/oidc_auth_test.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@
* SPDX-License-Identifier: Apache-2.0
*/

const basePath = Cypress.env('basePath') || '';

describe('Log in via OIDC', () => {
afterEach(() => {
cy.clearCookies();
Expand All @@ -37,7 +39,7 @@ describe('Log in via OIDC', () => {
};

it('Login to app/opensearch_dashboards_overview#/ when OIDC is enabled', () => {
cy.visit('http://localhost:5601/app/opensearch_dashboards_overview', {
cy.visit(`http://localhost:5601${basePath}/app/opensearch_dashboards_overview`, {
failOnStatusCode: false,
});

Expand All @@ -52,7 +54,7 @@ describe('Log in via OIDC', () => {
});

it('Login to app/dev_tools#/console when OIDC is enabled', () => {
cy.visit('http://localhost:5601/app/opensearch_dashboards_overview', {
cy.visit(`http://localhost:5601${basePath}/app/opensearch_dashboards_overview`, {
failOnStatusCode: false,
});

Expand All @@ -61,15 +63,15 @@ describe('Log in via OIDC', () => {
localStorage.setItem('opendistro::security::tenant::saved', '""');
localStorage.setItem('home:newThemeModal:show', 'false');

cy.visit('http://localhost:5601/app/dev_tools#/console');
cy.visit(`http://localhost:5601${basePath}/app/dev_tools#/console`);

cy.get('a').contains('Dev Tools').should('be.visible');

cy.getCookie('security_authentication').should('exist');
});

it('Login to Dashboard with Hash', () => {
const urlWithHash = `http://localhost:5601/app/security-dashboards-plugin#/getstarted`;
const urlWithHash = `http://localhost:5601${basePath}/app/security-dashboards-plugin#/getstarted`;

cy.visit(urlWithHash, {
failOnStatusCode: false,
Expand All @@ -92,7 +94,7 @@ describe('Log in via OIDC', () => {
});

it('Tenancy persisted after logout in OIDC', () => {
cy.visit('http://localhost:5601/app/opensearch_dashboards_overview#/', {
cy.visit(`http://localhost:5601${basePath}/app/opensearch_dashboards_overview#/`, {
failOnStatusCode: false,
});

Expand Down

0 comments on commit d4e2fa6

Please sign in to comment.