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

Add switch to honor the next home experience feature #1011

Merged
merged 1 commit into from
Jan 24, 2024
Merged
Show file tree
Hide file tree
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
3 changes: 2 additions & 1 deletion cypress.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
"VISBUILDER_ENABLED": true,
"DATASOURCE_MANAGEMENT_ENABLED": false,
"ML_COMMONS_DASHBOARDS_ENABLED": true,
"WAIT_FOR_LOADER_BUFFER_MS": 0
"WAIT_FOR_LOADER_BUFFER_MS": 0,
"NEXT_HOME_ENABLED": false
}
}
7 changes: 5 additions & 2 deletions cypress/integration/common/dashboard_sample_data_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ import {
MiscUtils,
} from '@opensearch-dashboards-test/opensearch-dashboards-test-library';

const nextHomeSuffix = Cypress.env('NEXT_HOME_ENABLED') ? '' : '/next-home';
const legacyHomeSuffix = Cypress.env('NEXT_HOME_ENABLED') ? '/legacy-home' : '';

/**
* dashboard_sample_data test suite description:
* 1) Visit the home page of opensearchdashboard, check key UI elements display
Expand All @@ -29,7 +32,7 @@ export function dashboardSanityTests() {
describe('checking home page', () => {
before(() => {
// Go to the home page
miscUtils.visitPage('app/home#');
miscUtils.visitPage(`app/home#${nextHomeSuffix}`);
cy.window().then((win) =>
win.localStorage.setItem('home:welcome:show', false)
);
Expand Down Expand Up @@ -101,7 +104,7 @@ export function dashboardSanityTests() {
describe('checking legacy home page', () => {
before(() => {
// Go to the home page
miscUtils.visitPage('app/home#/legacy');
miscUtils.visitPage(`app/home#${legacyHomeSuffix}`);
cy.window().then((win) =>
win.localStorage.setItem('home:welcome:show', false)
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,12 @@ import { MiscUtils } from '@opensearch-dashboards-test/opensearch-dashboards-tes

const miscUtils = new MiscUtils(cy);

const nextHomeSuffix = Cypress.env('NEXT_HOME_ENABLED') ? '' : '/next-home';

describe('home sections', { scrollBehavior: false }, () => {
before(() => {
// Go to the home page
miscUtils.visitPage('app/home#');
miscUtils.visitPage(`app/home#${nextHomeSuffix}`);
});

it('should all appear expanded', function () {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@ const baseURL = new URL(Cypress.config().baseUrl);
// remove trailing slash
const path = baseURL.pathname.replace(/\/$/, '');

const nextHomeSuffix = Cypress.env('NEXT_HOME_ENABLED') ? '' : '/next-home';
const legacyHomeSuffix = Cypress.env('NEXT_HOME_ENABLED') ? '/legacy-home' : '';

if (Cypress.env('DATASOURCE_MANAGEMENT_ENABLED')) {
describe('dashboard local cluster sample data validation', () => {
before(() => {});
Expand All @@ -23,7 +26,7 @@ if (Cypress.env('DATASOURCE_MANAGEMENT_ENABLED')) {
describe('checking home page', () => {
before(() => {
// Go to the home page
miscUtils.visitPage('app/home#');
miscUtils.visitPage(`app/home#${nextHomeSuffix}`);
cy.window().then((win) =>
win.localStorage.setItem('home:welcome:show', false)
);
Expand All @@ -48,7 +51,7 @@ if (Cypress.env('DATASOURCE_MANAGEMENT_ENABLED')) {
describe('checking legacy home page', () => {
before(() => {
// Go to the home page
miscUtils.visitPage('app/home#/legacy');
miscUtils.visitPage(`app/home#${legacyHomeSuffix}`);
cy.window().then((win) =>
win.localStorage.setItem('home:welcome:show', false)
);
Expand Down
Loading