From 235050eaee0e6b602db6d115e422c57a2c6e803c Mon Sep 17 00:00:00 2001 From: Ludmila Nesvitiy Date: Wed, 6 Feb 2019 14:50:50 +0200 Subject: [PATCH] fix(tests): js heap out of memory, datepicker fixes (#5048) --- cypress/full/datepicker/min_max_spec.ts | 4 ++-- cypress/plugins/cy-ts-preprocessor.js | 5 ++++- cypress/support/datepicker.po.ts | 5 ++++- 3 files changed, 10 insertions(+), 4 deletions(-) diff --git a/cypress/full/datepicker/min_max_spec.ts b/cypress/full/datepicker/min_max_spec.ts index b21582826d..bb0bf20204 100644 --- a/cypress/full/datepicker/min_max_spec.ts +++ b/cypress/full/datepicker/min_max_spec.ts @@ -35,8 +35,8 @@ describe('Datepicker demo test suite: Min-max', () => { maxDate.setDate(maxDate.getDate() + 8); const dateOutOfIntervalLeft = new Date(minDate.getTime()); const dateOutOfIntervalRight = new Date(maxDate.getTime()); - dateOutOfIntervalLeft.setDate((dateOutOfIntervalLeft.getDate() - 5)); - dateOutOfIntervalRight.setDate((dateOutOfIntervalRight.getDate() + 5)); + dateOutOfIntervalLeft.setDate((dateOutOfIntervalLeft.getDate() - 3)); + dateOutOfIntervalRight.setDate((dateOutOfIntervalRight.getDate() + 3)); datepicker.clickOnDatepickerInput(minMax); datepicker.isDatepickerOpened(true); if (minDate.getMonth() === dateOutOfIntervalLeft.getMonth()) { diff --git a/cypress/plugins/cy-ts-preprocessor.js b/cypress/plugins/cy-ts-preprocessor.js index c9916505e0..8052f329dc 100644 --- a/cypress/plugins/cy-ts-preprocessor.js +++ b/cypress/plugins/cy-ts-preprocessor.js @@ -11,7 +11,10 @@ const webpackOptions = { exclude: [/node_modules/], use: [ { - loader: 'ts-loader' + loader: 'ts-loader', + options: { + transpileOnly: true + } } ] } diff --git a/cypress/support/datepicker.po.ts b/cypress/support/datepicker.po.ts index ad7cbc0164..526b97dbf8 100644 --- a/cypress/support/datepicker.po.ts +++ b/cypress/support/datepicker.po.ts @@ -356,7 +356,10 @@ export class DatepickerPo extends BaseComponent { if (itemText === undefined) { cy.get(`${baseSelector}>${this.datepickerContainer} ${bodyView} td`).eq(itemIndex).click(); } else { - cy.get(`${baseSelector}>${this.datepickerContainer} ${bodyView} td span`) + cy.get(`${baseSelector}>${this.datepickerContainer} ${bodyView}`) + .find(`td`) + .not('.week') + .find('span') .not('[class*="is-other-month"]') .contains(itemText).click(); }