Skip to content

Commit

Permalink
test isolation
Browse files Browse the repository at this point in the history
Signed-off-by: Miki <[email protected]>
  • Loading branch information
AMoo-Miki committed Dec 19, 2024
1 parent 9b3e8bc commit 0dbd879
Showing 1 changed file with 8 additions and 11 deletions.
19 changes: 8 additions & 11 deletions cypress/integration/dashboard_sanity_test.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,17 +17,14 @@ import {
export function dashboardSanityTests() {
const commonUI = new CommonUI(cy);
const miscUtils = new MiscUtils(cy);
const baseURL = new URL(Cypress.config().baseUrl);
// remove trailing slash
const path = baseURL.pathname.replace(/\/$/, '');

describe('dashboard sample data validation', () => {
before(() => {});

after(() => {});

describe('checking home page', () => {
before(() => {
beforeEach(() => {
// Go to the home page
miscUtils.visitPage('app/home#');
cy.window().then((win) => win.localStorage.setItem('home:welcome:show', false));
Expand All @@ -40,35 +37,35 @@ export function dashboardSanityTests() {

it('checking opensearch_dashboards_overview display', () => {
// Check that opensearch_dashboards_overview is visable
commonUI.checkElementExists(`a[href="${path}/app/opensearch_dashboards_overview"]`, 1);
commonUI.checkElementExists(`a[href$="/app/opensearch_dashboards_overview"]`, 1);
});

it('checking tutorial_directory display', () => {
// Check that tutorial_directory is visable
commonUI.checkElementExists(`a[href="${path}/app/home#/tutorial_directory"]`, 2);
commonUI.checkElementExists(`a[href$="/app/home#/tutorial_directory"]`, 2);
});

it('checking management display', () => {
// Check that management is visable
commonUI.checkElementExists(`a[href="${path}/app/management"]`, 1);
commonUI.checkElementExists(`a[href$="/app/management"]`, 1);
});

it('checking dev_tools display', () => {
// Check that dev_tools is visable
commonUI.checkElementExists(`a[href="${path}/app/dev_tools#/console"]`, 2);
commonUI.checkElementExists(`a[href$="/app/dev_tools#/console"]`, 2);
});

it('settings display', () => {
// Check that settings is visable
commonUI.checkElementExists(
`a[href="${path}/app/management/opensearch-dashboards/settings#defaultRoute"]`,
`a[href$="/app/management/opensearch-dashboards/settings#defaultRoute"]`,
1
);
});

it('checking feature_directory display', () => {
// Check that feature_directory is visable
commonUI.checkElementExists(`a[href="${path}/app/home#/feature_directory"]`, 1);
commonUI.checkElementExists(`a[href$="/app/home#/feature_directory"]`, 1);
});

it('checking navigation display', () => {
Expand All @@ -83,7 +80,7 @@ export function dashboardSanityTests() {
});

describe('checking Dev Tools', () => {
before(() => {
beforeEach(() => {
// Go to the Dev Tools page
miscUtils.visitPage('app/dev_tools#/console');
});
Expand Down

0 comments on commit 0dbd879

Please sign in to comment.