From 2673a36578bdb3195ae7daea3aa20c70028c3703 Mon Sep 17 00:00:00 2001 From: Carlos Jimenez Ruiz Date: Wed, 23 Jan 2019 16:00:56 +0100 Subject: [PATCH] small e2e refactors --- .../claim-module/01_edit_basic_data.spec.js | 8 +++---- .../02_create_development.spec.js | 2 +- .../client-module/01_create_client.spec.js | 14 ++++++------ .../client-module/02_edit_basic_data.spec.js | 12 +++++----- .../client-module/03_edit_fiscal_data.spec.js | 2 +- .../client-module/05_add_address.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 | 16 +++++++------- e2e/paths/client-module/14_risk.spec.js | 2 +- e2e/paths/item-module/01_item_summary.spec.js | 6 ++--- .../02_edit_item_basic_data.spec.js | 2 +- .../item-module/03_edit_item_tax.spec.js | 6 ++--- .../item-module/04_create_item_tags.spec.js | 6 ++--- .../item-module/05_create_item_niche.spec.js | 6 ++--- .../06_create_item_botanical.spec.js | 8 +++---- .../08_item_create_and_clone.spec.js | 18 +++++++-------- .../item-module/09_regularize_item.spec.js | 4 ++-- .../order-module/01_edit_basic_data.spec.js | 10 ++++----- .../01_create_ticket_observations.spec.js | 6 ++--- .../02_ticket_expeditions_and_log.spec.js | 4 ++-- .../04_create_ticket_packages.spec.js | 12 +++++----- .../05_create_new_tracking_state.spec.js | 8 +++---- .../06_edit_basic_data_steps.spec.js | 10 ++++----- e2e/paths/ticket-module/07_edit_sale.spec.js | 22 +++++++++---------- .../ticket-module/09_ticket_weekly.spec.js | 4 ++-- .../ticket-module/11_ticket_diary.spec.js | 2 +- .../12_delete_ticket_from_descriptor.spec.js | 4 ++-- .../13_create_ticket_services.spec.js | 4 ++-- e2e/smokes/01_client_path.spec.js | 6 ++--- 31 files changed, 107 insertions(+), 107 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 283e4b765..15c89c690 100644 --- a/e2e/paths/claim-module/01_edit_basic_data.spec.js +++ b/e2e/paths/claim-module/01_edit_basic_data.spec.js @@ -17,7 +17,7 @@ describe('Claim edit basic data path', () => { .waitToClick(selectors.claimBasicData.isPaidWithManaCheckbox) .clearInput(selectors.claimBasicData.observationInput) .write(selectors.claimBasicData.observationInput, 'edited observation') - .click(selectors.claimBasicData.saveButton) + .waitToClick(selectors.claimBasicData.saveButton) .waitForSnackbar(); expect(result).toEqual(jasmine.arrayContaining(['Data saved!'])); @@ -25,9 +25,9 @@ describe('Claim edit basic data path', () => { it('should confirm the claim state was edited', async() => { const result = await nightmare - .click(selectors.claimDetail.detailButton) + .waitToClick(selectors.claimDetail.detailButton) .wait(selectors.claimDetail.addItemButton) - .click(selectors.claimBasicData.basicDataButton) + .waitToClick(selectors.claimBasicData.basicDataButton) .wait(selectors.claimBasicData.claimStateAutocomplete) .waitToGetProperty(`${selectors.claimBasicData.claimStateAutocomplete} input`, 'value'); @@ -56,7 +56,7 @@ describe('Claim edit basic data path', () => { .waitToClick(selectors.claimBasicData.isPaidWithManaCheckbox) .clearInput(selectors.claimBasicData.observationInput) .write(selectors.claimBasicData.observationInput, 'Observation one') - .click(selectors.claimBasicData.saveButton) + .waitToClick(selectors.claimBasicData.saveButton) .waitForSnackbar(); expect(result).toEqual(jasmine.arrayContaining(['Data saved!'])); diff --git a/e2e/paths/claim-module/02_create_development.spec.js b/e2e/paths/claim-module/02_create_development.spec.js index bce93b704..32b45337a 100644 --- a/e2e/paths/claim-module/02_create_development.spec.js +++ b/e2e/paths/claim-module/02_create_development.spec.js @@ -43,7 +43,7 @@ describe('Claim development', () => { const reason = await nightmare .waitToClick(selectors.claimBasicData.basicDataButton) .wait(selectors.claimBasicData.claimStateAutocomplete) - .click(selectors.claimDevelopment.developmentButton) + .waitToClick(selectors.claimDevelopment.developmentButton) .waitToGetProperty(`${selectors.claimDevelopment.firstClaimReasonAutocomplete} input`, 'value'); const result = await nightmare diff --git a/e2e/paths/client-module/01_create_client.spec.js b/e2e/paths/client-module/01_create_client.spec.js index b6a4c54f7..467603d70 100644 --- a/e2e/paths/client-module/01_create_client.spec.js +++ b/e2e/paths/client-module/01_create_client.spec.js @@ -12,7 +12,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 .write(selectors.clientsIndex.searchClientInput, 'Carol Danvers') - .click(selectors.clientsIndex.searchButton) + .waitToClick(selectors.clientsIndex.searchButton) .waitForNumberOfElements(selectors.clientsIndex.searchResult, 0) .countElement(selectors.clientsIndex.searchResult); @@ -21,7 +21,7 @@ describe('Client create path', () => { it('should now access to the create client view by clicking the create-client floating button', async() => { const url = await nightmare - .click(selectors.clientsIndex.createClientButton) + .waitToClick(selectors.clientsIndex.createClientButton) .wait(selectors.createClientView.createButton) .parsedUrl(); @@ -30,7 +30,7 @@ describe('Client create path', () => { it('should receive an error when clicking the create button having all the form fields empty', async() => { const result = await nightmare - .click(selectors.createClientView.createButton) + .waitToClick(selectors.createClientView.createButton) .waitForLastSnackbar(); expect(result).toEqual('Some fields are invalid'); @@ -42,7 +42,7 @@ describe('Client create path', () => { .write(selectors.createClientView.userName, 'CaptainMarvel') .write(selectors.createClientView.email, 'CarolDanvers@verdnatura.es') .autocompleteSearch(selectors.createClientView.salesPersonAutocomplete, 'Accessory') - .click(selectors.createClientView.createButton) + .waitToClick(selectors.createClientView.createButton) .waitForLastSnackbar(); expect(result).toEqual('Some fields are invalid'); @@ -54,7 +54,7 @@ describe('Client create path', () => { .write(selectors.createClientView.socialName, 'AVG tax') .clearInput(selectors.createClientView.email) .write(selectors.createClientView.email, 'incorrect email format') - .click(selectors.createClientView.createButton) + .waitToClick(selectors.createClientView.createButton) .waitForLastSnackbar(); expect(result).toEqual('Some fields are invalid'); @@ -64,7 +64,7 @@ describe('Client create path', () => { const result = await nightmare .clearInput(selectors.createClientView.email) .write(selectors.createClientView.email, 'caroldanvers@verdnatura.es') - .click(selectors.createClientView.createButton) + .waitToClick(selectors.createClientView.createButton) .waitForLastSnackbar(); expect(result).toEqual('Data saved!'); @@ -84,7 +84,7 @@ describe('Client create path', () => { it(`should search for the user Carol Danvers to confirm it exists`, async() => { const result = await nightmare .write(selectors.clientsIndex.searchClientInput, 'Carol Danvers') - .click(selectors.clientsIndex.searchButton) + .waitToClick(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 43a8274cd..220c0d186 100644 --- a/e2e/paths/client-module/02_edit_basic_data.spec.js +++ b/e2e/paths/client-module/02_edit_basic_data.spec.js @@ -34,7 +34,7 @@ describe('Client Edit basicData path', () => { .clearInput(selectors.clientBasicData.emailInput) .write(selectors.clientBasicData.emailInput, 'PWallace@verdnatura.es') .autocompleteSearch(selectors.clientBasicData.channelAutocomplete, 'Rumors on the streets') - .click(selectors.clientBasicData.saveButton) + .waitToClick(selectors.clientBasicData.saveButton) .waitForLastSnackbar(); expect(result).toEqual('Data saved!'); @@ -42,9 +42,9 @@ describe('Client Edit basicData path', () => { it('should confirm the name have been edited', async() => { const result = await nightmare - .click(selectors.clientFiscalData.fiscalDataButton) + .waitToClick(selectors.clientFiscalData.fiscalDataButton) .wait(selectors.clientFiscalData.addressInput) - .click(selectors.clientBasicData.basicDataButton) + .waitToClick(selectors.clientBasicData.basicDataButton) .waitToGetProperty(selectors.clientBasicData.nameInput, 'value'); expect(result).toEqual('Ptonomy Wallace'); @@ -119,7 +119,7 @@ describe('Client Edit basicData path', () => { .write(selectors.clientBasicData.emailInput, 'Storm@verdnatura.es') .autocompleteSearch(selectors.clientBasicData.salesPersonAutocomplete, 'Accessory') .autocompleteSearch(selectors.clientBasicData.channelAutocomplete, 'Metropolis newspaper') - .click(selectors.clientBasicData.saveButton) + .waitToClick(selectors.clientBasicData.saveButton) .waitForLastSnackbar(); expect(result).toEqual('Data saved!'); @@ -127,9 +127,9 @@ describe('Client Edit basicData path', () => { it('should now confirm the name have been edited', async() => { const result = await nightmare - .click(selectors.clientFiscalData.fiscalDataButton) + .waitToClick(selectors.clientFiscalData.fiscalDataButton) .wait(selectors.clientFiscalData.addressInput) - .click(selectors.clientBasicData.basicDataButton) + .waitToClick(selectors.clientBasicData.basicDataButton) .waitToGetProperty(selectors.clientBasicData.nameInput, 'value'); expect(result).toEqual('Ororo Munroe'); 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 168655691..2326a1108 100644 --- a/e2e/paths/client-module/03_edit_fiscal_data.spec.js +++ b/e2e/paths/client-module/03_edit_fiscal_data.spec.js @@ -312,7 +312,7 @@ describe('Client Edit fiscalData path', () => { const result = await nightmare .waitToClick(selectors.clientAddresses.firstEditButton) .waitToClick(selectors.clientAddresses.equalizationTaxCheckboxLabel) - .click(selectors.clientAddresses.saveButton) + .waitToClick(selectors.clientAddresses.saveButton) .waitForLastSnackbar(); expect(result).toEqual('Data saved!'); diff --git a/e2e/paths/client-module/05_add_address.spec.js b/e2e/paths/client-module/05_add_address.spec.js index dc7e615c1..e082b6d8c 100644 --- a/e2e/paths/client-module/05_add_address.spec.js +++ b/e2e/paths/client-module/05_add_address.spec.js @@ -40,7 +40,7 @@ describe('Client Add address path', () => { .write(selectors.clientAddresses.consigneeInput, 'Bruce Bunner') .write(selectors.clientAddresses.streetAddressInput, '320 Park Avenue New York') .write(selectors.clientAddresses.cityInput, 'New York') - .click(selectors.clientAddresses.saveButton) + .waitToClick(selectors.clientAddresses.saveButton) .waitForLastSnackbar(); expect(result).toEqual('Data saved!'); diff --git a/e2e/paths/client-module/08_add_notes.spec.js b/e2e/paths/client-module/08_add_notes.spec.js index c5c9defbc..1528dd79b 100644 --- a/e2e/paths/client-module/08_add_notes.spec.js +++ b/e2e/paths/client-module/08_add_notes.spec.js @@ -23,7 +23,7 @@ describe('Client Add notes path', () => { it(`should create a note`, async() => { const result = await nightmare .write(selectors.clientNotes.noteInput, 'Meeting with Black Widow 21st 9am') - .click(selectors.clientNotes.saveButton) + .waitToClick(selectors.clientNotes.saveButton) .waitForLastSnackbar(); expect(result).toEqual('Data saved!'); diff --git a/e2e/paths/client-module/09_add_credit.spec.js b/e2e/paths/client-module/09_add_credit.spec.js index a37fb0e73..60ff2d347 100644 --- a/e2e/paths/client-module/09_add_credit.spec.js +++ b/e2e/paths/client-module/09_add_credit.spec.js @@ -24,7 +24,7 @@ describe('Client Add credit path', () => { const result = await nightmare .clearInput(selectors.clientCredit.creditInput) .write(selectors.clientCredit.creditInput, 999) - .click(selectors.clientCredit.saveButton) + .waitToClick(selectors.clientCredit.saveButton) .waitForLastSnackbar(); expect(result).toEqual('Data saved!'); diff --git a/e2e/paths/client-module/10_add_greuge.spec.js b/e2e/paths/client-module/10_add_greuge.spec.js index 5f845df84..46fdf65e3 100644 --- a/e2e/paths/client-module/10_add_greuge.spec.js +++ b/e2e/paths/client-module/10_add_greuge.spec.js @@ -23,7 +23,7 @@ describe('Client Add greuge path', () => { it(`should receive an error if all fields are empty but date and type on submit`, async() => { const result = await nightmare .autocompleteSearch(selectors.clientGreuge.typeAutocomplete, 'Diff') - .click(selectors.clientGreuge.saveButton) + .waitToClick(selectors.clientGreuge.saveButton) .waitForLastSnackbar(); expect(result).toEqual('Some fields are invalid'); @@ -34,7 +34,7 @@ describe('Client Add greuge path', () => { .write(selectors.clientGreuge.amountInput, 999) .waitForTextInInput(selectors.clientGreuge.amountInput, '999') .write(selectors.clientGreuge.descriptionInput, 'new armor for Batman!') - .click(selectors.clientGreuge.saveButton) + .waitToClick(selectors.clientGreuge.saveButton) .waitForLastSnackbar(); expect(result).toEqual('Data saved!'); 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 ba0141a78..367753586 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 @@ -28,7 +28,7 @@ describe('Client lock verified data path', () => { .wait(selectors.clientFiscalData.socialNameInput) .clearInput(selectors.clientFiscalData.socialNameInput) .write(selectors.clientFiscalData.socialNameInput, 'salesPerson was here') - .click(selectors.clientFiscalData.saveButton) + .waitToClick(selectors.clientFiscalData.saveButton) .waitForLastSnackbar(); expect(result).toEqual('Data saved!'); @@ -66,7 +66,7 @@ describe('Client lock verified data path', () => { it('should search again for the user Petter Parker', async() => { const resultCount = await nightmare .write(selectors.clientsIndex.searchClientInput, 'Petter Parker') - .click(selectors.clientsIndex.searchButton) + .waitToClick(selectors.clientsIndex.searchButton) .waitForNumberOfElements(selectors.clientsIndex.searchResult, 1) .countElement(selectors.clientsIndex.searchResult); @@ -130,7 +130,7 @@ describe('Client lock verified data path', () => { .wait(selectors.clientFiscalData.socialNameInput) .clearInput(selectors.clientFiscalData.socialNameInput) .write(selectors.clientFiscalData.socialNameInput, 'administrative was here') - .click(selectors.clientFiscalData.saveButton) + .waitToClick(selectors.clientFiscalData.saveButton) .waitForLastSnackbar(); expect(result).toEqual('Data saved!'); @@ -168,7 +168,7 @@ describe('Client lock verified data path', () => { it('should again search for the user Petter Parker', async() => { const resultCount = await nightmare .write(selectors.clientsIndex.searchClientInput, 'Petter Parker') - .click(selectors.clientsIndex.searchButton) + .waitToClick(selectors.clientsIndex.searchButton) .waitForNumberOfElements(selectors.clientsIndex.searchResult, 1) .countElement(selectors.clientsIndex.searchResult); @@ -209,7 +209,7 @@ describe('Client lock verified data path', () => { const result = await nightmare .clearInput(selectors.clientFiscalData.socialNameInput) .write(selectors.clientFiscalData.socialNameInput, 'salesPerson was here') - .click(selectors.clientFiscalData.saveButton) + .waitToClick(selectors.clientFiscalData.saveButton) .waitForSnackbar(); expect(result).toEqual(jasmine.arrayContaining([`You can't make changes on a client with verified data`])); @@ -237,7 +237,7 @@ describe('Client lock verified data path', () => { it('should now search again for the user Petter Parker', async() => { const resultCount = await nightmare .write(selectors.clientsIndex.searchClientInput, 'Petter Parker') - .click(selectors.clientsIndex.searchButton) + .waitToClick(selectors.clientsIndex.searchButton) .waitForNumberOfElements(selectors.clientsIndex.searchResult, 1) .countElement(selectors.clientsIndex.searchResult); @@ -278,7 +278,7 @@ describe('Client lock verified data path', () => { const result = await nightmare .clearInput(selectors.clientFiscalData.socialNameInput) .write(selectors.clientFiscalData.socialNameInput, 'salesAssistant was here') - .click(selectors.clientFiscalData.saveButton) + .waitToClick(selectors.clientFiscalData.saveButton) .waitForLastSnackbar(); expect(result).toEqual('Data saved!'); @@ -316,7 +316,7 @@ describe('Client lock verified data path', () => { it('should once again search for the user Petter Parker', async() => { const resultCount = await nightmare .write(selectors.clientsIndex.searchClientInput, 'Petter Parker') - .click(selectors.clientsIndex.searchButton) + .waitToClick(selectors.clientsIndex.searchButton) .waitForNumberOfElements(selectors.clientsIndex.searchResult, 1) .countElement(selectors.clientsIndex.searchResult); diff --git a/e2e/paths/client-module/14_risk.spec.js b/e2e/paths/client-module/14_risk.spec.js index 3f8e2eb8b..b0613e4fb 100644 --- a/e2e/paths/client-module/14_risk.spec.js +++ b/e2e/paths/client-module/14_risk.spec.js @@ -104,7 +104,7 @@ describe('Client risk path', () => { it('should now search for the user Petter Parker', async() => { let resultCount = await nightmare .write(selectors.clientsIndex.searchClientInput, 'Petter Parker') - .click(selectors.clientsIndex.searchButton) + .waitToClick(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 b5922be35..ee6fd8785 100644 --- a/e2e/paths/item-module/01_item_summary.spec.js +++ b/e2e/paths/item-module/01_item_summary.spec.js @@ -12,7 +12,7 @@ describe('Item summary path', () => { it('should search for an item', async() => { const result = await nightmare .write(selectors.itemsIndex.searchItemInput, 'Object1 Gem1 5') - .click(selectors.itemsIndex.searchButton) + .waitToClick(selectors.itemsIndex.searchButton) .waitForNumberOfElements(selectors.itemsIndex.searchResult, 1) .countElement(selectors.itemsIndex.searchResult); @@ -83,9 +83,9 @@ describe('Item summary path', () => { it('should search for other item', async() => { const result = await nightmare .clearInput('vn-item-index vn-searchbar input') - .click(selectors.itemsIndex.searchButton) + .waitToClick(selectors.itemsIndex.searchButton) .write(selectors.itemsIndex.searchItemInput, 'Object2 Gem2 3') - .click(selectors.itemsIndex.searchButton) + .waitToClick(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 2c74400c8..7cdd89993 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 @@ -32,7 +32,7 @@ describe('Item Edit basic data path', () => { it(`should confirm the item name was edited`, async() => { const result = await nightmare - .click(selectors.itemNiches.nicheButton) + .waitToClick(selectors.itemNiches.nicheButton) .wait(selectors.itemNiches.firstWarehouseDisabled) .waitToClick(selectors.itemBasicData.basicDataButton) .waitToGetProperty(selectors.itemBasicData.nameInput, 'value'); diff --git a/e2e/paths/item-module/03_edit_item_tax.spec.js b/e2e/paths/item-module/03_edit_item_tax.spec.js index 66260a69b..f5f533db9 100644 --- a/e2e/paths/item-module/03_edit_item_tax.spec.js +++ b/e2e/paths/item-module/03_edit_item_tax.spec.js @@ -16,7 +16,7 @@ describe('Item edit tax path', () => { .autocompleteSearch(selectors.itemTax.firstClassAutocomplete, 'Reduced VAT') .autocompleteSearch(selectors.itemTax.secondClassAutocomplete, 'General VAT') .autocompleteSearch(selectors.itemTax.thirdClassAutocomplete, 'Reduced VAT') - .click(selectors.itemTax.submitTaxButton) + .waitToClick(selectors.itemTax.submitTaxButton) .waitForLastSnackbar(); expect(result).toEqual('Data saved!'); @@ -24,9 +24,9 @@ describe('Item edit tax path', () => { it(`should confirm the first item tax class was edited`, async() => { const firstVatType = await nightmare - .click(selectors.itemTags.tagsButton) + .waitToClick(selectors.itemTags.tagsButton) .wait(selectors.itemTags.firstTagDisabled) - .click(selectors.itemTax.taxButton) + .waitToClick(selectors.itemTax.taxButton) .waitToClick(selectors.itemTax.taxButton) .waitToGetProperty(`${selectors.itemTax.firstClassAutocomplete} input`, 'value'); 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 b4df87781..7b7e1b3a4 100644 --- a/e2e/paths/item-module/04_create_item_tags.spec.js +++ b/e2e/paths/item-module/04_create_item_tags.spec.js @@ -19,7 +19,7 @@ describe('Item create tags path', () => { .write(selectors.itemTags.seventhValueInput, '50') .clearInput(selectors.itemTags.seventhRelevancyInput) .write(selectors.itemTags.seventhRelevancyInput, '4') - .click(selectors.itemTags.submitItemTagsButton) + .waitToClick(selectors.itemTags.submitItemTagsButton) .waitForLastSnackbar(); expect(result).toEqual('Data saved!'); @@ -27,9 +27,9 @@ describe('Item create tags path', () => { it(`should confirm the fourth row data is the expected one`, async() => { let result = await nightmare - .click(selectors.itemBasicData.basicDataButton) + .waitToClick(selectors.itemBasicData.basicDataButton) .wait(selectors.itemBasicData.nameInput) - .click(selectors.itemTags.tagsButton) + .waitToClick(selectors.itemTags.tagsButton) .wait('vn-item-tags') .waitToGetProperty(`${selectors.itemTags.fourthTagAutocomplete} input`, 'value'); 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 1ce170f6d..f43500634 100644 --- a/e2e/paths/item-module/05_create_item_niche.spec.js +++ b/e2e/paths/item-module/05_create_item_niche.spec.js @@ -17,7 +17,7 @@ describe('Item create niche path', () => { .waitToClick(selectors.itemNiches.secondNicheRemoveButton) .autocompleteSearch(selectors.itemNiches.thirdWarehouseAutocomplete, 'Warehouse Two') .write(selectors.itemNiches.thirdCodeInput, 'A4') - .click(selectors.itemNiches.submitNichesButton) + .waitToClick(selectors.itemNiches.submitNichesButton) .waitForLastSnackbar(); expect(result).toEqual('Data saved!'); @@ -25,9 +25,9 @@ describe('Item create niche path', () => { it(`should confirm the first niche is the expected one`, async() => { let result = await nightmare - .click(selectors.itemBasicData.basicDataButton) + .waitToClick(selectors.itemBasicData.basicDataButton) .wait(selectors.itemBasicData.nameInput) - .click(selectors.itemNiches.nicheButton) + .waitToClick(selectors.itemNiches.nicheButton) .waitForTextInInput(`${selectors.itemNiches.firstWarehouseAutocomplete} input`, 'Warehouse One') .waitToGetProperty(`${selectors.itemNiches.firstWarehouseAutocomplete} input`, 'value'); 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 fa0f339f9..98bd38f4a 100644 --- a/e2e/paths/item-module/06_create_item_botanical.spec.js +++ b/e2e/paths/item-module/06_create_item_botanical.spec.js @@ -24,9 +24,9 @@ describe('Item Create botanical path', () => { it(`should confirm the botanical for the item was created`, async() => { const result = await nightmare - .click(selectors.itemBasicData.basicDataButton) + .waitToClick(selectors.itemBasicData.basicDataButton) .wait(selectors.itemBasicData.nameInput) - .click(selectors.itemBotanical.botanicalButton) + .waitToClick(selectors.itemBotanical.botanicalButton) .waitForTextInInput(selectors.itemBotanical.botanicalInput, 'Cicuta maculata') .waitToGetProperty(selectors.itemBotanical.botanicalInput, 'value'); @@ -62,9 +62,9 @@ describe('Item Create botanical path', () => { it(`should confirm the botanical for the item was edited`, async() => { const result = await nightmare - .click(selectors.itemBasicData.basicDataButton) + .waitToClick(selectors.itemBasicData.basicDataButton) .wait(selectors.itemBasicData.nameInput) - .click(selectors.itemBotanical.botanicalButton) + .waitToClick(selectors.itemBotanical.botanicalButton) .waitForTextInInput(selectors.itemBotanical.botanicalInput, 'Herp Derp') .waitToGetProperty(selectors.itemBotanical.botanicalInput, 'value'); diff --git a/e2e/paths/item-module/08_item_create_and_clone.spec.js b/e2e/paths/item-module/08_item_create_and_clone.spec.js index 4411d7877..b5e33cc4a 100644 --- a/e2e/paths/item-module/08_item_create_and_clone.spec.js +++ b/e2e/paths/item-module/08_item_create_and_clone.spec.js @@ -12,7 +12,7 @@ describe('Item Create/Clone path', () => { it(`should search for the item Infinity Gauntlet to confirm it isn't created yet`, async() => { const result = await nightmare .write(selectors.itemsIndex.searchItemInput, 'Infinity Gauntlet') - .click(selectors.itemsIndex.searchButton) + .waitToClick(selectors.itemsIndex.searchButton) .waitForNumberOfElements(selectors.itemsIndex.searchResult, 0) .countElement(selectors.itemsIndex.searchResult); @@ -21,7 +21,7 @@ describe('Item Create/Clone path', () => { it('should access to the create item view by clicking the create floating button', async() => { const url = await nightmare - .click(selectors.itemsIndex.createItemButton) + .waitToClick(selectors.itemsIndex.createItemButton) .wait(selectors.itemCreateView.createButton) .parsedUrl(); @@ -30,7 +30,7 @@ describe('Item Create/Clone path', () => { it('should return to the item index by clickig the cancel button', async() => { const url = await nightmare - .click(selectors.itemCreateView.cancelButton) + .waitToClick(selectors.itemCreateView.cancelButton) .wait(selectors.itemsIndex.createItemButton) .parsedUrl(); @@ -39,7 +39,7 @@ describe('Item Create/Clone path', () => { it('should now access to the create item view by clicking the create floating button', async() => { const url = await nightmare - .click(selectors.itemsIndex.createItemButton) + .waitToClick(selectors.itemsIndex.createItemButton) .wait(selectors.itemCreateView.createButton) .parsedUrl(); @@ -52,7 +52,7 @@ describe('Item Create/Clone path', () => { .autocompleteSearch(selectors.itemCreateView.typeAutocomplete, 'Crisantemo') .autocompleteSearch(selectors.itemCreateView.intrastatAutocomplete, 'Coral y materiales similares') .autocompleteSearch(selectors.itemCreateView.originAutocomplete, 'Holand') - .click(selectors.itemCreateView.createButton) + .waitToClick(selectors.itemCreateView.createButton) .waitForLastSnackbar(); expect(result).toEqual('Data saved!'); @@ -85,7 +85,7 @@ describe('Item Create/Clone path', () => { describe('clone', () => { it('should return to the items index by clicking the return to items button', async() => { const url = await nightmare - .click(selectors.itemBasicData.goToItemIndexButton) + .waitToClick(selectors.itemBasicData.goToItemIndexButton) .wait(selectors.itemsIndex.createItemButton) .waitForURL('#!/item/index') .parsedUrl(); @@ -96,7 +96,7 @@ describe('Item Create/Clone path', () => { it(`should search for the item Infinity Gauntlet`, async() => { const result = await nightmare .write(selectors.itemsIndex.searchItemInput, 'Infinity Gauntlet') - .click(selectors.itemsIndex.searchButton) + .waitToClick(selectors.itemsIndex.searchButton) .waitForNumberOfElements(selectors.itemsIndex.searchResult, 1) .countElement(selectors.itemsIndex.searchResult); @@ -106,7 +106,7 @@ describe('Item Create/Clone path', () => { it(`should clone the Infinity Gauntlet`, async() => { const url = await nightmare .waitForTextInElement(selectors.itemsIndex.searchResult, 'Infinity Gauntlet') - .click(selectors.itemsIndex.searchResultCloneButton) + .waitToClick(selectors.itemsIndex.searchResultCloneButton) .waitToClick(selectors.itemsIndex.acceptClonationAlertButton) .waitForURL('tags') .parsedUrl(); @@ -118,7 +118,7 @@ describe('Item Create/Clone path', () => { const result = await nightmare .waitToClick(selectors.itemTags.goToItemIndexButton) .write(selectors.itemsIndex.searchItemInput, 'Infinity Gauntlet') - .click(selectors.itemsIndex.searchButton) + .waitToClick(selectors.itemsIndex.searchButton) .waitForNumberOfElements(selectors.itemsIndex.searchResult, 2) .countElement(selectors.itemsIndex.searchResult); diff --git a/e2e/paths/item-module/09_regularize_item.spec.js b/e2e/paths/item-module/09_regularize_item.spec.js index 76879c4ab..302a66c42 100644 --- a/e2e/paths/item-module/09_regularize_item.spec.js +++ b/e2e/paths/item-module/09_regularize_item.spec.js @@ -100,7 +100,7 @@ describe('Item regularize path', () => { it('should search for the item once again', async() => { const resultCount = await nightmare .write(selectors.itemsIndex.searchItemInput, 'Object5 Weapon 50') - .click(selectors.itemsIndex.searchButton) + .waitToClick(selectors.itemsIndex.searchButton) .waitForNumberOfElements(selectors.itemsIndex.searchResult, 1) .countElement(selectors.itemsIndex.searchResult); @@ -143,7 +143,7 @@ describe('Item regularize path', () => { it('should search for the ticket with id 23 once again', async() => { const result = await nightmare .write(selectors.ticketsIndex.searchTicketInput, 'id:23') - .click(selectors.ticketsIndex.searchButton) + .waitToClick(selectors.ticketsIndex.searchButton) .waitForNumberOfElements(selectors.ticketsIndex.searchResult, 1) .countElement(selectors.ticketsIndex.searchResult); diff --git a/e2e/paths/order-module/01_edit_basic_data.spec.js b/e2e/paths/order-module/01_edit_basic_data.spec.js index 222ba9f6e..3a5ccdd2f 100644 --- a/e2e/paths/order-module/01_edit_basic_data.spec.js +++ b/e2e/paths/order-module/01_edit_basic_data.spec.js @@ -14,7 +14,7 @@ describe('Order edit basic data path', () => { it('should not be able to change the client', async() => { const result = await nightmare .autocompleteSearch(selectors.orderBasicData.clientAutocomplete, 'Tony Stark') - .click(selectors.orderBasicData.saveButton) + .waitToClick(selectors.orderBasicData.saveButton) .waitForLastSnackbar(); expect(result).toEqual(`You can't make changes on the basic data of an confirmed order or with rows`); @@ -38,7 +38,7 @@ describe('Order edit basic data path', () => { it('should not be able to change the company', async() => { const result = await nightmare .autocompleteSearch(selectors.orderBasicData.companyAutocomplete, 'CCs') - .click(selectors.orderBasicData.saveButton) + .waitToClick(selectors.orderBasicData.saveButton) .waitForLastSnackbar(); expect(result).toEqual(`You can't make changes on the basic data of an confirmed order or with rows`); @@ -65,7 +65,7 @@ describe('Order edit basic data path', () => { .autocompleteSearch(selectors.orderBasicData.companyAutocomplete, 'CCs') .clearInput(selectors.orderBasicData.observationInput) .write(selectors.orderBasicData.observationInput, 'Observation modified') - .click(selectors.orderBasicData.saveButton) + .waitToClick(selectors.orderBasicData.saveButton) .waitForLastSnackbar(); expect(result).toEqual('Data saved!'); @@ -73,9 +73,9 @@ describe('Order edit basic data path', () => { it('should now confirm the client have been edited', async() => { const result = await nightmare - .click(selectors.orderCatalog.catalogButton) + .waitToClick(selectors.orderCatalog.catalogButton) .wait(selectors.orderCatalog.orderByAutocomplete) - .click(selectors.orderBasicData.basicDataButton) + .waitToClick(selectors.orderBasicData.basicDataButton) .waitToGetProperty(`${selectors.orderBasicData.clientAutocomplete} input`, 'value'); expect(result).toEqual('104: Tony Stark'); 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 584d090aa..bcfd04380 100644 --- a/e2e/paths/ticket-module/01_create_ticket_observations.spec.js +++ b/e2e/paths/ticket-module/01_create_ticket_observations.spec.js @@ -17,7 +17,7 @@ describe('Ticket Create notes path', () => { .waitToClick(selectors.ticketNotes.addNoteButton) .autocompleteSearch(selectors.ticketNotes.firstNoteTypeAutocomplete, 'observation one') .write(selectors.ticketNotes.firstDescriptionInput, 'description') - .click(selectors.ticketNotes.submitNotesButton) + .waitToClick(selectors.ticketNotes.submitNotesButton) .waitForLastSnackbar(); expect(result).toEqual('Data saved!'); @@ -25,9 +25,9 @@ describe('Ticket Create notes path', () => { it(`should confirm the note is the expected one`, async() => { let result = await nightmare - .click(selectors.ticketPackages.packagesButton) + .waitToClick(selectors.ticketPackages.packagesButton) .wait(selectors.ticketPackages.firstPackageAutocomplete) - .click(selectors.ticketNotes.notesButton) + .waitToClick(selectors.ticketNotes.notesButton) .waitToGetProperty(`${selectors.ticketNotes.firstNoteTypeAutocomplete} input`, 'value'); expect(result).toEqual('observation one'); diff --git a/e2e/paths/ticket-module/02_ticket_expeditions_and_log.spec.js b/e2e/paths/ticket-module/02_ticket_expeditions_and_log.spec.js index 8cf348320..b6c3a44c3 100644 --- a/e2e/paths/ticket-module/02_ticket_expeditions_and_log.spec.js +++ b/e2e/paths/ticket-module/02_ticket_expeditions_and_log.spec.js @@ -16,9 +16,9 @@ xdescribe('Ticket expeditions and log path', () => { const result = await nightmare .waitToClick(selectors.ticketExpedition.secondExpeditionRemoveButton) .waitToClick(selectors.ticketExpedition.acceptDeleteRowButton) - .click(selectors.ticketPackages.packagesButton) + .waitToClick(selectors.ticketPackages.packagesButton) .wait(selectors.ticketPackages.firstPackageAutocomplete) - .click(selectors.ticketExpedition.expeditionButton) + .waitToClick(selectors.ticketExpedition.expeditionButton) .wait(selectors.ticketExpedition.expeditionRow) .countElement(selectors.ticketExpedition.expeditionRow); 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 d98984505..ce74601ad 100644 --- a/e2e/paths/ticket-module/04_create_ticket_packages.spec.js +++ b/e2e/paths/ticket-module/04_create_ticket_packages.spec.js @@ -16,7 +16,7 @@ describe('Ticket Create packages path', () => { .waitToClick(selectors.ticketPackages.firstRemovePackageButton) .waitToClick(selectors.ticketPackages.addPackageButton) .autocompleteSearch(selectors.ticketPackages.firstPackageAutocomplete, 'Legendary Box') - .click(selectors.ticketPackages.savePackagesButton) + .waitToClick(selectors.ticketPackages.savePackagesButton) .waitForLastSnackbar(); expect(result).toEqual('Some fields are invalid'); @@ -25,7 +25,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 .write(selectors.ticketPackages.firstQuantityInput, 'ninety 9') - .click(selectors.ticketPackages.savePackagesButton) + .waitToClick(selectors.ticketPackages.savePackagesButton) .waitForLastSnackbar(); expect(result).toEqual('Some fields are invalid'); @@ -35,7 +35,7 @@ describe('Ticket Create packages path', () => { const result = await nightmare .clearInput(selectors.ticketPackages.firstQuantityInput) .write(selectors.ticketPackages.firstQuantityInput, 0) - .click(selectors.ticketPackages.savePackagesButton) + .waitToClick(selectors.ticketPackages.savePackagesButton) .waitForLastSnackbar(); expect(result).toEqual('Some fields are invalid'); @@ -45,8 +45,8 @@ describe('Ticket Create packages path', () => { const result = await nightmare .clearInput(selectors.ticketPackages.firstQuantityInput) .write(selectors.ticketPackages.firstQuantityInput, 99) - .click(selectors.ticketPackages.clearPackageAutocompleteButton) - .click(selectors.ticketPackages.savePackagesButton) + .waitToClick(selectors.ticketPackages.clearPackageAutocompleteButton) + .waitToClick(selectors.ticketPackages.savePackagesButton) .waitForLastSnackbar(); expect(result).toEqual('Package cannot be blank'); @@ -55,7 +55,7 @@ describe('Ticket Create packages path', () => { it(`should create a new package with correct data`, async() => { const result = await nightmare .autocompleteSearch(selectors.ticketPackages.firstPackageAutocomplete, 'Legendary Box') - .click(selectors.ticketPackages.savePackagesButton) + .waitToClick(selectors.ticketPackages.savePackagesButton) .waitForLastSnackbar(); expect(result).toEqual('Data saved!'); 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 1a179b041..061d67c1c 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 @@ -43,7 +43,7 @@ describe('Ticket Create new tracking state path', () => { it(`should create a new state`, async() => { let result = await nightmare .autocompleteSearch(selectors.createStateView.stateAutocomplete, '¿Fecha?') - .click(selectors.createStateView.saveStateButton) + .waitToClick(selectors.createStateView.saveStateButton) .waitForLastSnackbar(); expect(result).toEqual('Data saved!'); @@ -70,7 +70,7 @@ describe('Ticket Create new tracking state path', () => { it(`should attemp to create an state for which salesPerson doesn't have permissions`, async() => { let result = await nightmare .autocompleteSearch(selectors.createStateView.stateAutocomplete, '¿Fecha?') - .click(selectors.createStateView.saveStateButton) + .waitToClick(selectors.createStateView.saveStateButton) .waitForLastSnackbar(); expect(result).toEqual(`You don't have enough privileges to change the state of this ticket`); @@ -79,7 +79,7 @@ describe('Ticket Create new tracking state path', () => { it(`should attempt to create an state for the type salesPerson has rights but fail as worker is blank`, async() => { let result = await nightmare .autocompleteSearch(selectors.createStateView.stateAutocomplete, 'asignado') - .click(selectors.createStateView.saveStateButton) + .waitToClick(selectors.createStateView.saveStateButton) .waitForLastSnackbar(); expect(result).toEqual(`Worker cannot be blank`); @@ -88,7 +88,7 @@ describe('Ticket Create new tracking state path', () => { it(`should create a new state with all it's data`, async() => { let result = await nightmare .autocompleteSearch(selectors.createStateView.workerAutocomplete, 'accessory') - .click(selectors.createStateView.saveStateButton) + .waitToClick(selectors.createStateView.saveStateButton) .waitForLastSnackbar(); expect(result).toEqual('Data saved!'); diff --git a/e2e/paths/ticket-module/06_edit_basic_data_steps.spec.js b/e2e/paths/ticket-module/06_edit_basic_data_steps.spec.js index 5d2e84e14..0bf4b01ea 100644 --- a/e2e/paths/ticket-module/06_edit_basic_data_steps.spec.js +++ b/e2e/paths/ticket-module/06_edit_basic_data_steps.spec.js @@ -16,7 +16,7 @@ describe('Ticket Edit basic data path', () => { .autocompleteSearch(selectors.ticketBasicData.clientAutocomplete, 'Charles Xavier') .wait(500) .autocompleteSearch(selectors.ticketBasicData.addressAutocomplete, 'Charles Xavier') - .click(selectors.ticketBasicData.nextStepButton) + .waitToClick(selectors.ticketBasicData.nextStepButton) .waitForURL('data/step-two') .parsedUrl(); @@ -32,7 +32,7 @@ describe('Ticket Edit basic data path', () => { it(`should click next to move on to step three`, async() => { let url = await nightmare - .click(selectors.ticketBasicData.nextStepButton) + .waitToClick(selectors.ticketBasicData.nextStepButton) .waitForURL('data/step-three') .parsedUrl(); @@ -61,7 +61,7 @@ describe('Ticket Edit basic data path', () => { it(`should edit the ticket agency then click next`, async() => { let url = await nightmare .autocompleteSearch(selectors.ticketBasicData.agencyAutocomplete, 'Silla247Expensive') - .click(selectors.ticketBasicData.nextStepButton) + .waitToClick(selectors.ticketBasicData.nextStepButton) .waitForURL('data/step-two') .parsedUrl(); @@ -77,7 +77,7 @@ describe('Ticket Edit basic data path', () => { it(`should then click next to move on to step three`, async() => { let url = await nightmare - .click(selectors.ticketBasicData.nextStepButton) + .waitToClick(selectors.ticketBasicData.nextStepButton) .waitForURL('data/step-three') .parsedUrl(); @@ -87,7 +87,7 @@ describe('Ticket Edit basic data path', () => { it(`should select a new reason for the changes made then click on finalize`, async() => { let url = await nightmare .autocompleteSearch(selectors.ticketBasicData.chargesReasonAutocomplete, 'Cambiar los precios en el ticket') - .click(selectors.ticketBasicData.finalizeButton) + .waitToClick(selectors.ticketBasicData.finalizeButton) .waitForURL('summary') .parsedUrl(); diff --git a/e2e/paths/ticket-module/07_edit_sale.spec.js b/e2e/paths/ticket-module/07_edit_sale.spec.js index 432ea0910..9f6c8a748 100644 --- a/e2e/paths/ticket-module/07_edit_sale.spec.js +++ b/e2e/paths/ticket-module/07_edit_sale.spec.js @@ -35,7 +35,7 @@ describe('Ticket Edit sale path', () => { it('should again search for a specific ticket', async() => { const result = await nightmare .write(selectors.ticketsIndex.searchTicketInput, 'id:16') - .click(selectors.ticketsIndex.searchButton) + .waitToClick(selectors.ticketsIndex.searchButton) .waitForNumberOfElements(selectors.ticketsIndex.searchResult, 1) .countElement(selectors.ticketsIndex.searchResult); @@ -123,7 +123,7 @@ describe('Ticket Edit sale path', () => { .wait(selectors.globalItems.applicationsMenuVisible) .waitToClick(selectors.globalItems.ticketsButton) .write(selectors.ticketsIndex.searchTicketInput, 'id:16') - .click(selectors.ticketsIndex.searchButton) + .waitToClick(selectors.ticketsIndex.searchButton) .waitForNumberOfElements(selectors.ticketsIndex.searchResult, 1) .waitForTextInElement(selectors.ticketsIndex.searchResult, 'address 21') .waitToClick(selectors.ticketsIndex.searchResult) @@ -228,7 +228,7 @@ describe('Ticket Edit sale path', () => { it('should search for the claim with id 4', async() => { const result = await nightmare .write(selectors.claimsIndex.searchClaimInput, 4) - .click(selectors.claimsIndex.searchButton) + .waitToClick(selectors.claimsIndex.searchButton) .waitForNumberOfElements(selectors.claimsIndex.searchResult, 1) .countElement(selectors.claimsIndex.searchResult); @@ -249,7 +249,7 @@ describe('Ticket Edit sale path', () => { it('should search the ticket', async() => { const result = await nightmare .write(selectors.ticketsIndex.searchTicketInput, 'id:16') - .click(selectors.ticketsIndex.searchButton) + .waitToClick(selectors.ticketsIndex.searchButton) .waitForNumberOfElements(selectors.ticketsIndex.searchResult, 1) .countElement(selectors.ticketsIndex.searchResult); @@ -318,7 +318,7 @@ describe('Ticket Edit sale path', () => { const url = await nightmare .waitToClick(selectors.itemsIndex.goBackToModuleIndexButton) .write(selectors.ticketsIndex.searchTicketInput, 'id:16') - .click(selectors.ticketsIndex.searchButton) + .waitToClick(selectors.ticketsIndex.searchButton) .waitForNumberOfElements(selectors.ticketsIndex.searchResult, 1) .waitForTextInElement(selectors.ticketsIndex.searchResult, 'address 21') .waitToClick(selectors.ticketsIndex.searchResult) @@ -341,7 +341,7 @@ describe('Ticket Edit sale path', () => { const url = await nightmare .waitToClick(selectors.itemsIndex.goBackToModuleIndexButton) .write(selectors.ticketsIndex.searchTicketInput, 'id:12') - .click(selectors.ticketsIndex.searchButton) + .waitToClick(selectors.ticketsIndex.searchButton) .waitForNumberOfElements(selectors.ticketsIndex.searchResult, 1) .waitForTextInElement(selectors.ticketsIndex.searchResult, 'address 21') .waitToClick(selectors.ticketsIndex.searchResult) @@ -376,7 +376,7 @@ describe('Ticket Edit sale path', () => { const url = await nightmare .waitToClick(selectors.itemsIndex.goBackToModuleIndexButton) .write(selectors.ticketsIndex.searchTicketInput, 'id:8') - .click(selectors.ticketsIndex.searchButton) + .waitToClick(selectors.ticketsIndex.searchButton) .waitForNumberOfElements(selectors.ticketsIndex.searchResult, 1) .waitForTextInElement(selectors.ticketsIndex.searchResult, 'address 24') .waitToClick(selectors.ticketsIndex.searchResult) @@ -406,7 +406,7 @@ describe('Ticket Edit sale path', () => { it('should search for a specific created ticket', async() => { const result = await nightmare .write(selectors.ticketsIndex.searchTicketInput, 'nickname:(address 24) stateFk:2') - .click(selectors.ticketsIndex.searchButton) + .waitToClick(selectors.ticketsIndex.searchButton) .waitForNumberOfElements(selectors.ticketsIndex.searchResult, 1) .countElement(selectors.ticketsIndex.searchResult); @@ -489,7 +489,7 @@ describe('Ticket Edit sale path', () => { it('should now search for a specific ticket', async() => { const result = await nightmare .write(selectors.ticketsIndex.searchTicketInput, 'id:16') - .click(selectors.ticketsIndex.searchButton) + .waitToClick(selectors.ticketsIndex.searchButton) .waitForNumberOfElements(selectors.ticketsIndex.searchResult, 1) .countElement(selectors.ticketsIndex.searchResult); @@ -519,7 +519,7 @@ describe('Ticket Edit sale path', () => { it(`should set the state of the ticket to preparation`, async() => { const url = await nightmare .autocompleteSearch(selectors.ticketTracking.stateAutocomplete, 'Preparación') - .click(selectors.ticketTracking.saveButton) + .waitToClick(selectors.ticketTracking.saveButton) .waitForURL('/tracking/index') .parsedUrl(); @@ -576,7 +576,7 @@ describe('Ticket Edit sale path', () => { it('should once again search for a specific ticket', async() => { const result = await nightmare .write(selectors.ticketsIndex.searchTicketInput, 'id:16') - .click(selectors.ticketsIndex.searchButton) + .waitToClick(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 1c7ed936e..4b7a5266b 100644 --- a/e2e/paths/ticket-module/09_ticket_weekly.spec.js +++ b/e2e/paths/ticket-module/09_ticket_weekly.spec.js @@ -33,7 +33,7 @@ describe('Ticket descriptor path', () => { it('should search for the ticket 11', async() => { const result = await nightmare .write(selectors.ticketsIndex.searchTicketInput, 'id:11') - .click(selectors.ticketsIndex.searchButton) + .waitToClick(selectors.ticketsIndex.searchButton) .waitForNumberOfElements(selectors.ticketsIndex.searchResult, 1) .countElement(selectors.ticketsIndex.searchResult); @@ -93,7 +93,7 @@ describe('Ticket descriptor path', () => { it('should now search for the ticket 11', async() => { const result = await nightmare .write(selectors.ticketsIndex.searchTicketInput, 'id:11') - .click(selectors.ticketsIndex.searchButton) + .waitToClick(selectors.ticketsIndex.searchButton) .waitForNumberOfElements(selectors.ticketsIndex.searchResult, 1) .countElement(selectors.ticketsIndex.searchResult); diff --git a/e2e/paths/ticket-module/11_ticket_diary.spec.js b/e2e/paths/ticket-module/11_ticket_diary.spec.js index 2f45b54cf..f5bb6fbc7 100644 --- a/e2e/paths/ticket-module/11_ticket_diary.spec.js +++ b/e2e/paths/ticket-module/11_ticket_diary.spec.js @@ -13,7 +13,7 @@ describe('Ticket diary path', () => { it('should search for a specific ticket', async() => { const result = await nightmare .write(selectors.ticketsIndex.searchTicketInput, 'id:1') - .click(selectors.ticketsIndex.searchButton) + .waitToClick(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 c76719ac2..5dc2903e9 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 @@ -12,7 +12,7 @@ describe('Ticket descriptor path', () => { it('should search for a specific ticket', async() => { const result = await nightmare .write(selectors.ticketsIndex.searchTicketInput, 'id:17') - .click(selectors.ticketsIndex.searchButton) + .waitToClick(selectors.ticketsIndex.searchButton) .waitForNumberOfElements(selectors.ticketsIndex.searchResult, 1) .countElement(selectors.ticketsIndex.searchResult); @@ -49,7 +49,7 @@ describe('Ticket descriptor path', () => { it(`should search for the deleted ticket and check it's date`, async() => { const result = await nightmare .write(selectors.ticketsIndex.searchTicketInput, 'id:17') - .click(selectors.ticketsIndex.searchButton) + .waitToClick(selectors.ticketsIndex.searchButton) .waitForNumberOfElements(selectors.ticketsIndex.searchResult, 1) .wait(selectors.ticketsIndex.searchResultDate) .waitToGetProperty(selectors.ticketsIndex.searchResultDate, 'innerText'); diff --git a/e2e/paths/ticket-module/13_create_ticket_services.spec.js b/e2e/paths/ticket-module/13_create_ticket_services.spec.js index a5e0e1c04..14a1f3d7e 100644 --- a/e2e/paths/ticket-module/13_create_ticket_services.spec.js +++ b/e2e/paths/ticket-module/13_create_ticket_services.spec.js @@ -34,7 +34,7 @@ describe('Ticket services path', () => { const result = await nightmare .waitToClick(selectors.ticketBasicData.basicDataButton) .wait(selectors.ticketBasicData.clientAutocomplete) - .click(selectors.ticketService.serviceButton) + .waitToClick(selectors.ticketService.serviceButton) .waitToGetProperty(selectors.ticketService.firstDescriptionInput, 'value'); expect(result).toEqual('my service'); @@ -77,7 +77,7 @@ describe('Ticket services path', () => { const result = await nightmare .waitToClick(selectors.ticketBasicData.basicDataButton) .wait(selectors.ticketBasicData.clientAutocomplete) - .click(selectors.ticketService.serviceButton) + .waitToClick(selectors.ticketService.serviceButton) .waitForNumberOfElements(selectors.ticketService.serviceLine, 0) .countElement(selectors.ticketService.serviceLine); diff --git a/e2e/smokes/01_client_path.spec.js b/e2e/smokes/01_client_path.spec.js index b83b6d423..2c70ae959 100644 --- a/e2e/smokes/01_client_path.spec.js +++ b/e2e/smokes/01_client_path.spec.js @@ -9,16 +9,16 @@ describe('create client path', () => { .loginAndModule('employee', 'client'); }); - it('should access to the create client view by clicking the create-client floating button', async () => { + it('should access to the create client view by clicking the create-client floating button', async() => { let url = await nightmare - .click(selectors.clientsIndex.createClientButton) + .waitToClick(selectors.clientsIndex.createClientButton) .wait(selectors.createClientView.createButton) .parsedUrl(); expect(url.hash).toEqual('#!/client/create'); }); - it('should cancel the client creation to go back to clients index', async () => { + it('should cancel the client creation to go back to clients index', async() => { let url = await nightmare .waitToClick(selectors.globalItems.applicationsMenuButton) .waitToClick(selectors.globalItems.clientsButton)