Skip to content

Commit

Permalink
fixing typo
Browse files Browse the repository at this point in the history
Signed-off-by: Qingyang(Abby) Hu <[email protected]>
  • Loading branch information
abbyhu2000 committed Sep 21, 2023
1 parent 0a0c6cd commit 6fe9724
Show file tree
Hide file tree
Showing 10 changed files with 42 additions and 40 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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"]`)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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'
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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();
});

Expand Down Expand Up @@ -90,15 +84,15 @@ 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);
});

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`
);
});

Expand Down Expand Up @@ -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();
});

Expand All @@ -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')
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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', () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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 () {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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();
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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')
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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');

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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();
});

Expand Down Expand Up @@ -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();
});

Expand Down
4 changes: 2 additions & 2 deletions cypress/utils/dashboards/data_explorer/constants.js
Original file line number Diff line number Diff line change
Expand Up @@ -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';

0 comments on commit 6fe9724

Please sign in to comment.