From 648bd46862708ee5e672c6428fd398e81a303745 Mon Sep 17 00:00:00 2001 From: Carlos Jimenez Ruiz <jacarlosjimenezruiz@gmail.com> Date: Wed, 23 Jan 2019 15:33:25 +0100 Subject: [PATCH] small e2e refactors --- .../claim-module/01_edit_basic_data.spec.js | 4 +- e2e/paths/claim-module/03_detail.spec.js | 6 +- .../client-module/01_create_client.spec.js | 20 +++---- .../client-module/02_edit_basic_data.spec.js | 20 +++---- .../client-module/03_edit_fiscal_data.spec.js | 14 ++--- .../client-module/04_edit_pay_method.spec.js | 14 ++--- .../06_add_address_notes.spec.js | 7 +-- .../client-module/07_edit_web_access.spec.js | 2 +- e2e/paths/client-module/08_add_notes.spec.js | 2 +- e2e/paths/client-module/09_add_credit.spec.js | 2 +- e2e/paths/client-module/10_add_greuge.spec.js | 4 +- .../12_lock_of_verified_data.spec.js | 22 +++---- e2e/paths/client-module/13_log.spec.js | 3 +- e2e/paths/client-module/14_risk.spec.js | 9 ++- e2e/paths/item-module/01_item_summary.spec.js | 5 +- .../02_edit_item_basic_data.spec.js | 7 +-- .../item-module/04_create_item_tags.spec.js | 4 +- .../item-module/05_create_item_niche.spec.js | 2 +- .../06_create_item_botanical.spec.js | 5 +- .../07_create_item_barcode.spec.js | 8 +-- .../item-module/09_regularize_item.spec.js | 22 +++---- .../01_create_ticket_observations.spec.js | 2 +- .../04_create_ticket_packages.spec.js | 6 +- .../05_create_new_tracking_state.spec.js | 2 +- e2e/paths/ticket-module/07_edit_sale.spec.js | 57 +++++++------------ .../ticket-module/09_ticket_weekly.spec.js | 6 +- .../ticket-module/10_ticket_request.spec.js | 7 +-- .../ticket-module/11_ticket_diary.spec.js | 3 +- .../12_delete_ticket_from_descriptor.spec.js | 6 +- loopback/locale/es.json | 3 +- package-lock.json | 12 ++-- 31 files changed, 123 insertions(+), 163 deletions(-) diff --git a/e2e/paths/claim-module/01_edit_basic_data.spec.js b/e2e/paths/claim-module/01_edit_basic_data.spec.js index 6bc5b87ba7..283e4b7659 100644 --- a/e2e/paths/claim-module/01_edit_basic_data.spec.js +++ b/e2e/paths/claim-module/01_edit_basic_data.spec.js @@ -16,7 +16,7 @@ describe('Claim edit basic data path', () => { .autocompleteSearch(selectors.claimBasicData.claimStateAutocomplete, 'Gestionado') .waitToClick(selectors.claimBasicData.isPaidWithManaCheckbox) .clearInput(selectors.claimBasicData.observationInput) - .type(selectors.claimBasicData.observationInput, 'edited observation') + .write(selectors.claimBasicData.observationInput, 'edited observation') .click(selectors.claimBasicData.saveButton) .waitForSnackbar(); @@ -55,7 +55,7 @@ describe('Claim edit basic data path', () => { .autocompleteSearch(selectors.claimBasicData.claimStateAutocomplete, 'Pendiente') .waitToClick(selectors.claimBasicData.isPaidWithManaCheckbox) .clearInput(selectors.claimBasicData.observationInput) - .type(selectors.claimBasicData.observationInput, 'Observation one') + .write(selectors.claimBasicData.observationInput, 'Observation one') .click(selectors.claimBasicData.saveButton) .waitForSnackbar(); diff --git a/e2e/paths/claim-module/03_detail.spec.js b/e2e/paths/claim-module/03_detail.spec.js index ae27f3b348..1a7112ff8f 100644 --- a/e2e/paths/claim-module/03_detail.spec.js +++ b/e2e/paths/claim-module/03_detail.spec.js @@ -30,7 +30,7 @@ describe('Claim detail', () => { it('should edit de second item claimed quantity', async() => { const result = await nightmare .write(selectors.claimDetail.secondItemQuantityInput, 10) - .type('body', '\u000d') // simulates enter + .write('body', '\u000d') // simulates enter .waitForLastSnackbar(); expect(result).toEqual('Data saved!'); @@ -38,10 +38,10 @@ describe('Claim detail', () => { it('should confirm the second item, and the claimed total were correctly edited', async() => { const claimedQuantity = await nightmare - .getProperty(selectors.claimDetail.secondItemQuantityInput, 'value'); + .waitToGetProperty(selectors.claimDetail.secondItemQuantityInput, 'value'); const totalClaimed = await nightmare - .getProperty(selectors.claimDetail.totalClaimed, 'innerText'); + .waitToGetProperty(selectors.claimDetail.totalClaimed, 'innerText'); expect(claimedQuantity).toEqual('10'); expect(totalClaimed).toEqual('29.50 €'); diff --git a/e2e/paths/client-module/01_create_client.spec.js b/e2e/paths/client-module/01_create_client.spec.js index 06c981c15e..b6a4c54f7f 100644 --- a/e2e/paths/client-module/01_create_client.spec.js +++ b/e2e/paths/client-module/01_create_client.spec.js @@ -11,8 +11,7 @@ describe('Client create path', () => { it(`should search for the user Carol Danvers to confirm it isn't created yet`, async() => { const result = await nightmare - .wait(selectors.clientsIndex.searchClientInput) - .type(selectors.clientsIndex.searchClientInput, 'Carol Danvers') + .write(selectors.clientsIndex.searchClientInput, 'Carol Danvers') .click(selectors.clientsIndex.searchButton) .waitForNumberOfElements(selectors.clientsIndex.searchResult, 0) .countElement(selectors.clientsIndex.searchResult); @@ -39,9 +38,9 @@ describe('Client create path', () => { it('should receive an error when clicking the create button having name and Business name fields empty', async() => { const result = await nightmare - .type(selectors.createClientView.taxNumber, '74451390E') - .type(selectors.createClientView.userName, 'CaptainMarvel') - .type(selectors.createClientView.email, 'CarolDanvers@verdnatura.es') + .write(selectors.createClientView.taxNumber, '74451390E') + .write(selectors.createClientView.userName, 'CaptainMarvel') + .write(selectors.createClientView.email, 'CarolDanvers@verdnatura.es') .autocompleteSearch(selectors.createClientView.salesPersonAutocomplete, 'Accessory') .click(selectors.createClientView.createButton) .waitForLastSnackbar(); @@ -51,10 +50,10 @@ describe('Client create path', () => { it(`should attempt to create a new user with all it's data but wrong email`, async() => { const result = await nightmare - .type(selectors.createClientView.name, 'Carol Danvers') - .type(selectors.createClientView.socialName, 'AVG tax') + .write(selectors.createClientView.name, 'Carol Danvers') + .write(selectors.createClientView.socialName, 'AVG tax') .clearInput(selectors.createClientView.email) - .type(selectors.createClientView.email, 'incorrect email format') + .write(selectors.createClientView.email, 'incorrect email format') .click(selectors.createClientView.createButton) .waitForLastSnackbar(); @@ -64,7 +63,7 @@ describe('Client create path', () => { it(`should create a new user with all correct data`, async() => { const result = await nightmare .clearInput(selectors.createClientView.email) - .type(selectors.createClientView.email, 'caroldanvers@verdnatura.es') + .write(selectors.createClientView.email, 'caroldanvers@verdnatura.es') .click(selectors.createClientView.createButton) .waitForLastSnackbar(); @@ -84,8 +83,7 @@ describe('Client create path', () => { it(`should search for the user Carol Danvers to confirm it exists`, async() => { const result = await nightmare - .wait(selectors.clientsIndex.searchClientInput) - .type(selectors.clientsIndex.searchClientInput, 'Carol Danvers') + .write(selectors.clientsIndex.searchClientInput, 'Carol Danvers') .click(selectors.clientsIndex.searchButton) .waitForNumberOfElements(selectors.clientsIndex.searchResult, 1) .countElement(selectors.clientsIndex.searchResult); diff --git a/e2e/paths/client-module/02_edit_basic_data.spec.js b/e2e/paths/client-module/02_edit_basic_data.spec.js index 0f3111ab91..43a8274cd5 100644 --- a/e2e/paths/client-module/02_edit_basic_data.spec.js +++ b/e2e/paths/client-module/02_edit_basic_data.spec.js @@ -24,15 +24,15 @@ describe('Client Edit basicData path', () => { it('should edit the client basic data but leave salesPerson untainted', async() => { const result = await nightmare .clearInput(selectors.clientBasicData.nameInput) - .type(selectors.clientBasicData.nameInput, 'Ptonomy Wallace') + .write(selectors.clientBasicData.nameInput, 'Ptonomy Wallace') .clearInput(selectors.clientBasicData.contactInput) - .type(selectors.clientBasicData.contactInput, 'David Haller') + .write(selectors.clientBasicData.contactInput, 'David Haller') .clearInput(selectors.clientBasicData.phoneInput) - .type(selectors.clientBasicData.phoneInput, '987654321') + .write(selectors.clientBasicData.phoneInput, '987654321') .clearInput(selectors.clientBasicData.mobileInput) - .type(selectors.clientBasicData.mobileInput, '123456789') + .write(selectors.clientBasicData.mobileInput, '123456789') .clearInput(selectors.clientBasicData.emailInput) - .type(selectors.clientBasicData.emailInput, 'PWallace@verdnatura.es') + .write(selectors.clientBasicData.emailInput, 'PWallace@verdnatura.es') .autocompleteSearch(selectors.clientBasicData.channelAutocomplete, 'Rumors on the streets') .click(selectors.clientBasicData.saveButton) .waitForLastSnackbar(); @@ -108,15 +108,15 @@ describe('Client Edit basicData path', () => { it('should edit the client basic data including salesPerson', async() => { const result = await nightmare .clearInput(selectors.clientBasicData.nameInput) - .type(selectors.clientBasicData.nameInput, 'Ororo Munroe') + .write(selectors.clientBasicData.nameInput, 'Ororo Munroe') .clearInput(selectors.clientBasicData.contactInput) - .type(selectors.clientBasicData.contactInput, 'Black Panther') + .write(selectors.clientBasicData.contactInput, 'Black Panther') .clearInput(selectors.clientBasicData.phoneInput) - .type(selectors.clientBasicData.phoneInput, '123456789') + .write(selectors.clientBasicData.phoneInput, '123456789') .clearInput(selectors.clientBasicData.mobileInput) - .type(selectors.clientBasicData.mobileInput, '987654321') + .write(selectors.clientBasicData.mobileInput, '987654321') .clearInput(selectors.clientBasicData.emailInput) - .type(selectors.clientBasicData.emailInput, 'Storm@verdnatura.es') + .write(selectors.clientBasicData.emailInput, 'Storm@verdnatura.es') .autocompleteSearch(selectors.clientBasicData.salesPersonAutocomplete, 'Accessory') .autocompleteSearch(selectors.clientBasicData.channelAutocomplete, 'Metropolis newspaper') .click(selectors.clientBasicData.saveButton) diff --git a/e2e/paths/client-module/03_edit_fiscal_data.spec.js b/e2e/paths/client-module/03_edit_fiscal_data.spec.js index ada6adb78c..1686556916 100644 --- a/e2e/paths/client-module/03_edit_fiscal_data.spec.js +++ b/e2e/paths/client-module/03_edit_fiscal_data.spec.js @@ -67,15 +67,15 @@ describe('Client Edit fiscalData path', () => { const result = await nightmare .wait(selectors.clientFiscalData.socialNameInput) .clearInput(selectors.clientFiscalData.socialNameInput) - .type(selectors.clientFiscalData.socialNameInput, 'SMASH!') + .write(selectors.clientFiscalData.socialNameInput, 'SMASH!') .clearInput(selectors.clientFiscalData.fiscalIdInput) - .type(selectors.clientFiscalData.fiscalIdInput, '94980061C') + .write(selectors.clientFiscalData.fiscalIdInput, '94980061C') .clearInput(selectors.clientFiscalData.addressInput) - .type(selectors.clientFiscalData.addressInput, 'Somewhere edited') + .write(selectors.clientFiscalData.addressInput, 'Somewhere edited') .clearInput(selectors.clientFiscalData.postcodeInput) - .type(selectors.clientFiscalData.postcodeInput, '12345') + .write(selectors.clientFiscalData.postcodeInput, '12345') .clearInput(selectors.clientFiscalData.cityInput) - .type(selectors.clientFiscalData.cityInput, 'N/A') + .write(selectors.clientFiscalData.cityInput, 'N/A') .autocompleteSearch(selectors.clientFiscalData.countryAutocomplete, 'Francia') .autocompleteSearch(selectors.clientFiscalData.provinceAutocomplete, 'Province two') .waitToClick(selectors.clientFiscalData.activeCheckboxLabel) @@ -96,7 +96,7 @@ describe('Client Edit fiscalData path', () => { const result = await nightmare .waitToClick(selectors.clientFiscalData.viesCheckboxInput) .clearInput(selectors.clientFiscalData.fiscalIdInput) - .type(selectors.clientFiscalData.fiscalIdInput, 'A94980061C') + .write(selectors.clientFiscalData.fiscalIdInput, 'A94980061C') .waitToClick(selectors.clientFiscalData.saveButton) .waitForLastSnackbar(); @@ -106,7 +106,7 @@ describe('Client Edit fiscalData path', () => { it('should finally edit the fixcal data correctly as VIES isnt checked and fiscal id is valid for EQtax', async() => { const result = await nightmare .clearInput(selectors.clientFiscalData.fiscalIdInput) - .type(selectors.clientFiscalData.fiscalIdInput, '94980061C') + .write(selectors.clientFiscalData.fiscalIdInput, '94980061C') .waitToClick(selectors.clientFiscalData.saveButton) .waitForLastSnackbar(); diff --git a/e2e/paths/client-module/04_edit_pay_method.spec.js b/e2e/paths/client-module/04_edit_pay_method.spec.js index ee26b5cf3e..5af4c894f0 100644 --- a/e2e/paths/client-module/04_edit_pay_method.spec.js +++ b/e2e/paths/client-module/04_edit_pay_method.spec.js @@ -16,7 +16,7 @@ describe('Client Edit pay method path', () => { .autocompleteSearch(selectors.clientPayMethod.payMethodAutocomplete, 'PayMethod with IBAN') .autocompleteSearch(selectors.clientPayMethod.swiftBicAutocomplete, 'BBKKESMMMMM') .clearInput(selectors.clientPayMethod.dueDayInput) - .type(selectors.clientPayMethod.dueDayInput, '60') + .write(selectors.clientPayMethod.dueDayInput, '60') .waitForTextInInput(selectors.clientPayMethod.dueDayInput, '60') .waitToClick(selectors.clientPayMethod.receivedCoreLCRCheckbox) .waitToClick(selectors.clientPayMethod.receivedCoreVNLCheckbox) @@ -31,7 +31,7 @@ describe('Client Edit pay method path', () => { const snackbarMessage = await nightmare .waitToClick(selectors.clientPayMethod.clearswiftBicButton) .clearInput(selectors.clientPayMethod.IBANInput) - .type(selectors.clientPayMethod.IBANInput, 'FR9121000418450200051332') + .write(selectors.clientPayMethod.IBANInput, 'FR9121000418450200051332') .waitForTextInInput(selectors.clientPayMethod.IBANInput, 'FR9121000418450200051332') .wait(1000) .waitToClick(selectors.clientPayMethod.saveButton) @@ -42,10 +42,10 @@ describe('Client Edit pay method path', () => { it(`should create a new BIC code`, async() => { const newcode = await nightmare - .click(selectors.clientPayMethod.newBankEntityButton) - .type(selectors.clientPayMethod.newBankEntityName, 'Gotham City Bank') - .type(selectors.clientPayMethod.newBankEntityBIC, 'GTHMCT') - .click(selectors.clientPayMethod.acceptBankEntityButton) + .waitToClick(selectors.clientPayMethod.newBankEntityButton) + .write(selectors.clientPayMethod.newBankEntityName, 'Gotham City Bank') + .write(selectors.clientPayMethod.newBankEntityBIC, 'GTHMCT') + .waitToClick(selectors.clientPayMethod.acceptBankEntityButton) .waitToGetProperty(`${selectors.clientPayMethod.swiftBicAutocomplete} input`, 'value'); expect(newcode).toEqual('GTHMCT Gotham City Bank'); @@ -62,7 +62,7 @@ describe('Client Edit pay method path', () => { const AutomaticCode = await nightmare .clearInput(selectors.clientPayMethod.IBANInput) .waitToClick(selectors.clientPayMethod.clearswiftBicButton) - .type(selectors.clientPayMethod.IBANInput, 'ES9121000418450200051332') + .write(selectors.clientPayMethod.IBANInput, 'ES9121000418450200051332') .waitToGetProperty(`${selectors.clientPayMethod.swiftBicAutocomplete} input`, 'value'); expect(AutomaticCode).toEqual('CAIXESBB Caixa Bank'); diff --git a/e2e/paths/client-module/06_add_address_notes.spec.js b/e2e/paths/client-module/06_add_address_notes.spec.js index a27f624302..5434bfc085 100644 --- a/e2e/paths/client-module/06_add_address_notes.spec.js +++ b/e2e/paths/client-module/06_add_address_notes.spec.js @@ -24,8 +24,7 @@ describe('Client add address notes path', () => { it('should not save a description without observation type', async() => { const result = await nightmare .waitToClick(selectors.clientAddresses.addObservationButton) - .wait(selectors.clientAddresses.firstObservationDescriptionInput) - .type(selectors.clientAddresses.firstObservationDescriptionInput, 'first description') + .write(selectors.clientAddresses.firstObservationDescriptionInput, 'first description') .waitToClick(selectors.clientAddresses.saveButton) .waitForLastSnackbar(); @@ -44,10 +43,10 @@ describe('Client add address notes path', () => { it('should create two new observations', async() => { const result = await nightmare - .type(selectors.clientAddresses.firstObservationDescriptionInput, 'first description') + .write(selectors.clientAddresses.firstObservationDescriptionInput, 'first description') .waitToClick(selectors.clientAddresses.addObservationButton) .autocompleteSearch(selectors.clientAddresses.secondObservationTypeAutocomplete, 'observation one') - .type(selectors.clientAddresses.secondObservationDescriptionInput, 'second description') + .write(selectors.clientAddresses.secondObservationDescriptionInput, 'second description') .waitToClick(selectors.clientAddresses.saveButton) .waitForLastSnackbar(); diff --git a/e2e/paths/client-module/07_edit_web_access.spec.js b/e2e/paths/client-module/07_edit_web_access.spec.js index 71721d9ca1..6f8ef2843f 100644 --- a/e2e/paths/client-module/07_edit_web_access.spec.js +++ b/e2e/paths/client-module/07_edit_web_access.spec.js @@ -15,7 +15,7 @@ describe('Client Edit web access path', () => { const result = await nightmare .waitToClick(selectors.clientWebAccess.enableWebAccessCheckbox) .clearInput(selectors.clientWebAccess.userNameInput) - .type(selectors.clientWebAccess.userNameInput, 'Hulk') + .write(selectors.clientWebAccess.userNameInput, 'Hulk') .waitToClick(selectors.clientWebAccess.saveButton) .waitForLastSnackbar(); diff --git a/e2e/paths/client-module/08_add_notes.spec.js b/e2e/paths/client-module/08_add_notes.spec.js index 5a488ff676..c5c9defbc2 100644 --- a/e2e/paths/client-module/08_add_notes.spec.js +++ b/e2e/paths/client-module/08_add_notes.spec.js @@ -22,7 +22,7 @@ describe('Client Add notes path', () => { it(`should create a note`, async() => { const result = await nightmare - .type(selectors.clientNotes.noteInput, 'Meeting with Black Widow 21st 9am') + .write(selectors.clientNotes.noteInput, 'Meeting with Black Widow 21st 9am') .click(selectors.clientNotes.saveButton) .waitForLastSnackbar(); diff --git a/e2e/paths/client-module/09_add_credit.spec.js b/e2e/paths/client-module/09_add_credit.spec.js index 0cbd0c7037..a37fb0e736 100644 --- a/e2e/paths/client-module/09_add_credit.spec.js +++ b/e2e/paths/client-module/09_add_credit.spec.js @@ -23,7 +23,7 @@ describe('Client Add credit path', () => { it(`should edit the credit`, async() => { const result = await nightmare .clearInput(selectors.clientCredit.creditInput) - .type(selectors.clientCredit.creditInput, 999) + .write(selectors.clientCredit.creditInput, 999) .click(selectors.clientCredit.saveButton) .waitForLastSnackbar(); diff --git a/e2e/paths/client-module/10_add_greuge.spec.js b/e2e/paths/client-module/10_add_greuge.spec.js index c1ca1ba18f..5f845df84f 100644 --- a/e2e/paths/client-module/10_add_greuge.spec.js +++ b/e2e/paths/client-module/10_add_greuge.spec.js @@ -31,9 +31,9 @@ describe('Client Add greuge path', () => { it(`should create a new greuge with all its data`, async() => { const result = await nightmare - .type(selectors.clientGreuge.amountInput, 999) + .write(selectors.clientGreuge.amountInput, 999) .waitForTextInInput(selectors.clientGreuge.amountInput, '999') - .type(selectors.clientGreuge.descriptionInput, 'new armor for Batman!') + .write(selectors.clientGreuge.descriptionInput, 'new armor for Batman!') .click(selectors.clientGreuge.saveButton) .waitForLastSnackbar(); diff --git a/e2e/paths/client-module/12_lock_of_verified_data.spec.js b/e2e/paths/client-module/12_lock_of_verified_data.spec.js index 9026325519..ba0141a783 100644 --- a/e2e/paths/client-module/12_lock_of_verified_data.spec.js +++ b/e2e/paths/client-module/12_lock_of_verified_data.spec.js @@ -27,7 +27,7 @@ describe('Client lock verified data path', () => { const result = await nightmare .wait(selectors.clientFiscalData.socialNameInput) .clearInput(selectors.clientFiscalData.socialNameInput) - .type(selectors.clientFiscalData.socialNameInput, 'salesPerson was here') + .write(selectors.clientFiscalData.socialNameInput, 'salesPerson was here') .click(selectors.clientFiscalData.saveButton) .waitForLastSnackbar(); @@ -65,8 +65,7 @@ describe('Client lock verified data path', () => { it('should search again for the user Petter Parker', async() => { const resultCount = await nightmare - .wait(selectors.clientsIndex.searchClientInput) - .type(selectors.clientsIndex.searchClientInput, 'Petter Parker') + .write(selectors.clientsIndex.searchClientInput, 'Petter Parker') .click(selectors.clientsIndex.searchButton) .waitForNumberOfElements(selectors.clientsIndex.searchResult, 1) .countElement(selectors.clientsIndex.searchResult); @@ -130,7 +129,7 @@ describe('Client lock verified data path', () => { const result = await nightmare .wait(selectors.clientFiscalData.socialNameInput) .clearInput(selectors.clientFiscalData.socialNameInput) - .type(selectors.clientFiscalData.socialNameInput, 'administrative was here') + .write(selectors.clientFiscalData.socialNameInput, 'administrative was here') .click(selectors.clientFiscalData.saveButton) .waitForLastSnackbar(); @@ -168,8 +167,7 @@ describe('Client lock verified data path', () => { it('should again search for the user Petter Parker', async() => { const resultCount = await nightmare - .wait(selectors.clientsIndex.searchClientInput) - .type(selectors.clientsIndex.searchClientInput, 'Petter Parker') + .write(selectors.clientsIndex.searchClientInput, 'Petter Parker') .click(selectors.clientsIndex.searchButton) .waitForNumberOfElements(selectors.clientsIndex.searchResult, 1) .countElement(selectors.clientsIndex.searchResult); @@ -209,9 +207,8 @@ describe('Client lock verified data path', () => { it('should not be able to save change throwing a verified data error', async() => { const result = await nightmare - .wait(selectors.clientFiscalData.socialNameInput) .clearInput(selectors.clientFiscalData.socialNameInput) - .type(selectors.clientFiscalData.socialNameInput, 'salesPerson was here') + .write(selectors.clientFiscalData.socialNameInput, 'salesPerson was here') .click(selectors.clientFiscalData.saveButton) .waitForSnackbar(); @@ -239,8 +236,7 @@ describe('Client lock verified data path', () => { it('should now search again for the user Petter Parker', async() => { const resultCount = await nightmare - .wait(selectors.clientsIndex.searchClientInput) - .type(selectors.clientsIndex.searchClientInput, 'Petter Parker') + .write(selectors.clientsIndex.searchClientInput, 'Petter Parker') .click(selectors.clientsIndex.searchButton) .waitForNumberOfElements(selectors.clientsIndex.searchResult, 1) .countElement(selectors.clientsIndex.searchResult); @@ -280,9 +276,8 @@ describe('Client lock verified data path', () => { it('should now edit the social name', async() => { const result = await nightmare - .wait(selectors.clientFiscalData.socialNameInput) .clearInput(selectors.clientFiscalData.socialNameInput) - .type(selectors.clientFiscalData.socialNameInput, 'salesAssistant was here') + .write(selectors.clientFiscalData.socialNameInput, 'salesAssistant was here') .click(selectors.clientFiscalData.saveButton) .waitForLastSnackbar(); @@ -320,8 +315,7 @@ describe('Client lock verified data path', () => { it('should once again search for the user Petter Parker', async() => { const resultCount = await nightmare - .wait(selectors.clientsIndex.searchClientInput) - .type(selectors.clientsIndex.searchClientInput, 'Petter Parker') + .write(selectors.clientsIndex.searchClientInput, 'Petter Parker') .click(selectors.clientsIndex.searchButton) .waitForNumberOfElements(selectors.clientsIndex.searchResult, 1) .countElement(selectors.clientsIndex.searchResult); diff --git a/e2e/paths/client-module/13_log.spec.js b/e2e/paths/client-module/13_log.spec.js index 046c281fc1..2a82744ff3 100644 --- a/e2e/paths/client-module/13_log.spec.js +++ b/e2e/paths/client-module/13_log.spec.js @@ -13,9 +13,8 @@ describe('Client log path', () => { it('should update the clients name', async() => { let result = await nightmare - .wait(selectors.clientBasicData.nameInput) .clearInput(selectors.clientBasicData.nameInput) - .type(selectors.clientBasicData.nameInput, 'this is a test') + .write(selectors.clientBasicData.nameInput, 'this is a test') .waitToClick(selectors.clientBasicData.saveButton) .waitForLastSnackbar(); diff --git a/e2e/paths/client-module/14_risk.spec.js b/e2e/paths/client-module/14_risk.spec.js index 49154daeed..3f8e2eb8bf 100644 --- a/e2e/paths/client-module/14_risk.spec.js +++ b/e2e/paths/client-module/14_risk.spec.js @@ -23,7 +23,7 @@ describe('Client risk path', () => { it('should create a new payment that clears the debt', async() => { let result = await nightmare .clearInput(selectors.clientRisk.newPaymentBankInut) - .type(selectors.clientRisk.newPaymentBankInut, '2') + .write(selectors.clientRisk.newPaymentBankInut, '2') .waitToClick(selectors.clientRisk.saveButton) .waitForLastSnackbar(); @@ -49,7 +49,7 @@ describe('Client risk path', () => { it('should create a new payment that sets the balance to positive value', async() => { let result = await nightmare .clearInput(selectors.clientRisk.newPaymentAmountInput) - .type(selectors.clientRisk.newPaymentAmountInput, '100') + .write(selectors.clientRisk.newPaymentAmountInput, '100') .waitToClick(selectors.clientRisk.saveButton) .waitForLastSnackbar(); @@ -75,7 +75,7 @@ describe('Client risk path', () => { it('should create a new payment that sets the balance back to the original negative value', async() => { let result = await nightmare .clearInput(selectors.clientRisk.newPaymentAmountInput) - .type(selectors.clientRisk.newPaymentAmountInput, '-150') + .write(selectors.clientRisk.newPaymentAmountInput, '-150') .waitToClick(selectors.clientRisk.saveButton) .waitForLastSnackbar(); @@ -103,8 +103,7 @@ describe('Client risk path', () => { it('should now search for the user Petter Parker', async() => { let resultCount = await nightmare - .wait(selectors.clientsIndex.searchClientInput) - .type(selectors.clientsIndex.searchClientInput, 'Petter Parker') + .write(selectors.clientsIndex.searchClientInput, 'Petter Parker') .click(selectors.clientsIndex.searchButton) .waitForNumberOfElements(selectors.clientsIndex.searchResult, 1) .countElement(selectors.clientsIndex.searchResult); diff --git a/e2e/paths/item-module/01_item_summary.spec.js b/e2e/paths/item-module/01_item_summary.spec.js index d454ddf815..b5922be358 100644 --- a/e2e/paths/item-module/01_item_summary.spec.js +++ b/e2e/paths/item-module/01_item_summary.spec.js @@ -11,8 +11,7 @@ describe('Item summary path', () => { it('should search for an item', async() => { const result = await nightmare - .wait(selectors.itemsIndex.searchItemInput) - .type(selectors.itemsIndex.searchItemInput, 'Object1 Gem1 5') + .write(selectors.itemsIndex.searchItemInput, 'Object1 Gem1 5') .click(selectors.itemsIndex.searchButton) .waitForNumberOfElements(selectors.itemsIndex.searchResult, 1) .countElement(selectors.itemsIndex.searchResult); @@ -85,7 +84,7 @@ describe('Item summary path', () => { const result = await nightmare .clearInput('vn-item-index vn-searchbar input') .click(selectors.itemsIndex.searchButton) - .type(selectors.itemsIndex.searchItemInput, 'Object2 Gem2 3') + .write(selectors.itemsIndex.searchItemInput, 'Object2 Gem2 3') .click(selectors.itemsIndex.searchButton) .waitForNumberOfElements(selectors.itemsIndex.searchResult, 1) .countElement(selectors.itemsIndex.searchResult); diff --git a/e2e/paths/item-module/02_edit_item_basic_data.spec.js b/e2e/paths/item-module/02_edit_item_basic_data.spec.js index 0d0a397d9d..2c74400c82 100644 --- a/e2e/paths/item-module/02_edit_item_basic_data.spec.js +++ b/e2e/paths/item-module/02_edit_item_basic_data.spec.js @@ -13,17 +13,16 @@ describe('Item Edit basic data path', () => { it(`should edit the item basic data`, async() => { const result = await nightmare - .wait(selectors.itemBasicData.nameInput) .clearInput(selectors.itemBasicData.nameInput) - .type(selectors.itemBasicData.nameInput, 'Rose of Purity') + .write(selectors.itemBasicData.nameInput, 'Rose of Purity') .autocompleteSearch(selectors.itemBasicData.typeAutocomplete, 'Crisantemo') .autocompleteSearch(selectors.itemBasicData.intrastatAutocomplete, 'Coral y materiales similares') .clearInput(selectors.itemBasicData.relevancyInput) - .type(selectors.itemBasicData.relevancyInput, '1') + .write(selectors.itemBasicData.relevancyInput, '1') .autocompleteSearch(selectors.itemBasicData.originAutocomplete, 'Spain') .autocompleteSearch(selectors.itemBasicData.expenceAutocomplete, 'Alquiler VNH') .clearInput(selectors.itemBasicData.longNameInput) - .type(selectors.itemBasicData.longNameInput, 'RS Rose of Purity') + .write(selectors.itemBasicData.longNameInput, 'RS Rose of Purity') .waitToClick(selectors.itemBasicData.isActiveCheckbox) .waitToClick(selectors.itemBasicData.submitBasicDataButton) .waitForLastSnackbar(); diff --git a/e2e/paths/item-module/04_create_item_tags.spec.js b/e2e/paths/item-module/04_create_item_tags.spec.js index 2362a36c31..b4df877817 100644 --- a/e2e/paths/item-module/04_create_item_tags.spec.js +++ b/e2e/paths/item-module/04_create_item_tags.spec.js @@ -16,9 +16,9 @@ describe('Item create tags path', () => { .waitToClick(selectors.itemTags.fourthRemoveTagButton) .waitToClick(selectors.itemTags.addItemTagButton) .autocompleteSearch(selectors.itemTags.seventhTagAutocomplete, 'Ancho de la base') - .type(selectors.itemTags.seventhValueInput, '50') + .write(selectors.itemTags.seventhValueInput, '50') .clearInput(selectors.itemTags.seventhRelevancyInput) - .type(selectors.itemTags.seventhRelevancyInput, '4') + .write(selectors.itemTags.seventhRelevancyInput, '4') .click(selectors.itemTags.submitItemTagsButton) .waitForLastSnackbar(); diff --git a/e2e/paths/item-module/05_create_item_niche.spec.js b/e2e/paths/item-module/05_create_item_niche.spec.js index db63c1d3ff..1ce170f6dd 100644 --- a/e2e/paths/item-module/05_create_item_niche.spec.js +++ b/e2e/paths/item-module/05_create_item_niche.spec.js @@ -16,7 +16,7 @@ describe('Item create niche path', () => { .waitToClick(selectors.itemNiches.addNicheButton) .waitToClick(selectors.itemNiches.secondNicheRemoveButton) .autocompleteSearch(selectors.itemNiches.thirdWarehouseAutocomplete, 'Warehouse Two') - .type(selectors.itemNiches.thirdCodeInput, 'A4') + .write(selectors.itemNiches.thirdCodeInput, 'A4') .click(selectors.itemNiches.submitNichesButton) .waitForLastSnackbar(); diff --git a/e2e/paths/item-module/06_create_item_botanical.spec.js b/e2e/paths/item-module/06_create_item_botanical.spec.js index 1e7103e604..fa0f339f90 100644 --- a/e2e/paths/item-module/06_create_item_botanical.spec.js +++ b/e2e/paths/item-module/06_create_item_botanical.spec.js @@ -13,8 +13,7 @@ describe('Item Create botanical path', () => { it(`should create a new botanical for the item`, async() => { const result = await nightmare - .wait(selectors.itemBotanical.botanicalInput) - .type(selectors.itemBotanical.botanicalInput, 'Cicuta maculata') + .write(selectors.itemBotanical.botanicalInput, 'Cicuta maculata') .autocompleteSearch(selectors.itemBotanical.genusAutocomplete, 'Abelia') .autocompleteSearch(selectors.itemBotanical.speciesAutocomplete, 'dealbata') .waitToClick(selectors.itemBotanical.submitBotanicalButton) @@ -52,7 +51,7 @@ describe('Item Create botanical path', () => { it(`should edit botanical for the item`, async() => { const result = await nightmare .clearInput(selectors.itemBotanical.botanicalInput) - .type(selectors.itemBotanical.botanicalInput, 'Herp Derp') + .write(selectors.itemBotanical.botanicalInput, 'Herp Derp') .autocompleteSearch(selectors.itemBotanical.genusAutocomplete, 'Abies') .autocompleteSearch(selectors.itemBotanical.speciesAutocomplete, 'decurrens') .waitToClick(selectors.itemBotanical.submitBotanicalButton) diff --git a/e2e/paths/item-module/07_create_item_barcode.spec.js b/e2e/paths/item-module/07_create_item_barcode.spec.js index b396bd05d1..5bcfde7d1c 100644 --- a/e2e/paths/item-module/07_create_item_barcode.spec.js +++ b/e2e/paths/item-module/07_create_item_barcode.spec.js @@ -15,8 +15,7 @@ describe('Item Create barcodes path', () => { const result = await nightmare .waitToClick(selectors.itemBarcodes.firstCodeRemoveButton) .waitToClick(selectors.itemBarcodes.addBarcodeButton) - .wait(selectors.itemBarcodes.thirdCodeInput) - .type(selectors.itemBarcodes.thirdCodeInput, '5') + .write(selectors.itemBarcodes.thirdCodeInput, '5') .waitToClick(selectors.itemBarcodes.submitBarcodesButton) .waitForLastSnackbar(); @@ -25,9 +24,8 @@ describe('Item Create barcodes path', () => { it(`should confirm the barcode 5 is created and it is now the third barcode as the first was deleted`, async() => { const result = await nightmare - .click(selectors.itemBasicData.basicDataButton) - .wait(selectors.itemBasicData.nameInput) - .click(selectors.itemBarcodes.barcodeButton) + .waitToClick(selectors.itemBasicData.basicDataButton) + .waitToClick(selectors.itemBarcodes.barcodeButton) .waitForTextInInput(selectors.itemBarcodes.thirdCodeInput, '5') .waitToGetProperty(selectors.itemBarcodes.thirdCodeInput, 'value'); diff --git a/e2e/paths/item-module/09_regularize_item.spec.js b/e2e/paths/item-module/09_regularize_item.spec.js index 07ceb4e622..76879c4abf 100644 --- a/e2e/paths/item-module/09_regularize_item.spec.js +++ b/e2e/paths/item-module/09_regularize_item.spec.js @@ -10,9 +10,8 @@ describe('Item regularize path', () => { it('should search for the item', async() => { const resultCount = await nightmare - .wait(selectors.itemsIndex.searchItemInput) - .type(selectors.itemsIndex.searchItemInput, 'Object5 Weapon 50') - .click(selectors.itemsIndex.searchButton) + .write(selectors.itemsIndex.searchItemInput, 'Object5 Weapon 50') + .waitToClick(selectors.itemsIndex.searchButton) .waitForNumberOfElements(selectors.itemsIndex.searchResult, 1) .countElement(selectors.itemsIndex.searchResult); @@ -33,8 +32,7 @@ describe('Item regularize path', () => { const result = await nightmare .waitToClick(selectors.itemDescriptor.moreMenu) .waitToClick(selectors.itemDescriptor.moreMenuRegularizeButton) - .wait(selectors.itemDescriptor.regularizeQuantityInput) - .type(selectors.itemDescriptor.regularizeQuantityInput, 100) + .write(selectors.itemDescriptor.regularizeQuantityInput, 100) .autocompleteSearch(selectors.itemDescriptor.regularizeWarehouseAutocomplete, 'Warehouse One') .waitToClick(selectors.itemDescriptor.regularizeSaveButton) .waitForLastSnackbar(); @@ -55,9 +53,8 @@ describe('Item regularize path', () => { it('should search for the ticket with alias missing', async() => { const result = await nightmare - .wait(selectors.ticketsIndex.searchTicketInput) - .type(selectors.ticketsIndex.searchTicketInput, 'missing') - .click(selectors.ticketsIndex.searchButton) + .write(selectors.ticketsIndex.searchTicketInput, 'missing') + .waitToClick(selectors.ticketsIndex.searchButton) .waitForNumberOfElements(selectors.ticketsIndex.searchResult, 1) .countElement(selectors.ticketsIndex.searchResult); @@ -102,8 +99,7 @@ describe('Item regularize path', () => { it('should search for the item once again', async() => { const resultCount = await nightmare - .wait(selectors.itemsIndex.searchItemInput) - .type(selectors.itemsIndex.searchItemInput, 'Object5 Weapon 50') + .write(selectors.itemsIndex.searchItemInput, 'Object5 Weapon 50') .click(selectors.itemsIndex.searchButton) .waitForNumberOfElements(selectors.itemsIndex.searchResult, 1) .countElement(selectors.itemsIndex.searchResult); @@ -125,8 +121,7 @@ describe('Item regularize path', () => { const result = await nightmare .waitToClick(selectors.itemDescriptor.moreMenu) .waitToClick(selectors.itemDescriptor.moreMenuRegularizeButton) - .wait(selectors.itemDescriptor.regularizeQuantityInput) - .type(selectors.itemDescriptor.regularizeQuantityInput, 100) + .write(selectors.itemDescriptor.regularizeQuantityInput, 100) .autocompleteSearch(selectors.itemDescriptor.regularizeWarehouseAutocomplete, 'Warehouse One') .waitToClick(selectors.itemDescriptor.regularizeSaveButton) .waitForLastSnackbar(); @@ -147,8 +142,7 @@ describe('Item regularize path', () => { it('should search for the ticket with id 23 once again', async() => { const result = await nightmare - .wait(selectors.ticketsIndex.searchTicketInput) - .type(selectors.ticketsIndex.searchTicketInput, 'id:23') + .write(selectors.ticketsIndex.searchTicketInput, 'id:23') .click(selectors.ticketsIndex.searchButton) .waitForNumberOfElements(selectors.ticketsIndex.searchResult, 1) .countElement(selectors.ticketsIndex.searchResult); diff --git a/e2e/paths/ticket-module/01_create_ticket_observations.spec.js b/e2e/paths/ticket-module/01_create_ticket_observations.spec.js index 0beded9702..584d090aa9 100644 --- a/e2e/paths/ticket-module/01_create_ticket_observations.spec.js +++ b/e2e/paths/ticket-module/01_create_ticket_observations.spec.js @@ -16,7 +16,7 @@ describe('Ticket Create notes path', () => { .waitToClick(selectors.ticketNotes.firstNoteRemoveButton) .waitToClick(selectors.ticketNotes.addNoteButton) .autocompleteSearch(selectors.ticketNotes.firstNoteTypeAutocomplete, 'observation one') - .type(selectors.ticketNotes.firstDescriptionInput, 'description') + .write(selectors.ticketNotes.firstDescriptionInput, 'description') .click(selectors.ticketNotes.submitNotesButton) .waitForLastSnackbar(); diff --git a/e2e/paths/ticket-module/04_create_ticket_packages.spec.js b/e2e/paths/ticket-module/04_create_ticket_packages.spec.js index 39536da613..d989845052 100644 --- a/e2e/paths/ticket-module/04_create_ticket_packages.spec.js +++ b/e2e/paths/ticket-module/04_create_ticket_packages.spec.js @@ -24,7 +24,7 @@ describe('Ticket Create packages path', () => { it(`should attempt create a new package but receive an error if quantity is a string`, async() => { const result = await nightmare - .type(selectors.ticketPackages.firstQuantityInput, 'ninety 9') + .write(selectors.ticketPackages.firstQuantityInput, 'ninety 9') .click(selectors.ticketPackages.savePackagesButton) .waitForLastSnackbar(); @@ -34,7 +34,7 @@ describe('Ticket Create packages path', () => { it(`should attempt create a new package but receive an error if quantity is 0`, async() => { const result = await nightmare .clearInput(selectors.ticketPackages.firstQuantityInput) - .type(selectors.ticketPackages.firstQuantityInput, 0) + .write(selectors.ticketPackages.firstQuantityInput, 0) .click(selectors.ticketPackages.savePackagesButton) .waitForLastSnackbar(); @@ -44,7 +44,7 @@ describe('Ticket Create packages path', () => { it(`should attempt create a new package but receive an error if package is blank`, async() => { const result = await nightmare .clearInput(selectors.ticketPackages.firstQuantityInput) - .type(selectors.ticketPackages.firstQuantityInput, 99) + .write(selectors.ticketPackages.firstQuantityInput, 99) .click(selectors.ticketPackages.clearPackageAutocompleteButton) .click(selectors.ticketPackages.savePackagesButton) .waitForLastSnackbar(); diff --git a/e2e/paths/ticket-module/05_create_new_tracking_state.spec.js b/e2e/paths/ticket-module/05_create_new_tracking_state.spec.js index 8ed39f2a00..1a179b041d 100644 --- a/e2e/paths/ticket-module/05_create_new_tracking_state.spec.js +++ b/e2e/paths/ticket-module/05_create_new_tracking_state.spec.js @@ -23,7 +23,7 @@ describe('Ticket Create new tracking state path', () => { it(`should attempt create a new state but receive an error if state is empty`, async() => { let result = await nightmare - .click(selectors.createStateView.saveStateButton) + .waitToClick(selectors.createStateView.saveStateButton) .waitForLastSnackbar(); expect(result).toEqual('State cannot be blank'); diff --git a/e2e/paths/ticket-module/07_edit_sale.spec.js b/e2e/paths/ticket-module/07_edit_sale.spec.js index a13afcd26b..432ea0910d 100644 --- a/e2e/paths/ticket-module/07_edit_sale.spec.js +++ b/e2e/paths/ticket-module/07_edit_sale.spec.js @@ -34,8 +34,7 @@ describe('Ticket Edit sale path', () => { it('should again search for a specific ticket', async() => { const result = await nightmare - .wait(selectors.ticketsIndex.searchTicketInput) - .type(selectors.ticketsIndex.searchTicketInput, 'id:16') + .write(selectors.ticketsIndex.searchTicketInput, 'id:16') .click(selectors.ticketsIndex.searchButton) .waitForNumberOfElements(selectors.ticketsIndex.searchResult, 1) .countElement(selectors.ticketsIndex.searchResult); @@ -123,8 +122,7 @@ describe('Ticket Edit sale path', () => { .waitToClick(selectors.globalItems.applicationsMenuButton) .wait(selectors.globalItems.applicationsMenuVisible) .waitToClick(selectors.globalItems.ticketsButton) - .wait(selectors.ticketsIndex.searchTicketInput) - .type(selectors.ticketsIndex.searchTicketInput, 'id:16') + .write(selectors.ticketsIndex.searchTicketInput, 'id:16') .click(selectors.ticketsIndex.searchButton) .waitForNumberOfElements(selectors.ticketsIndex.searchResult, 1) .waitForTextInElement(selectors.ticketsIndex.searchResult, 'address 21') @@ -139,7 +137,7 @@ describe('Ticket Edit sale path', () => { it('should try to add a higher quantity value and then receive an error', async() => { const result = await nightmare .waitToClick(selectors.ticketSales.firstSaleQuantityClearInput) - .type(selectors.ticketSales.firstSaleQuantity, '9\u000d') + .write(selectors.ticketSales.firstSaleQuantity, '9\u000d') .waitForLastSnackbar(); expect(result).toEqual('The new quantity should be smaller than the old one'); @@ -148,7 +146,7 @@ describe('Ticket Edit sale path', () => { it('should remove 1 from quantity', async() => { const result = await nightmare .waitToClick(selectors.ticketSales.firstSaleQuantityClearInput) - .type(selectors.ticketSales.firstSaleQuantity, '4\u000d') + .write(selectors.ticketSales.firstSaleQuantity, '4\u000d') .waitForLastSnackbar(); expect(result).toEqual('Data saved!'); @@ -157,9 +155,8 @@ describe('Ticket Edit sale path', () => { it('should update the price', async() => { const result = await nightmare .waitToClick(selectors.ticketSales.firstSalePrice) - .wait(selectors.ticketSales.firstSalePriceInput) - .type(selectors.ticketSales.firstSalePriceInput, 5) - .type('body', '\u000d') // simulates enter + .write(selectors.ticketSales.firstSalePriceInput, 5) + .write('body', '\u000d') // simulates enter .waitForLastSnackbar(); expect(result).toEqual('Data saved!'); @@ -183,8 +180,8 @@ describe('Ticket Edit sale path', () => { const result = await nightmare .waitToClick(selectors.ticketSales.firstSaleDiscount) .wait('vn-textfield[label="Discount"] > div[class="container selected"]') // a function selects the text after it's loaded - .type(selectors.ticketSales.firstSaleDiscountInput, 50) - .type('body', '\u000d') // simulates enter + .write(selectors.ticketSales.firstSaleDiscountInput, 50) + .write('body', '\u000d') // simulates enter .waitForLastSnackbar(); expect(result).toEqual('Data saved!'); @@ -230,8 +227,7 @@ describe('Ticket Edit sale path', () => { it('should search for the claim with id 4', async() => { const result = await nightmare - .wait(selectors.claimsIndex.searchResult) - .type(selectors.claimsIndex.searchClaimInput, 4) + .write(selectors.claimsIndex.searchClaimInput, 4) .click(selectors.claimsIndex.searchButton) .waitForNumberOfElements(selectors.claimsIndex.searchResult, 1) .countElement(selectors.claimsIndex.searchResult); @@ -252,8 +248,7 @@ describe('Ticket Edit sale path', () => { it('should search the ticket', async() => { const result = await nightmare - .wait(selectors.ticketsIndex.searchTicketInput) - .type(selectors.ticketsIndex.searchTicketInput, 'id:16') + .write(selectors.ticketsIndex.searchTicketInput, 'id:16') .click(selectors.ticketsIndex.searchButton) .waitForNumberOfElements(selectors.ticketsIndex.searchResult, 1) .countElement(selectors.ticketsIndex.searchResult); @@ -293,8 +288,7 @@ describe('Ticket Edit sale path', () => { const result = await nightmare .waitToClick(selectors.ticketSales.thirdSaleCheckbox) .waitToClick(selectors.ticketSales.transferSaleButton) - .wait(selectors.ticketSales.moveToTicketInput) - .type(selectors.ticketSales.moveToTicketInput, 2) + .write(selectors.ticketSales.moveToTicketInput, 2) .waitToClick(selectors.ticketSales.moveToTicketButton) .waitForLastSnackbar(); @@ -304,7 +298,7 @@ describe('Ticket Edit sale path', () => { it('should transfer the sale to a valid ticket', async() => { const result = await nightmare .waitToClick(selectors.ticketSales.moveToTicketInputClearButton) - .type(selectors.ticketSales.moveToTicketInput, 12) + .write(selectors.ticketSales.moveToTicketInput, 12) .waitToClick(selectors.ticketSales.moveToTicketButton) .waitForURL('ticket/12/sale') .parsedUrl(); @@ -323,8 +317,7 @@ describe('Ticket Edit sale path', () => { it('should go back to the original ticket sales section', async() => { const url = await nightmare .waitToClick(selectors.itemsIndex.goBackToModuleIndexButton) - .wait(selectors.ticketsIndex.searchTicketInput) - .type(selectors.ticketsIndex.searchTicketInput, 'id:16') + .write(selectors.ticketsIndex.searchTicketInput, 'id:16') .click(selectors.ticketsIndex.searchButton) .waitForNumberOfElements(selectors.ticketsIndex.searchResult, 1) .waitForTextInElement(selectors.ticketsIndex.searchResult, 'address 21') @@ -347,8 +340,7 @@ describe('Ticket Edit sale path', () => { it('should go back to the receiver ticket sales section', async() => { const url = await nightmare .waitToClick(selectors.itemsIndex.goBackToModuleIndexButton) - .wait(selectors.ticketsIndex.searchTicketInput) - .type(selectors.ticketsIndex.searchTicketInput, 'id:12') + .write(selectors.ticketsIndex.searchTicketInput, 'id:12') .click(selectors.ticketsIndex.searchButton) .waitForNumberOfElements(selectors.ticketsIndex.searchResult, 1) .waitForTextInElement(selectors.ticketsIndex.searchResult, 'address 21') @@ -364,8 +356,7 @@ describe('Ticket Edit sale path', () => { const result = await nightmare .waitToClick(selectors.ticketSales.firstSaleCheckbox) .waitToClick(selectors.ticketSales.transferSaleButton) - .wait(selectors.ticketSales.moveToTicketInput) - .type(selectors.ticketSales.moveToTicketInput, 16) + .write(selectors.ticketSales.moveToTicketInput, 16) .waitToClick(selectors.ticketSales.moveToTicketButton) .waitForURL('ticket/16/sale') .parsedUrl(); @@ -384,8 +375,7 @@ describe('Ticket Edit sale path', () => { it('should now go back to the original ticket sales section', async() => { const url = await nightmare .waitToClick(selectors.itemsIndex.goBackToModuleIndexButton) - .wait(selectors.ticketsIndex.searchTicketInput) - .type(selectors.ticketsIndex.searchTicketInput, 'id:8') + .write(selectors.ticketsIndex.searchTicketInput, 'id:8') .click(selectors.ticketsIndex.searchButton) .waitForNumberOfElements(selectors.ticketsIndex.searchResult, 1) .waitForTextInElement(selectors.ticketsIndex.searchResult, 'address 24') @@ -402,6 +392,7 @@ describe('Ticket Edit sale path', () => { .waitToClick(selectors.ticketSales.firstSaleCheckbox) .waitToClick(selectors.ticketSales.transferSaleButton) .waitToClick(selectors.ticketSales.moveToNewTicketButton) + .resetLogin() .waitForLogin('salesPerson') .waitToClick(selectors.globalItems.applicationsMenuButton) .wait(selectors.globalItems.applicationsMenuVisible) @@ -414,8 +405,7 @@ describe('Ticket Edit sale path', () => { it('should search for a specific created ticket', async() => { const result = await nightmare - .wait(selectors.ticketsIndex.searchTicketInput) - .type(selectors.ticketsIndex.searchTicketInput, 'nickname:(address 24) stateFk:2') + .write(selectors.ticketsIndex.searchTicketInput, 'nickname:(address 24) stateFk:2') .click(selectors.ticketsIndex.searchButton) .waitForNumberOfElements(selectors.ticketsIndex.searchResult, 1) .countElement(selectors.ticketsIndex.searchResult); @@ -475,9 +465,8 @@ describe('Ticket Edit sale path', () => { .waitToClick(selectors.ticketSales.selectAllSalesCheckbox) .waitToClick(selectors.ticketSales.moreMenuButton) .waitToClick(selectors.ticketSales.moreMenuUpdateDiscount) - .wait(selectors.ticketSales.moreMenuUpdateDiscountInput) - .type(selectors.ticketSales.moreMenuUpdateDiscountInput, 100) - .type('body', '\u000d') // simulates enter + .write(selectors.ticketSales.moreMenuUpdateDiscountInput, 100) + .write('body', '\u000d') // simulates enter .waitForTextInElement(selectors.ticketSales.totalImport, '0.00') .waitToGetProperty(selectors.ticketSales.totalImport, 'innerText'); @@ -499,8 +488,7 @@ describe('Ticket Edit sale path', () => { it('should now search for a specific ticket', async() => { const result = await nightmare - .wait(selectors.ticketsIndex.searchTicketInput) - .type(selectors.ticketsIndex.searchTicketInput, 'id:16') + .write(selectors.ticketsIndex.searchTicketInput, 'id:16') .click(selectors.ticketsIndex.searchButton) .waitForNumberOfElements(selectors.ticketsIndex.searchResult, 1) .countElement(selectors.ticketsIndex.searchResult); @@ -587,8 +575,7 @@ describe('Ticket Edit sale path', () => { it('should once again search for a specific ticket', async() => { const result = await nightmare - .wait(selectors.ticketsIndex.searchTicketInput) - .type(selectors.ticketsIndex.searchTicketInput, 'id:16') + .write(selectors.ticketsIndex.searchTicketInput, 'id:16') .click(selectors.ticketsIndex.searchButton) .waitForNumberOfElements(selectors.ticketsIndex.searchResult, 1) .countElement(selectors.ticketsIndex.searchResult); diff --git a/e2e/paths/ticket-module/09_ticket_weekly.spec.js b/e2e/paths/ticket-module/09_ticket_weekly.spec.js index c92633d81b..1c7ed936e5 100644 --- a/e2e/paths/ticket-module/09_ticket_weekly.spec.js +++ b/e2e/paths/ticket-module/09_ticket_weekly.spec.js @@ -32,8 +32,7 @@ describe('Ticket descriptor path', () => { it('should search for the ticket 11', async() => { const result = await nightmare - .wait(selectors.ticketsIndex.searchTicketInput) - .type(selectors.ticketsIndex.searchTicketInput, 'id:11') + .write(selectors.ticketsIndex.searchTicketInput, 'id:11') .click(selectors.ticketsIndex.searchButton) .waitForNumberOfElements(selectors.ticketsIndex.searchResult, 1) .countElement(selectors.ticketsIndex.searchResult); @@ -93,8 +92,7 @@ describe('Ticket descriptor path', () => { it('should now search for the ticket 11', async() => { const result = await nightmare - .wait(selectors.ticketsIndex.searchTicketInput) - .type(selectors.ticketsIndex.searchTicketInput, 'id:11') + .write(selectors.ticketsIndex.searchTicketInput, 'id:11') .click(selectors.ticketsIndex.searchButton) .waitForNumberOfElements(selectors.ticketsIndex.searchResult, 1) .countElement(selectors.ticketsIndex.searchResult); diff --git a/e2e/paths/ticket-module/10_ticket_request.spec.js b/e2e/paths/ticket-module/10_ticket_request.spec.js index fcc7eb0a44..24d601900e 100644 --- a/e2e/paths/ticket-module/10_ticket_request.spec.js +++ b/e2e/paths/ticket-module/10_ticket_request.spec.js @@ -14,12 +14,11 @@ describe('Ticket purchase request path', () => { it(`should add a new request`, async() => { const result = await nightmare .waitToClick(selectors.ticketRequests.addRequestButton) - .wait(selectors.ticketRequests.descriptionInput) - .type(selectors.ticketRequests.descriptionInput, 'New stuff') - .type(selectors.ticketRequests.quantityInput, 99) + .write(selectors.ticketRequests.descriptionInput, 'New stuff') + .write(selectors.ticketRequests.quantityInput, 99) .waitToClick(selectors.ticketRequests.atenderSelect) .waitToClick(selectors.ticketRequests.atenderSelectSecondOption) - .type(selectors.ticketRequests.priceInput, 999) + .write(selectors.ticketRequests.priceInput, 999) .waitToClick(selectors.ticketRequests.saveButton) .waitForLastSnackbar(); diff --git a/e2e/paths/ticket-module/11_ticket_diary.spec.js b/e2e/paths/ticket-module/11_ticket_diary.spec.js index 10b05363d1..2f45b54cf8 100644 --- a/e2e/paths/ticket-module/11_ticket_diary.spec.js +++ b/e2e/paths/ticket-module/11_ticket_diary.spec.js @@ -12,8 +12,7 @@ describe('Ticket diary path', () => { it('should search for a specific ticket', async() => { const result = await nightmare - .wait(selectors.ticketsIndex.searchTicketInput) - .type(selectors.ticketsIndex.searchTicketInput, 'id:1') + .write(selectors.ticketsIndex.searchTicketInput, 'id:1') .click(selectors.ticketsIndex.searchButton) .waitForNumberOfElements(selectors.ticketsIndex.searchResult, 1) .countElement(selectors.ticketsIndex.searchResult); diff --git a/e2e/paths/ticket-module/12_delete_ticket_from_descriptor.spec.js b/e2e/paths/ticket-module/12_delete_ticket_from_descriptor.spec.js index 47951b6084..c76719ac26 100644 --- a/e2e/paths/ticket-module/12_delete_ticket_from_descriptor.spec.js +++ b/e2e/paths/ticket-module/12_delete_ticket_from_descriptor.spec.js @@ -11,8 +11,7 @@ describe('Ticket descriptor path', () => { it('should search for a specific ticket', async() => { const result = await nightmare - .wait(selectors.ticketsIndex.searchTicketInput) - .type(selectors.ticketsIndex.searchTicketInput, 'id:17') + .write(selectors.ticketsIndex.searchTicketInput, 'id:17') .click(selectors.ticketsIndex.searchButton) .waitForNumberOfElements(selectors.ticketsIndex.searchResult, 1) .countElement(selectors.ticketsIndex.searchResult); @@ -49,8 +48,7 @@ describe('Ticket descriptor path', () => { it(`should search for the deleted ticket and check it's date`, async() => { const result = await nightmare - .wait(selectors.ticketsIndex.searchTicketInput) - .type(selectors.ticketsIndex.searchTicketInput, 'id:17') + .write(selectors.ticketsIndex.searchTicketInput, 'id:17') .click(selectors.ticketsIndex.searchButton) .waitForNumberOfElements(selectors.ticketsIndex.searchResult, 1) .wait(selectors.ticketsIndex.searchResultDate) diff --git a/loopback/locale/es.json b/loopback/locale/es.json index 24f787d33b..f7f1287414 100644 --- a/loopback/locale/es.json +++ b/loopback/locale/es.json @@ -64,5 +64,6 @@ "Cannot check Equalization Tax in this NIF/CIF": "No se puede marcar RE en este NIF/CIF", "You can't make changes on the basic data of an confirmed order or with rows": "No puedes cambiar los datos basicos de una orden con artículos", "INVALID_USER_NAME": "El nombre de usuario solo debe contener letras minúsculas o, a partir del segundo carácter, números o subguiones, no esta permitido el uso de la letra ñ", - "You can't create a ticket for a frozen client": "No puedes crear un ticket para un cliente congelado" + "You can't create a ticket for a frozen client": "No puedes crear un ticket para un cliente congelado", + "You can't create a ticket for a inactive client": "No puedes crear un ticket para un cliente inactivo" } \ No newline at end of file diff --git a/package-lock.json b/package-lock.json index a86dbaddbb..b707709812 100644 --- a/package-lock.json +++ b/package-lock.json @@ -4019,7 +4019,7 @@ "dot-prop": { "version": "4.2.0", "resolved": "https://registry.npmjs.org/dot-prop/-/dot-prop-4.2.0.tgz", - "integrity": "sha1-HxngwuGqDjJ5fEl5nyg3rGr2nFc=", + "integrity": "sha512-tUMXrxlExSW6U2EXiiKGSBVdYgtV8qlHL+C10TsW4PURY/ic+eaysnSkwB4kA/mBlCyy/IKDJ+Lc3wbWeaXtuQ==", "dev": true, "requires": { "is-obj": "^1.0.0" @@ -4192,7 +4192,7 @@ }, "jsonfile": { "version": "2.4.0", - "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-2.4.0.tgz", + "resolved": "http://registry.npmjs.org/jsonfile/-/jsonfile-2.4.0.tgz", "integrity": "sha1-NzaitCi4e72gzIO1P6PWM6NcKug=", "dev": true, "requires": { @@ -8179,7 +8179,7 @@ "karma-chrome-launcher": { "version": "2.2.0", "resolved": "https://registry.npmjs.org/karma-chrome-launcher/-/karma-chrome-launcher-2.2.0.tgz", - "integrity": "sha1-zxudBxNswY/iOTJ9JGVMPbw2is8=", + "integrity": "sha512-uf/ZVpAabDBPvdPdveyk1EPgbnloPvFFGgmRhYLTDH7gEB4nZdSBk8yTU47w1g/drLSx5uMOkjKk7IWKfWg/+w==", "dev": true, "requires": { "fs-access": "^1.0.0", @@ -14290,7 +14290,7 @@ "split2": { "version": "2.2.0", "resolved": "https://registry.npmjs.org/split2/-/split2-2.2.0.tgz", - "integrity": "sha1-GGsldbz4PoW30YRldWI47k7kJJM=", + "integrity": "sha512-RAb22TG39LhI31MbreBgIuKiIKhVsawfTgEGqKHTK87aG+ul/PB8Sqoi3I7kVdRWiCfrKxK3uo4/YUkpNvhPbw==", "dev": true, "requires": { "through2": "^2.0.2" @@ -15322,7 +15322,7 @@ "touch": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/touch/-/touch-3.1.0.tgz", - "integrity": "sha1-/jZfX3XsntTlaCXgu3bSSrdK+Ds=", + "integrity": "sha512-WBx8Uy5TLtOSRtIq+M03/sKDrXCLHxwDcquSP2c43Le03/9serjQBIztjRz6FkJez9D/hleyAXTBGLwwZUw9lA==", "dev": true, "requires": { "nopt": "~1.0.10" @@ -16944,7 +16944,7 @@ "write-file-atomic": { "version": "2.3.0", "resolved": "https://registry.npmjs.org/write-file-atomic/-/write-file-atomic-2.3.0.tgz", - "integrity": "sha1-H/YVdcLipOjlENb6TiQ8zhg5mas=", + "integrity": "sha512-xuPeK4OdjWqtfi59ylvVL0Yn35SF3zgcAcv7rBPFHVaEapaDr4GdGgm3j7ckTwH9wHL7fGmgfAnb0+THrHb8tA==", "dev": true, "requires": { "graceful-fs": "^4.1.11",