Skip to content

Commit

Permalink
Add switch to honor the next home experience feature
Browse files Browse the repository at this point in the history
Signed-off-by: Miki <[email protected]>
  • Loading branch information
AMoo-Miki committed Jan 24, 2024
1 parent ad62d3e commit 9f1669b
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 11 deletions.
13 changes: 7 additions & 6 deletions cypress.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,24 +2,25 @@
"defaultCommandTimeout": 60000,
"requestTimeout": 60000,
"responseTimeout": 60000,
"baseUrl": "http://localhost:5601",
"baseUrl": "http://localhost",
"reporter": "cypress-multi-reporters",
"reporterOptions": {
"configFile": "reporter-config.json"
},
"viewportWidth": 2000,
"viewportHeight": 1320,
"env": {
"openSearchUrl": "http://localhost:9200",
"SECURITY_ENABLED": false,
"openSearchUrl": "https://miki-os.aka.corp.amazon.com:9200",
"SECURITY_ENABLED": true,
"AGGREGATION_VIEW": false,
"username": "admin",
"password": "myStrongPassword123!",
"username": "miki",
"password": "baharema",
"ENDPOINT_WITH_PROXY": false,
"MANAGED_SERVICE_ENDPOINT": false,
"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

0 comments on commit 9f1669b

Please sign in to comment.