From 3355a8fb3b5565eb43b2d55062c9f56216e8b488 Mon Sep 17 00:00:00 2001 From: "opensearch-trigger-bot[bot]" <98922864+opensearch-trigger-bot[bot]@users.noreply.github.com> Date: Wed, 22 Jun 2022 10:02:13 -0700 Subject: [PATCH] [CI][BWC] Date range for tests incorrect params (#1772) (#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 (cherry picked from commit 4703abf2f3898d84e3ba7ee36c7d5d093912f16f) Co-authored-by: Kawika Avilla --- cypress/integration/with-security/check_loaded_data.js | 10 ++++------ .../integration/without-security/check_loaded_data.js | 10 ++++------ 2 files changed, 8 insertions(+), 12 deletions(-) diff --git a/cypress/integration/with-security/check_loaded_data.js b/cypress/integration/with-security/check_loaded_data.js index ec4b1331b8ce..3240c8842aec 100644 --- a/cypress/integration/with-security/check_loaded_data.js +++ b/cypress/integration/with-security/check_loaded_data.js @@ -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(() => { @@ -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', () => { @@ -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', () => { diff --git a/cypress/integration/without-security/check_loaded_data.js b/cypress/integration/without-security/check_loaded_data.js index 4d2c2d3e4a31..2e87d2bcdc52 100644 --- a/cypress/integration/without-security/check_loaded_data.js +++ b/cypress/integration/without-security/check_loaded_data.js @@ -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(() => { @@ -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', () => { @@ -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', () => {