From 329b025c745e535fae6dafd6c18f29d4baab6383 Mon Sep 17 00:00:00 2001 From: Carlos Jimenez <=> Date: Tue, 9 Jan 2018 13:51:41 +0100 Subject: [PATCH] e2e paths refactor plus some more tests for Greuge path --- e2e/helpers/nightmare.js | 2 +- e2e/helpers/selectors.js | 5 +- e2e/paths/03_edit_fiscal_data.spec.js | 366 +++++++++++++------------- e2e/paths/04_edit_pay_method.spec.js | 146 ++++++++-- e2e/paths/05_edit_addresses.spec.js | 18 +- e2e/paths/06_edit_web_access.spec.js | 44 ++-- e2e/paths/09_add_greuge.spec.js | 29 +- 7 files changed, 349 insertions(+), 261 deletions(-) diff --git a/e2e/helpers/nightmare.js b/e2e/helpers/nightmare.js index b0b9f7d69..777d17862 100644 --- a/e2e/helpers/nightmare.js +++ b/e2e/helpers/nightmare.js @@ -13,7 +13,7 @@ export default function createNightmare(width = 1280, height = 720) { fail(message); } if (type === 'log') { - console.log(message); + // console.log(message); } }); return nightmare; diff --git a/e2e/helpers/selectors.js b/e2e/helpers/selectors.js index 610bab6a9..a63c03beb 100644 --- a/e2e/helpers/selectors.js +++ b/e2e/helpers/selectors.js @@ -78,6 +78,9 @@ export default { IBANInput: `${components.vnTextfield}[name="iban"]`, dueDayInput: `${components.vnTextfield}[name="dueDay"]`, cancelNotificationButton: 'body > vn-app > vn-vertical > vn-vertical > vn-client-card > vn-main-block > vn-horizontal > vn-one > vn-vertical > vn-client-billing-data > vn-dialog > div > form > div.button-bar > tpl-buttons > button:nth-child(1)', + receivedCoreVNHCheckbox: `${components.vnCheck}[label='Received core VNH'] > label > input`, + receivedCoreVNLCheckbox: `${components.vnCheck}[label='Received core VNL'] > label > input`, + receivedB2BVNLCheckbox: `${components.vnCheck}[label='Received B2B VNL'] > label > input`, saveButton: `${components.vnSubmit}` }, addresses: { @@ -125,7 +128,7 @@ export default { greuge: { greugeButton: `${components.vnMenuItem}[ui-sref="clientCard.greuge.list"]`, addGreugeFloatButton: `${components.vnFloatButton}`, - // creditInput: `${components.vnTextfield}[name="credit"]`, + amountInput: `${components.vnTextfield}[name="Amount"]`, saveButton: `${components.vnSubmit}` // firstGreugeText: '' } diff --git a/e2e/paths/03_edit_fiscal_data.spec.js b/e2e/paths/03_edit_fiscal_data.spec.js index b5c2bcf5c..00449578f 100644 --- a/e2e/paths/03_edit_fiscal_data.spec.js +++ b/e2e/paths/03_edit_fiscal_data.spec.js @@ -131,62 +131,62 @@ describe('Edit fiscalData path', () => { it('should edit the social name', done => { nightmare - .wait(selectors.fiscalData.socialNameInput) - .clearInput(selectors.fiscalData.socialNameInput) - .type(selectors.fiscalData.socialNameInput, 'Hulk edited') - .click(selectors.fiscalData.saveButton) - .wait(selectors.globalItems.snackbarIsActive) - .getInnerText(selectors.globalItems.snackbarIsActive) - .then(result => { - expect(result).toEqual('Data saved!'); - done(); - }) - .catch(catchErrors(done)); + .wait(selectors.fiscalData.socialNameInput) + .clearInput(selectors.fiscalData.socialNameInput) + .type(selectors.fiscalData.socialNameInput, 'Hulk edited') + .click(selectors.fiscalData.saveButton) + .wait(selectors.globalItems.snackbarIsActive) + .getInnerText(selectors.globalItems.snackbarIsActive) + .then(result => { + expect(result).toEqual('Data saved!'); + done(); + }) + .catch(catchErrors(done)); }); it('should confirm the social name have been edited', done => { nightmare - .waitForSnackbarReset() - .waitToClick(selectors.basicData.basicDataButton) - .wait(selectors.basicData.nameInput) - .waitToClick(selectors.fiscalData.fiscalDataButton) - .wait(selectors.fiscalData.socialNameInput) - .getInputValue(selectors.fiscalData.socialNameInput) - .then(result => { - expect(result).toEqual('Hulk edited'); - done(); - }) - .catch(catchErrors(done)); + .waitForSnackbarReset() + .waitToClick(selectors.basicData.basicDataButton) + .wait(selectors.basicData.nameInput) + .waitToClick(selectors.fiscalData.fiscalDataButton) + .wait(selectors.fiscalData.socialNameInput) + .getInputValue(selectors.fiscalData.socialNameInput) + .then(result => { + expect(result).toEqual('Hulk edited'); + done(); + }) + .catch(catchErrors(done)); }); it('should edit the fiscal id', done => { nightmare - .wait(selectors.fiscalData.fiscalIdInput) - .clearInput(selectors.fiscalData.fiscalIdInput) - .type(selectors.fiscalData.fiscalIdInput, '94980061C') - .click(selectors.fiscalData.saveButton) - .wait(selectors.globalItems.snackbarIsActive) - .getInnerText(selectors.globalItems.snackbarIsActive) - .then(result => { - expect(result).toEqual('Data saved!'); - done(); - }) - .catch(catchErrors(done)); + .wait(selectors.fiscalData.fiscalIdInput) + .clearInput(selectors.fiscalData.fiscalIdInput) + .type(selectors.fiscalData.fiscalIdInput, '94980061C') + .click(selectors.fiscalData.saveButton) + .wait(selectors.globalItems.snackbarIsActive) + .getInnerText(selectors.globalItems.snackbarIsActive) + .then(result => { + expect(result).toEqual('Data saved!'); + done(); + }) + .catch(catchErrors(done)); }); it('should confirm the fiscal id have been edited', done => { nightmare - .waitForSnackbarReset() - .waitToClick(selectors.basicData.basicDataButton) - .wait(selectors.basicData.nameInput) - .waitToClick(selectors.fiscalData.fiscalDataButton) - .wait(selectors.fiscalData.fiscalIdInput) - .getInputValue(selectors.fiscalData.fiscalIdInput) - .then(result => { - expect(result).toEqual('94980061C'); - done(); - }) - .catch(catchErrors(done)); + .waitForSnackbarReset() + .waitToClick(selectors.basicData.basicDataButton) + .wait(selectors.basicData.nameInput) + .waitToClick(selectors.fiscalData.fiscalDataButton) + .wait(selectors.fiscalData.fiscalIdInput) + .getInputValue(selectors.fiscalData.fiscalIdInput) + .then(result => { + expect(result).toEqual('94980061C'); + done(); + }) + .catch(catchErrors(done)); }); it('should uncheck the Equalization tax checkbox', done => { @@ -216,19 +216,19 @@ describe('Edit fiscalData path', () => { it('should confirm Equalization tax checkbox is unchecked', done => { nightmare - .waitForSnackbarReset() - .waitToClick(selectors.basicData.basicDataButton) - .wait(selectors.basicData.nameInput) - .waitToClick(selectors.fiscalData.fiscalDataButton) - .wait(selectors.fiscalData.equalizationTaxCheckboxLabel) - .evaluate(selector => { - return document.querySelector(selector).checked; - }, selectors.fiscalData.equalizationTaxCheckboxLabel) - .then(value => { - expect(value).toBeFalsy(); - done(); - }) - .catch(catchErrors(done)); + .waitForSnackbarReset() + .waitToClick(selectors.basicData.basicDataButton) + .wait(selectors.basicData.nameInput) + .waitToClick(selectors.fiscalData.fiscalDataButton) + .wait(selectors.fiscalData.equalizationTaxCheckboxLabel) + .evaluate(selector => { + return document.querySelector(selector).checked; + }, selectors.fiscalData.equalizationTaxCheckboxLabel) + .then(value => { + expect(value).toBeFalsy(); + done(); + }) + .catch(catchErrors(done)); }); describe('Confirm all addresses havent got EQtax as uncheck was propagated', () => { @@ -412,168 +412,168 @@ describe('Edit fiscalData path', () => { it('should confirm active checkbox is unchecked', done => { nightmare - .waitForSnackbarReset() - .waitToClick(selectors.basicData.basicDataButton) - .wait(selectors.basicData.nameInput) - .waitToClick(selectors.fiscalData.fiscalDataButton) - .wait(selectors.fiscalData.activeCheckboxLabel) - .evaluate(selector => { - return document.querySelector(selector).checked; - }, selectors.fiscalData.activeCheckboxLabel) - .then(value => { - expect(value).toBeFalsy(); - done(); - }) - .catch(catchErrors(done)); + .waitForSnackbarReset() + .waitToClick(selectors.basicData.basicDataButton) + .wait(selectors.basicData.nameInput) + .waitToClick(selectors.fiscalData.fiscalDataButton) + .wait(selectors.fiscalData.activeCheckboxLabel) + .evaluate(selector => { + return document.querySelector(selector).checked; + }, selectors.fiscalData.activeCheckboxLabel) + .then(value => { + expect(value).toBeFalsy(); + done(); + }) + .catch(catchErrors(done)); }); - it('should check the invoice by address checkbox', done => { + it('should uncheck the invoice by address checkbox', done => { nightmare - .waitToClick(selectors.fiscalData.invoiceByAddressCheckboxInput) - .waitToClick(selectors.fiscalData.saveButton) - .wait(selectors.globalItems.snackbarIsActive) - .getInnerText(selectors.globalItems.snackbarIsActive) - .then(result => { - expect(result).toEqual('Data saved!'); - done(); - }) - .catch(catchErrors(done)); + .waitToClick(selectors.fiscalData.invoiceByAddressCheckboxInput) + .waitToClick(selectors.fiscalData.saveButton) + .wait(selectors.globalItems.snackbarIsActive) + .getInnerText(selectors.globalItems.snackbarIsActive) + .then(result => { + expect(result).toEqual('Data saved!'); + done(); + }) + .catch(catchErrors(done)); }); - it('should confirm invoice by address checkbox is checked', done => { + it('should confirm invoice by address checkbox is unchecked', done => { nightmare - .waitForSnackbarReset() - .waitToClick(selectors.basicData.basicDataButton) - .wait(selectors.basicData.nameInput) - .waitToClick(selectors.fiscalData.fiscalDataButton) - .wait(selectors.fiscalData.invoiceByAddressCheckboxInput) - .evaluate(selector => { - return document.querySelector(selector).checked; - }, selectors.fiscalData.invoiceByAddressCheckboxInput) - .then(value => { - expect(value).toBeTruthy(); - done(); - }) - .catch(catchErrors(done)); + .waitForSnackbarReset() + .waitToClick(selectors.basicData.basicDataButton) + .wait(selectors.basicData.nameInput) + .waitToClick(selectors.fiscalData.fiscalDataButton) + .wait(selectors.fiscalData.invoiceByAddressCheckboxInput) + .evaluate(selector => { + return document.querySelector(selector).checked; + }, selectors.fiscalData.invoiceByAddressCheckboxInput) + .then(value => { + expect(value).toBeFalsy(); + done(); + }) + .catch(catchErrors(done)); }); it('should check the Verified data checkbox', done => { nightmare - .waitToClick(selectors.fiscalData.verifiedDataCheckboxInput) - .waitToClick(selectors.fiscalData.saveButton) - .wait(selectors.globalItems.snackbarIsActive) - .getInnerText(selectors.globalItems.snackbarIsActive) - .then(result => { - expect(result).toEqual('Data saved!'); - done(); - }) - .catch(catchErrors(done)); + .waitToClick(selectors.fiscalData.verifiedDataCheckboxInput) + .waitToClick(selectors.fiscalData.saveButton) + .wait(selectors.globalItems.snackbarIsActive) + .getInnerText(selectors.globalItems.snackbarIsActive) + .then(result => { + expect(result).toEqual('Data saved!'); + done(); + }) + .catch(catchErrors(done)); }); - it('should confirm Verified data checkbox is checked', done => { + it('should confirm Verified data checkbox is unchecked', done => { nightmare - .waitForSnackbarReset() - .waitToClick(selectors.basicData.basicDataButton) - .wait(selectors.basicData.nameInput) - .waitToClick(selectors.fiscalData.fiscalDataButton) - .wait(selectors.fiscalData.verifiedDataCheckboxInput) - .evaluate(selector => { - return document.querySelector(selector).checked; - }, selectors.fiscalData.verifiedDataCheckboxInput) - .then(value => { - expect(value).toBeTruthy(); - done(); - }) - .catch(catchErrors(done)); + .waitForSnackbarReset() + .waitToClick(selectors.basicData.basicDataButton) + .wait(selectors.basicData.nameInput) + .waitToClick(selectors.fiscalData.fiscalDataButton) + .wait(selectors.fiscalData.verifiedDataCheckboxInput) + .evaluate(selector => { + return document.querySelector(selector).checked; + }, selectors.fiscalData.verifiedDataCheckboxInput) + .then(value => { + expect(value).toBeFalsy(); + done(); + }) + .catch(catchErrors(done)); }); it('should uncheck the Has to invoice checkbox', done => { nightmare - .waitToClick(selectors.fiscalData.hasToInvoiceCheckboxLabel) - .waitToClick(selectors.fiscalData.saveButton) - .wait(selectors.globalItems.snackbarIsActive) - .getInnerText(selectors.globalItems.snackbarIsActive) - .then(result => { - expect(result).toEqual('Data saved!'); - done(); - }) - .catch(catchErrors(done)); + .waitToClick(selectors.fiscalData.hasToInvoiceCheckboxLabel) + .waitToClick(selectors.fiscalData.saveButton) + .wait(selectors.globalItems.snackbarIsActive) + .getInnerText(selectors.globalItems.snackbarIsActive) + .then(result => { + expect(result).toEqual('Data saved!'); + done(); + }) + .catch(catchErrors(done)); }); it('should confirm Has to invoice checkbox is unchecked', done => { nightmare - .waitForSnackbarReset() - .waitToClick(selectors.basicData.basicDataButton) - .wait(selectors.basicData.nameInput) - .waitToClick(selectors.fiscalData.fiscalDataButton) - .wait(selectors.fiscalData.hasToInvoiceCheckboxLabel) - .evaluate(selector => { - return document.querySelector(selector).checked; - }, selectors.fiscalData.hasToInvoiceCheckboxLabel) - .then(value => { - expect(value).toBeFalsy(); - done(); - }) - .catch(catchErrors(done)); + .waitForSnackbarReset() + .waitToClick(selectors.basicData.basicDataButton) + .wait(selectors.basicData.nameInput) + .waitToClick(selectors.fiscalData.fiscalDataButton) + .wait(selectors.fiscalData.hasToInvoiceCheckboxLabel) + .evaluate(selector => { + return document.querySelector(selector).checked; + }, selectors.fiscalData.hasToInvoiceCheckboxLabel) + .then(value => { + expect(value).toBeFalsy(); + done(); + }) + .catch(catchErrors(done)); }); it('should uncheck the Invoice by mail checkbox', done => { nightmare - .waitToClick(selectors.fiscalData.invoiceByMailCheckboxLabel) - .waitToClick(selectors.fiscalData.saveButton) - .wait(selectors.globalItems.snackbarIsActive) - .getInnerText(selectors.globalItems.snackbarIsActive) - .then(result => { - expect(result).toEqual('Data saved!'); - done(); - }) - .catch(catchErrors(done)); + .waitToClick(selectors.fiscalData.invoiceByMailCheckboxLabel) + .waitToClick(selectors.fiscalData.saveButton) + .wait(selectors.globalItems.snackbarIsActive) + .getInnerText(selectors.globalItems.snackbarIsActive) + .then(result => { + expect(result).toEqual('Data saved!'); + done(); + }) + .catch(catchErrors(done)); }); it('should confirm Invoice by mail checkbox is unchecked', done => { nightmare - .waitForSnackbarReset() - .waitToClick(selectors.basicData.basicDataButton) - .wait(selectors.basicData.nameInput) - .waitToClick(selectors.fiscalData.fiscalDataButton) - .wait(selectors.fiscalData.invoiceByMailCheckboxLabel) - .evaluate(selector => { - return document.querySelector(selector).checked; - }, selectors.fiscalData.invoiceByMailCheckboxLabel) - .then(value => { - expect(value).toBeFalsy(); - done(); - }) - .catch(catchErrors(done)); + .waitForSnackbarReset() + .waitToClick(selectors.basicData.basicDataButton) + .wait(selectors.basicData.nameInput) + .waitToClick(selectors.fiscalData.fiscalDataButton) + .wait(selectors.fiscalData.invoiceByMailCheckboxLabel) + .evaluate(selector => { + return document.querySelector(selector).checked; + }, selectors.fiscalData.invoiceByMailCheckboxLabel) + .then(value => { + expect(value).toBeFalsy(); + done(); + }) + .catch(catchErrors(done)); }); it('should check the Vies checkbox', done => { nightmare - .waitToClick(selectors.fiscalData.viesCheckboxInput) - .waitToClick(selectors.fiscalData.saveButton) - .wait(selectors.globalItems.snackbarIsActive) - .getInnerText(selectors.globalItems.snackbarIsActive) - .then(result => { - expect(result).toEqual('Data saved!'); - done(); - }) - .catch(catchErrors(done)); + .waitToClick(selectors.fiscalData.viesCheckboxInput) + .waitToClick(selectors.fiscalData.saveButton) + .wait(selectors.globalItems.snackbarIsActive) + .getInnerText(selectors.globalItems.snackbarIsActive) + .then(result => { + expect(result).toEqual('Data saved!'); + done(); + }) + .catch(catchErrors(done)); }); it('should confirm Vies checkbox is checked', done => { nightmare - .waitForSnackbarReset() - .waitToClick(selectors.basicData.basicDataButton) - .wait(selectors.basicData.nameInput) - .waitToClick(selectors.fiscalData.fiscalDataButton) - .wait(selectors.fiscalData.viesCheckboxInput) - .evaluate(selector => { - return document.querySelector(selector).checked; - }, selectors.fiscalData.viesCheckboxInput) - .then(value => { - expect(value).toBeTruthy(); - done(); - }) - .catch(catchErrors(done)); + .waitForSnackbarReset() + .waitToClick(selectors.basicData.basicDataButton) + .wait(selectors.basicData.nameInput) + .waitToClick(selectors.fiscalData.fiscalDataButton) + .wait(selectors.fiscalData.viesCheckboxInput) + .evaluate(selector => { + return document.querySelector(selector).checked; + }, selectors.fiscalData.viesCheckboxInput) + .then(value => { + expect(value).toBeTruthy(); + done(); + }) + .catch(catchErrors(done)); }); }); diff --git a/e2e/paths/04_edit_pay_method.spec.js b/e2e/paths/04_edit_pay_method.spec.js index 1b12710ad..88e186ad2 100644 --- a/e2e/paths/04_edit_pay_method.spec.js +++ b/e2e/paths/04_edit_pay_method.spec.js @@ -160,35 +160,123 @@ describe('Edit pay method path', () => { .catch(catchErrors(done)); }); - // BUG IBAN validation seems to break down whenever the due day is edited plus due day shouldnt accep values above 31. + it(`should edit the due day`, done => { + nightmare + .clearInput(selectors.payMethod.dueDayInput) + .type(selectors.payMethod.dueDayInput, '60') + .waitToClick(selectors.payMethod.saveButton) + .waitToClick(selectors.payMethod.cancelNotificationButton) + .wait(selectors.globalItems.snackbarIsActive) + .getInnerText(selectors.globalItems.snackbarIsActive) + .then(result => { + expect(result).toEqual('Data saved!'); + done(); + }) + .catch(catchErrors(done)); + }); - // it(`should edit the due day`, done => { - // nightmare - // .clearInput(selectors.payMethod.dueDayInput) - // .type(selectors.payMethod.dueDayInput, '25') - // .waitToClick(selectors.payMethod.saveButton) - // .waitToClick(selectors.payMethod.cancelNotificationButton) - // .wait(selectors.globalItems.snackbarIsActive) - // .getInnerText(selectors.globalItems.snackbarIsActive) - // .then(result => { - // expect(result).toEqual('Data saved!'); - // done(); - // }) - // .catch(catchErrors(done)); - // }); + it('should confirm the due day have been edited', done => { + nightmare + .waitForSnackbarReset() + .waitToClick(selectors.basicData.basicDataButton) + .wait(selectors.basicData.nameInput) + .waitToClick(selectors.payMethod.payMethodButton) + .wait(selectors.payMethod.dueDayInput) + .getInputValue(selectors.payMethod.dueDayInput) + .then(result => { + expect(result).toEqual('60'); + done(); + }) + .catch(catchErrors(done)); + }); - // it('should confirm the due day have been edited', done => { - // nightmare - // .waitForSnackbarReset() - // .waitToClick(selectors.basicData.basicDataButton) - // .wait(selectors.basicData.nameInput) - // .waitToClick(selectors.payMethod.payMethodButton) - // .wait(selectors.payMethod.dueDayInput) - // .getInputValue(selectors.payMethod.dueDayInput) - // .then(result => { - // expect(result).toEqual('25'); - // done(); - // }) - // .catch(catchErrors(done)); - // }); + it('should uncheck the Received core VNH checkbox', done => { + nightmare + .waitToClick(selectors.payMethod.receivedCoreVNHCheckbox) + .waitToClick(selectors.payMethod.saveButton) + .wait(selectors.globalItems.snackbarIsActive) + .getInnerText(selectors.globalItems.snackbarIsActive) + .then(result => { + expect(result).toEqual('Data saved!'); + done(); + }) + .catch(catchErrors(done)); + }); + + it('should confirm Received core VNH checkbox is unchecked', done => { + nightmare + .waitForSnackbarReset() + .waitToClick(selectors.basicData.basicDataButton) + .wait(selectors.basicData.nameInput) + .waitToClick(selectors.payMethod.payMethodButton) + .wait(selectors.payMethod.receivedCoreVNHCheckbox) + .evaluate(selector => { + return document.querySelector(selector).checked; + }, selectors.payMethod.receivedCoreVNHCheckbox) + .then(value => { + expect(value).toBeFalsy(); + done(); + }) + .catch(catchErrors(done)); + }); + + it('should uncheck the Received core VNL checkbox', done => { + nightmare + .waitToClick(selectors.payMethod.receivedCoreVNLCheckbox) + .waitToClick(selectors.payMethod.saveButton) + .wait(selectors.globalItems.snackbarIsActive) + .getInnerText(selectors.globalItems.snackbarIsActive) + .then(result => { + expect(result).toEqual('Data saved!'); + done(); + }) + .catch(catchErrors(done)); + }); + + it('should confirm Received core VNL checkbox is unchecked', done => { + nightmare + .waitForSnackbarReset() + .waitToClick(selectors.basicData.basicDataButton) + .wait(selectors.basicData.nameInput) + .waitToClick(selectors.payMethod.payMethodButton) + .wait(selectors.payMethod.receivedCoreVNLCheckbox) + .evaluate(selector => { + return document.querySelector(selector).checked; + }, selectors.payMethod.receivedCoreVNLCheckbox) + .then(value => { + expect(value).toBeFalsy(); + done(); + }) + .catch(catchErrors(done)); + }); + + it('should uncheck the Received B2B VNL checkbox', done => { + nightmare + .waitToClick(selectors.payMethod.receivedB2BVNLCheckbox) + .waitToClick(selectors.payMethod.saveButton) + .wait(selectors.globalItems.snackbarIsActive) + .getInnerText(selectors.globalItems.snackbarIsActive) + .then(result => { + expect(result).toEqual('Data saved!'); + done(); + }) + .catch(catchErrors(done)); + }); + + it('should confirm Received B2B VNL checkbox is unchecked', done => { + nightmare + .waitForSnackbarReset() + .waitToClick(selectors.basicData.basicDataButton) + .wait(selectors.basicData.nameInput) + .waitToClick(selectors.payMethod.payMethodButton) + .wait(selectors.payMethod.receivedB2BVNLCheckbox) + .evaluate(selector => { + return document.querySelector(selector).checked; + }, selectors.payMethod.receivedB2BVNLCheckbox) + .then(value => { + expect(value).toBeFalsy(); + done(); + }) + .catch(catchErrors(done)); + }); }); diff --git a/e2e/paths/05_edit_addresses.spec.js b/e2e/paths/05_edit_addresses.spec.js index 631affcd7..63966d8ba 100644 --- a/e2e/paths/05_edit_addresses.spec.js +++ b/e2e/paths/05_edit_addresses.spec.js @@ -98,15 +98,15 @@ describe('Edit addresses path', () => { it('should check the default checkbox then receive an error after clicking save button as the form is empty', done => { nightmare - .waitToClick(selectors.addresses.defaultCheckboxInput) - .waitToClick(selectors.fiscalData.saveButton) - .wait(selectors.globalItems.snackbarIsActive) - .getInnerText(selectors.globalItems.snackbarIsActive) - .then(result => { - expect(result).toContain('Error'); - done(); - }) - .catch(catchErrors(done)); + .waitToClick(selectors.addresses.defaultCheckboxInput) + .waitToClick(selectors.fiscalData.saveButton) + .wait(selectors.globalItems.snackbarIsActive) + .getInnerText(selectors.globalItems.snackbarIsActive) + .then(result => { + expect(result).toContain('Error'); + done(); + }) + .catch(catchErrors(done)); }); it('should receive an error when clicking the save button having all the form fields empty but consignee', done => { diff --git a/e2e/paths/06_edit_web_access.spec.js b/e2e/paths/06_edit_web_access.spec.js index 3748dbb9c..e42e46561 100644 --- a/e2e/paths/06_edit_web_access.spec.js +++ b/e2e/paths/06_edit_web_access.spec.js @@ -86,32 +86,32 @@ describe('Edit web access path', () => { it(`should click on the Enable web access checkbox to uncheck it`, done => { nightmare - .waitToClick(selectors.webAccess.enableWebAccessCheckbox) - .waitToClick(selectors.fiscalData.saveButton) - .wait(selectors.globalItems.snackbarIsActive) - .getInnerText(selectors.globalItems.snackbarIsActive) - .then(result => { - expect(result).toContain(`Data saved!`); - done(); - }) - .catch(catchErrors(done)); + .waitToClick(selectors.webAccess.enableWebAccessCheckbox) + .waitToClick(selectors.fiscalData.saveButton) + .wait(selectors.globalItems.snackbarIsActive) + .getInnerText(selectors.globalItems.snackbarIsActive) + .then(result => { + expect(result).toContain(`Data saved!`); + done(); + }) + .catch(catchErrors(done)); }); it('should confirm Enable web access checkbox is unchecked', done => { nightmare - .waitForSnackbarReset() - .waitToClick(selectors.basicData.basicDataButton) - .wait(selectors.basicData.nameInput) - .waitToClick(selectors.webAccess.webAccessButton) - .wait(selectors.webAccess.enableWebAccessCheckbox) - .evaluate(selector => { - return document.querySelector(selector).checked; - }, selectors.webAccess.enableWebAccessCheckbox) - .then(value => { - expect(value).toBeFalsy(); - done(); - }) - .catch(catchErrors(done)); + .waitForSnackbarReset() + .waitToClick(selectors.basicData.basicDataButton) + .wait(selectors.basicData.nameInput) + .waitToClick(selectors.webAccess.webAccessButton) + .wait(selectors.webAccess.enableWebAccessCheckbox) + .evaluate(selector => { + return document.querySelector(selector).checked; + }, selectors.webAccess.enableWebAccessCheckbox) + .then(value => { + expect(value).toBeFalsy(); + done(); + }) + .catch(catchErrors(done)); }); it('should edit the User name', done => { diff --git a/e2e/paths/09_add_greuge.spec.js b/e2e/paths/09_add_greuge.spec.js index a062a1eae..83c18702a 100644 --- a/e2e/paths/09_add_greuge.spec.js +++ b/e2e/paths/09_add_greuge.spec.js @@ -7,7 +7,7 @@ const moduleAccessViewHashURL = '#!/'; jasmine.DEFAULT_TIMEOUT_INTERVAL = 10000; -describe('Add greuge path', () => { +fdescribe('Add greuge path', () => { describe('warm up', () => { it('should warm up login and fixtures', done => { nightmare @@ -87,11 +87,8 @@ describe('Add greuge path', () => { it(`should click on the add greuge button`, done => { nightmare .waitToClick(selectors.greuge.addGreugeFloatButton) - .wait(500) .waitForURL('greuge/create') - .wait(500) .url() - .wait(500) .then(url => { expect(url).toContain('greuge/create'); done(); @@ -99,18 +96,18 @@ describe('Add greuge path', () => { .catch(catchErrors(done)); }); - // it(`should add a new greuge`, done => { - // nightmare - // .type(selectors.credit.creditInput, 999) - // .click(selectors.credit.saveButton) - // .wait(selectors.globalItems.snackbarIsActive) - // .getInnerText(selectors.globalItems.snackbarIsActive) - // .then(result => { - // expect(result).toEqual('Data saved!'); - // done(); - // }) - // .catch(catchErrors(done)); - // }); + it(`should add a new greuge`, done => { + nightmare + .type(selectors.greuge.amountInput, 999) + .click(selectors.credit.saveButton) + .wait(selectors.globalItems.snackbarIsActive) + .getInnerText(selectors.globalItems.snackbarIsActive) + .then(result => { + expect(result).toContain('Error'); + done(); + }) + .catch(catchErrors(done)); + }); // it('should confirm the credit was updated', done => { // nightmare