diff --git a/cypress/integration/core-opensearch-dashboards/opensearch-dashboards/apps/data_explorer/date_nanos.spec.js b/cypress/integration/core-opensearch-dashboards/opensearch-dashboards/apps/data_explorer/date_nanos.spec.js index 3501f5c83..ccdbc3490 100644 --- a/cypress/integration/core-opensearch-dashboards/opensearch-dashboards/apps/data_explorer/date_nanos.spec.js +++ b/cypress/integration/core-opensearch-dashboards/opensearch-dashboards/apps/data_explorer/date_nanos.spec.js @@ -37,6 +37,12 @@ describe('date_nanos', () => { cy.waitForSearch(); }); + after(() => { + testFixtureHandler.clearJSONMapping( + 'cypress/fixtures/dashboard/opensearch_dashboards/data_explorer/date_nanos/mappings.json.txt' + ); + }); + it('should show a timestamp with nanoseconds in the first result row', function () { cy.verifyTimeConfig(fromTime, toTime); cy.get(`[data-test-subj="dataGridRowCell"]`) diff --git a/cypress/integration/core-opensearch-dashboards/opensearch-dashboards/apps/data_explorer/date_nanos_mixed.spec.js b/cypress/integration/core-opensearch-dashboards/opensearch-dashboards/apps/data_explorer/date_nanos_mixed.spec.js index 97f5a2623..19aca0b41 100644 --- a/cypress/integration/core-opensearch-dashboards/opensearch-dashboards/apps/data_explorer/date_nanos_mixed.spec.js +++ b/cypress/integration/core-opensearch-dashboards/opensearch-dashboards/apps/data_explorer/date_nanos_mixed.spec.js @@ -16,7 +16,7 @@ const testFixtureHandler = new TestFixtureHandler( describe('date_nanos_mixed', () => { before(() => { - // import date nanos + //import date nanos testFixtureHandler.importJSONMapping( 'cypress/fixtures/dashboard/opensearch_dashboards/data_explorer/date_nanos_mix/mappings.json.txt' ); diff --git a/cypress/integration/core-opensearch-dashboards/opensearch-dashboards/apps/data_explorer/discover.spec.js b/cypress/integration/core-opensearch-dashboards/opensearch-dashboards/apps/data_explorer/discover.spec.js index 93992b256..51e24f38f 100644 --- a/cypress/integration/core-opensearch-dashboards/opensearch-dashboards/apps/data_explorer/discover.spec.js +++ b/cypress/integration/core-opensearch-dashboards/opensearch-dashboards/apps/data_explorer/discover.spec.js @@ -8,8 +8,8 @@ import { MiscUtils, } from '@opensearch-dashboards-test/opensearch-dashboards-test-library'; import { - DX_DEFAULT_END_TIME, - DX_DEFAULT_START_TIME, + DE_DEFAULT_END_TIME, + DE_DEFAULT_START_TIME, } from '../../../../../utils/constants'; const miscUtils = new MiscUtils(cy); @@ -36,30 +36,24 @@ describe('discover app', () => { 'cypress/fixtures/dashboard/opensearch_dashboards/data_explorer/logstash/logstash.json.txt' ); + cy.setAdvancedSetting({ + defaultIndex: 'logstash-*', + }); + // Go to the Discover page miscUtils.visitPage( `app/data-explorer/discover#/?_g=(filters:!(),time:(from:'2015-09-19T13:31:44.000Z',to:'2015-09-24T01:31:44.000Z'))` ); cy.waitForLoader(); - cy.wait(30000); - - cy.setAdvancedSetting({ - defaultIndex: 'logstash-*', - }); - cy.waitForSearch(); }); - // after(() => { - // //miscUtils.removeSampleData(); - // }); - describe('save search', () => { const saveSearch1 = 'Save Search # 1'; const saveSearch2 = 'Modified Save Search # 1'; it('should show correct time range string by timepicker', function () { - cy.verifyTimeConfig(DX_DEFAULT_START_TIME, DX_DEFAULT_END_TIME); + cy.verifyTimeConfig(DE_DEFAULT_START_TIME, DE_DEFAULT_END_TIME); cy.waitForLoader(); }); @@ -90,7 +84,7 @@ describe('discover app', () => { it('should show the correct hit count', function () { cy.loadSaveSearch(saveSearch2); - cy.setTopNavDate(DX_DEFAULT_START_TIME, DX_DEFAULT_END_TIME); + cy.setTopNavDate(DE_DEFAULT_START_TIME, DE_DEFAULT_END_TIME); const expectedHitCount = '14,004'; cy.verifyHitCount(expectedHitCount); }); @@ -98,7 +92,7 @@ describe('discover app', () => { it('should show correct time range string in chart', function () { cy.getElementByTestId('discoverIntervalDateRange').should( 'have.text', - `${DX_DEFAULT_START_TIME} - ${DX_DEFAULT_END_TIME} per` + `${DE_DEFAULT_START_TIME} - ${DE_DEFAULT_END_TIME} per` ); }); @@ -144,7 +138,7 @@ describe('discover app', () => { describe('nested query', () => { before(() => { - cy.setTopNavDate(DX_DEFAULT_START_TIME, DX_DEFAULT_END_TIME); + cy.setTopNavDate(DE_DEFAULT_START_TIME, DE_DEFAULT_END_TIME); cy.waitForSearch(); }); @@ -163,7 +157,7 @@ describe('discover app', () => { }; cy.loadSaveSearch(expected.title); - cy.setTopNavDate(DX_DEFAULT_START_TIME, DX_DEFAULT_END_TIME); + cy.setTopNavDate(DE_DEFAULT_START_TIME, DE_DEFAULT_END_TIME); cy.waitForLoader(); cy.getElementByTestId('docTable') .should('have.attr', 'data-shared-item') diff --git a/cypress/integration/core-opensearch-dashboards/opensearch-dashboards/apps/data_explorer/discover_histogram.spec.js b/cypress/integration/core-opensearch-dashboards/opensearch-dashboards/apps/data_explorer/discover_histogram.spec.js index 3380cba37..e9ccf2500 100644 --- a/cypress/integration/core-opensearch-dashboards/opensearch-dashboards/apps/data_explorer/discover_histogram.spec.js +++ b/cypress/integration/core-opensearch-dashboards/opensearch-dashboards/apps/data_explorer/discover_histogram.spec.js @@ -49,13 +49,15 @@ describe('discover histogram', () => { // Go to the Discover page miscUtils.visitPage('app/data-explorer/discover#/'); cy.waitForLoader(); - cy.wait(60000); }); after(() => { - cy.setAdvancedSetting({ - 'dateFormat:tz': 'Browser', - }); + miscUtils.visitPage('app/management/opensearch-dashboards/settings'); + cy.getElementByTestId('advancedSetting-resetField-dateFormat:tz').click(); + cy.getElementByTestId('advancedSetting-saveButton').click({ force: true }); + testFixtureHandler.clearJSONMapping( + 'cypress/fixtures/dashboard/opensearch_dashboards/data_explorer/long_window_logstash/mappings.json.txt' + ); }); it('should visualize monthly data with different day intervals', () => { diff --git a/cypress/integration/core-opensearch-dashboards/opensearch-dashboards/apps/data_explorer/errors.spec.js b/cypress/integration/core-opensearch-dashboards/opensearch-dashboards/apps/data_explorer/errors.spec.js index f9aa38f29..af69166c2 100644 --- a/cypress/integration/core-opensearch-dashboards/opensearch-dashboards/apps/data_explorer/errors.spec.js +++ b/cypress/integration/core-opensearch-dashboards/opensearch-dashboards/apps/data_explorer/errors.spec.js @@ -8,8 +8,8 @@ import { MiscUtils, } from '@opensearch-dashboards-test/opensearch-dashboards-test-library'; import { - DX_DEFAULT_END_TIME, - DX_DEFAULT_START_TIME, + DE_DEFAULT_END_TIME, + DE_DEFAULT_START_TIME, } from '../../../../../utils/constants'; const miscUtils = new MiscUtils(cy); @@ -32,7 +32,7 @@ describe('errors', () => { miscUtils.visitPage('app/data-explorer/discover#/'); cy.waitForLoader(); - cy.setTopNavDate(DX_DEFAULT_START_TIME, DX_DEFAULT_END_TIME); + cy.setTopNavDate(DE_DEFAULT_START_TIME, DE_DEFAULT_END_TIME); }); describe('invalid scripted field error', function () { diff --git a/cypress/integration/core-opensearch-dashboards/opensearch-dashboards/apps/data_explorer/index_pattern_with_encoded_id.spec.js b/cypress/integration/core-opensearch-dashboards/opensearch-dashboards/apps/data_explorer/index_pattern_with_encoded_id.spec.js index 6ad877ef1..61bdbf59d 100644 --- a/cypress/integration/core-opensearch-dashboards/opensearch-dashboards/apps/data_explorer/index_pattern_with_encoded_id.spec.js +++ b/cypress/integration/core-opensearch-dashboards/opensearch-dashboards/apps/data_explorer/index_pattern_with_encoded_id.spec.js @@ -8,8 +8,8 @@ import { MiscUtils, } from '@opensearch-dashboards-test/opensearch-dashboards-test-library'; import { - DX_DEFAULT_END_TIME, - DX_DEFAULT_START_TIME, + DE_DEFAULT_END_TIME, + DE_DEFAULT_START_TIME, } from '../../../../../utils/constants'; const miscUtils = new MiscUtils(cy); @@ -34,7 +34,7 @@ describe('index pattern with encoded id', () => { // Go to the Discover page miscUtils.visitPage('app/data-explorer/discover#/'); - cy.setTopNavDate(DX_DEFAULT_START_TIME, DX_DEFAULT_END_TIME); + cy.setTopNavDate(DE_DEFAULT_START_TIME, DE_DEFAULT_END_TIME); cy.waitForLoader(); }); diff --git a/cypress/integration/core-opensearch-dashboards/opensearch-dashboards/apps/data_explorer/inspector.spec.js b/cypress/integration/core-opensearch-dashboards/opensearch-dashboards/apps/data_explorer/inspector.spec.js index 5df7ed9f4..96958ccf2 100644 --- a/cypress/integration/core-opensearch-dashboards/opensearch-dashboards/apps/data_explorer/inspector.spec.js +++ b/cypress/integration/core-opensearch-dashboards/opensearch-dashboards/apps/data_explorer/inspector.spec.js @@ -5,8 +5,8 @@ import { MiscUtils } from '@opensearch-dashboards-test/opensearch-dashboards-test-library'; import { - DX_DEFAULT_END_TIME, - DX_DEFAULT_START_TIME, + DE_DEFAULT_END_TIME, + DE_DEFAULT_START_TIME, } from '../../../../../utils/constants'; const miscUtils = new MiscUtils(cy); @@ -31,7 +31,7 @@ describe('inspector', () => { }); it('should display request stats with results', () => { - cy.setTopNavDate(DX_DEFAULT_START_TIME, DX_DEFAULT_END_TIME); + cy.setTopNavDate(DE_DEFAULT_START_TIME, DE_DEFAULT_END_TIME); cy.waitForSearch(); cy.getElementByTestId('openInspectorButton').click(); cy.getElementByTestId('inspectorPanel') diff --git a/cypress/integration/core-opensearch-dashboards/opensearch-dashboards/apps/data_explorer/saved_queries.spec.js b/cypress/integration/core-opensearch-dashboards/opensearch-dashboards/apps/data_explorer/saved_queries.spec.js index a12446187..e9619c0c1 100644 --- a/cypress/integration/core-opensearch-dashboards/opensearch-dashboards/apps/data_explorer/saved_queries.spec.js +++ b/cypress/integration/core-opensearch-dashboards/opensearch-dashboards/apps/data_explorer/saved_queries.spec.js @@ -8,8 +8,8 @@ import { MiscUtils, } from '@opensearch-dashboards-test/opensearch-dashboards-test-library'; import { - DX_DEFAULT_END_TIME, - DX_DEFAULT_START_TIME, + DE_DEFAULT_END_TIME, + DE_DEFAULT_START_TIME, } from '../../../../../utils/constants'; const miscUtils = new MiscUtils(cy); @@ -84,7 +84,7 @@ describe('saved queries saved objects', () => { }); it('reinstates filters and the time filter when a saved query has filters and a time filter included', () => { - cy.setTopNavDate(DX_DEFAULT_START_TIME, DX_DEFAULT_END_TIME); + cy.setTopNavDate(DE_DEFAULT_START_TIME, DE_DEFAULT_END_TIME); cy.getElementByTestId('queryInput').clear(); cy.loadSaveQuery('OkResponse'); diff --git a/cypress/integration/core-opensearch-dashboards/opensearch-dashboards/apps/data_explorer/shared_links.spec.js b/cypress/integration/core-opensearch-dashboards/opensearch-dashboards/apps/data_explorer/shared_links.spec.js index e9891b0f4..ccff7f08a 100644 --- a/cypress/integration/core-opensearch-dashboards/opensearch-dashboards/apps/data_explorer/shared_links.spec.js +++ b/cypress/integration/core-opensearch-dashboards/opensearch-dashboards/apps/data_explorer/shared_links.spec.js @@ -5,8 +5,8 @@ import { MiscUtils } from '@opensearch-dashboards-test/opensearch-dashboards-test-library'; import { - DX_DEFAULT_END_TIME, - DX_DEFAULT_START_TIME, + DE_DEFAULT_END_TIME, + DE_DEFAULT_START_TIME, } from '../../../../../utils/constants'; const miscUtils = new MiscUtils(cy); @@ -19,7 +19,7 @@ describe('test large strings', () => { miscUtils.visitPage('app/data-explorer/discover#/'); cy.waitForLoader(); - cy.setTopNavDate(DX_DEFAULT_START_TIME, DX_DEFAULT_END_TIME); + cy.setTopNavDate(DE_DEFAULT_START_TIME, DE_DEFAULT_END_TIME); cy.waitForSearch(); }); @@ -78,7 +78,7 @@ describe('test large strings', () => { miscUtils.visitPage('app/data-explorer/discover#/'); cy.waitForLoader(); - cy.setTopNavDate(DX_DEFAULT_START_TIME, DX_DEFAULT_END_TIME); + cy.setTopNavDate(DE_DEFAULT_START_TIME, DE_DEFAULT_END_TIME); cy.waitForSearch(); }); diff --git a/cypress/utils/dashboards/data_explorer/constants.js b/cypress/utils/dashboards/data_explorer/constants.js index 45ecc8e2e..6bcf36e05 100644 --- a/cypress/utils/dashboards/data_explorer/constants.js +++ b/cypress/utils/dashboards/data_explorer/constants.js @@ -8,5 +8,5 @@ export const DE_INDEX_PATTERN = DE_INDEX_ID; export const DE_PATH_FIXTURE = 'dashboard/opensearch_dashboards/data_explorer/'; -export const DX_DEFAULT_START_TIME = 'Sep 19, 2015 @ 06:31:44.000'; -export const DX_DEFAULT_END_TIME = 'Sep 23, 2015 @ 18:31:44.000'; +export const DE_DEFAULT_START_TIME = 'Sep 19, 2015 @ 06:31:44.000'; +export const DE_DEFAULT_END_TIME = 'Sep 23, 2015 @ 18:31:44.000';