Skip to content

Commit

Permalink
[CI][BWC] Date range for tests incorrect params (opensearch-project#1772
Browse files Browse the repository at this point in the history
) (opensearch-project#1773)

Incorrectly set the date range of the library. This sets the value
correctly and turns the dates into consts.

Issue:
n/a

Signed-off-by: Kawika Avilla <[email protected]>
(cherry picked from commit 4703abf)

Co-authored-by: Kawika Avilla <[email protected]>
  • Loading branch information
2 people authored and Chang Liu committed Jun 30, 2022
1 parent d70392c commit 3355a8f
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 12 deletions.
10 changes: 4 additions & 6 deletions cypress/integration/with-security/check_loaded_data.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ import {
const miscUtils = new MiscUtils(cy);
const commonUI = new CommonUI(cy);
const loginPage = new LoginPage(cy);
const startDate = 'Nov 1, 2016 @ 00:00:00.000';
const endDate = `Dec 31, ${new Date().getFullYear()} @ 00:00:00.000`;

describe('check previously loaded data', () => {
beforeEach(() => {
Expand Down Expand Up @@ -47,9 +49,7 @@ describe('check previously loaded data', () => {
.get('[data-test-subj="dashboardListingTitleLink-[Flights]-Global-Flight-Dashboard"]')
.click();
commonUI.removeAllFilters();
commonUI.setDateRange(
`Dec 31, ${new Date().getFullYear()} @ 00:00:00.000', 'Nov 1, 2016 @ 00:00:00.000`
);
commonUI.setDateRange(endDate, startDate);
});

it('Global Flight Dashboard is loaded and funtions correctly', () => {
Expand Down Expand Up @@ -79,9 +79,7 @@ describe('check previously loaded data', () => {
.get('[data-test-subj="dashboardListingTitleLink-[eCommerce]-Revenue-Dashboard"]')
.click();
commonUI.removeAllFilters();
commonUI.setDateRange(
`Dec 31, ${new Date().getFullYear()} @ 00:00:00.000', 'Nov 1, 2016 @ 00:00:00.000`
);
commonUI.setDateRange(endDate, startDate);
});

it('eCommerce Revenue Dashboard is loaded and functions correctly', () => {
Expand Down
10 changes: 4 additions & 6 deletions cypress/integration/without-security/check_loaded_data.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ import {

const miscUtils = new MiscUtils(cy);
const commonUI = new CommonUI(cy);
const startDate = 'Nov 1, 2016 @ 00:00:00.000';
const endDate = `Dec 31, ${new Date().getFullYear()} @ 00:00:00.000`;

describe('check previously loaded data', () => {
beforeEach(() => {
Expand Down Expand Up @@ -38,9 +40,7 @@ describe('check previously loaded data', () => {
.get('[data-test-subj="dashboardListingTitleLink-[Flights]-Global-Flight-Dashboard"]')
.click();
commonUI.removeAllFilters();
commonUI.setDateRange(
`Dec 31, ${new Date().getFullYear()} @ 00:00:00.000', 'Nov 1, 2016 @ 00:00:00.000`
);
commonUI.setDateRange(endDate, startDate);
});

it('Global Flight Dashboard is loaded when clicked', () => {
Expand Down Expand Up @@ -73,9 +73,7 @@ describe('check previously loaded data', () => {
.get('[data-test-subj="dashboardListingTitleLink-[eCommerce]-Revenue-Dashboard"]')
.click();
commonUI.removeAllFilters();
commonUI.setDateRange(
`Dec 31, ${new Date().getFullYear()} @ 00:00:00.000', 'Nov 1, 2016 @ 00:00:00.000`
);
commonUI.setDateRange(endDate, startDate);
});

it('eCommerce Revenue Dashboard is loaded when clicked', () => {
Expand Down

0 comments on commit 3355a8f

Please sign in to comment.