Skip to content

Commit

Permalink
Setup 1st saml test case
Browse files Browse the repository at this point in the history
Signed-off-by: Ryan Liang <[email protected]>
  • Loading branch information
RyanL1997 committed Nov 21, 2023
1 parent f562d3a commit 722a7bb
Showing 1 changed file with 27 additions and 0 deletions.
27 changes: 27 additions & 0 deletions .cypress/e2e/saml/saml_test.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,30 @@
* Copyright OpenSearch Contributors
* SPDX-License-Identifier: Apache-2.0
*/

afterEach(() => {
cy.clearCookies();
cy.clearLocalStorage();
});

describe('Log in via SAML', () => {
const samlLogin = () => {
cy.get('input[id=userName]', { timeout: 15000}).should('be.visible');
cy.get('button[id=btn-sign-in]', { timeout: 15000 }).should('be.visible').click();
};

it('Login to app/opensearch_dashboards_overview#/ when SAML is enabled', () => {
localStorage.setItem("opendistro::security::tenant::saved", "\"__user__\"");
localStorage.setItem("home:newThemeModal:show", "false");

cy.visit('http://localhost:5601/app/opensearch_dashboards_overview', {
failOnStatusCode: false,
timeout: 10000,
});

samlLogin();

cy.get('#osdOverviewPageHeader__title', { timeout: 10000 }).should('be.visible');
cy.getCookie('security_authentication', { timeout: 10000 }).should('exist');
});
});

0 comments on commit 722a7bb

Please sign in to comment.