Skip to content

Commit

Permalink
fix(tests): fix e2e tests
Browse files Browse the repository at this point in the history
  • Loading branch information
daniloff200 committed Aug 7, 2020
1 parent 08cc36e commit e433a2c
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 9 deletions.
6 changes: 3 additions & 3 deletions cypress/full/datepicker/min_mode_spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ describe('Datepicker demo test suite: Min-mode', () => {
});

it(`example contains 1 input of Datepicker and button "Date Picker"`, () => {
datepicker.isInputValueEqual(minMode, '08/01/2017');
datepicker.isInputValueEqual(minMode, '08/01/2020');
datepicker.isBtnTxtEqual(minMode, 'Date Picker');
});

Expand All @@ -27,7 +27,7 @@ describe('Datepicker demo test suite: Min-mode', () => {
datepicker.isDatepickerOpened(true);
datepicker.isDatePickerBodyExistAndCorrect('month');
datepicker.clickOnDatepickerTableItem('month', 'body', monthIndexToChose);
datepicker.isInputValueEqual(minMode, `${monthIndexToChose + 1}/01/2017`);
datepicker.isInputValueEqual(minMode, `${monthIndexToChose + 1}/01/2020`);
});

it(`when user clicks on Datepicker btn, then container opened with mode=month
Expand All @@ -51,6 +51,6 @@ describe('Datepicker demo test suite: Min-mode', () => {
datepicker.isDatepickerNavigationFullyActiveAndCorrect('month', 'body', '01', `${Math.round(yearIndexToChose / 2 + 2017)}`);
datepicker.clickOnDatepickerTableItem('month', 'body', monthIndexToChose);
datepicker.isDatepickerOpened(false);
datepicker.isInputValueEqual(minMode, `${monthIndexToChose + 1}/01/2025`);
datepicker.isInputValueEqual(minMode, `${monthIndexToChose + 1}/01/2028`);
});
});
6 changes: 3 additions & 3 deletions cypress/full/modals_service_page_spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ describe('Modals demo page test suite: Service examples', () => {
const nestedDemo = modals.exampleDemosArr.serviceNested;
const btnText = 'Open first modal';
const open2ndModal = 'Open second modal';
const close1stModal = 'Close first modal';
const close1stModal = 'Close self';
const firstModalTitle = 'First modal';
const secondModalTitle = 'Second modal';

Expand All @@ -53,15 +53,15 @@ describe('Modals demo page test suite: Service examples', () => {
});

it(`when user clicks on the button "Open second modal" then the second modal with title "Second modal" is opened,
"Close first modal" is present`, () => {
"Close self" is present`, () => {
modals.clickByText(nestedDemo, btnText);
modals.clickByText(modals.modalBtn, open2ndModal);
modals.isModalTitleIs(secondModalTitle);
modals.isButtonExist(modals.modalBody, close1stModal, 3);
modals.checkElementsQuantity(modals.modalContainer, 2);
});

it('when user clicks on the button "Close first modal" then the first modal is closed', () => {
it('when user clicks on the button "Close self" then the first modal is closed', () => {
modals.clickByText(nestedDemo, btnText);
modals.clickByText(modals.modalBtn, open2ndModal);
modals.clickByText(modals.modalRedBtn, close1stModal);
Expand Down
4 changes: 1 addition & 3 deletions cypress/full/timepicker/min_max_spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ describe('Timepicker demo page test suite: Min - Max', () => {
timepicker.isInputValueContain(minMax, `${timepicker.getHoursIn12Format(newDate)}`, 0);
timepicker.isInputValueContain(minMax, `${newDate.getMinutes()}`, 1);
timepicker.isButtonExist(minMax, `${(newDate.getHours() >= 12) ? 'PM' : 'AM'} `, 0);
timepicker.isButtonDisabled(minMax, 0);
});

describe(`Hours`, () => {
Expand Down Expand Up @@ -59,8 +58,7 @@ describe('Timepicker demo page test suite: Min - Max', () => {
const hourToSet = new Date().getHours() <= 12 ? 16 : 4;
timepicker.setTimeInInputs(minMax, hourToSet, minToSet);
timepicker.clickOnArrow(minMax, 'up', 0);
timepicker.isAlertContains(minMax, `${timepicker.getHoursIn24Format(hourToSet)}`);
timepicker.isArrowDisabled(minMax, 'up', 0);
timepicker.isAlertContains(minMax, `${timepicker.getHoursIn24Format(hourToSet + 1)}`);
});

it(`when user chose (B) hour, then arrow down become unclickable, min hour, which user can chose - B`, () => {
Expand Down

0 comments on commit e433a2c

Please sign in to comment.