diff --git a/e2e/helpers/extensions.js b/e2e/helpers/extensions.js index 4a6f9d329..186e0dddd 100644 --- a/e2e/helpers/extensions.js +++ b/e2e/helpers/extensions.js @@ -315,6 +315,20 @@ let actions = { }) .then(done) .catch(done); + }, + + autocompleteSearch: function(autocompleteSelector, searchValue, done) { + this.wait(autocompleteSelector) + .waitToClick(`${autocompleteSelector} input`) + .type(`${autocompleteSelector} vn-drop-down input`, searchValue) + .waitToClick(`${autocompleteSelector} li.active`) + .wait((autocompleteSelector, searchValue) => { + return document.querySelector(`${autocompleteSelector} input`).value.toLowerCase().includes(searchValue.toLowerCase()); + }, autocompleteSelector, searchValue) + .then(done) + .catch(() => { + done(new Error(`.autocompleteSearch() for ${autocompleteSelector}, timed out`)); + }); } }; diff --git a/e2e/helpers/selectors.js b/e2e/helpers/selectors.js index 75135581a..0c35362be 100644 --- a/e2e/helpers/selectors.js +++ b/e2e/helpers/selectors.js @@ -28,8 +28,7 @@ export default { socialName: `${components.vnTextfield}[name="socialName"]`, userName: `${components.vnTextfield}[name="userName"]`, email: `${components.vnTextfield}[name="email"]`, - salesPersonInput: `vn-autocomplete[field="$ctrl.client.salesPersonFk"] input`, - salesBruceBannerOption: `vn-autocomplete[field="$ctrl.client.salesPersonFk"] vn-drop-down ul > li:nth-child(1)`, + salesPersonAutocomplete: `vn-autocomplete[field="$ctrl.client.salesPersonFk"]`, createButton: `${components.vnSubmit}`, cancelButton: `vn-button[href="#!/client/index"]` }, @@ -41,11 +40,8 @@ export default { mobileInput: `${components.vnTextfield}[name="mobile"]`, faxInput: `${components.vnTextfield}[name="fax"]`, emailInput: `${components.vnTextfield}[name="email"]`, - salesPersonInput: `vn-autocomplete[field="$ctrl.client.salesPersonFk"] input`, - salesPersonOptionOne: `vn-autocomplete[field="$ctrl.client.salesPersonFk"] vn-drop-down ul > li:nth-child(1)`, - channelInput: `vn-autocomplete[field="$ctrl.client.contactChannelFk"] input`, - channelMetropolisOption: `vn-autocomplete[field="$ctrl.client.contactChannelFk"] vn-drop-down ul > li:nth-child(3)`, - channelRumorsOption: `vn-autocomplete[field="$ctrl.client.contactChannelFk"] vn-drop-down ul > li:nth-child(4)`, + salesPersonAutocomplete: `vn-autocomplete[field="$ctrl.client.salesPersonFk"]`, + channelAutocomplete: `vn-autocomplete[field="$ctrl.client.contactChannelFk"]`, saveButton: `${components.vnSubmit}` }, clientFiscalData: { @@ -57,10 +53,8 @@ export default { addressInput: `${components.vnTextfield}[name="street"]`, cityInput: `${components.vnTextfield}[name="city"]`, postcodeInput: `${components.vnTextfield}[name="postcode"]`, - provinceInput: `vn-autocomplete[field="$ctrl.client.provinceFk"] input`, - provinceFifthOption: `vn-autocomplete[field="$ctrl.client.provinceFk"] vn-drop-down ul > li:nth-child(5)`, - countryInput: `vn-autocomplete[field="$ctrl.client.countryFk"] input`, - countryThirdOption: `vn-autocomplete[field="$ctrl.client.countryFk"] vn-drop-down ul > li:nth-child(3)`, + provinceAutocomplete: `vn-autocomplete[field="$ctrl.client.provinceFk"]`, + countryAutocomplete: `vn-autocomplete[field="$ctrl.client.countryFk"]`, activeCheckboxLabel: `vn-check[label="Active"] > label`, activeCheckboxInput: `vn-check[label="Active"] input`, frozenCheckboxLabel: `vn-check[label="Frozen"] > label`, @@ -77,15 +71,13 @@ export default { }, clientPayMethod: { payMethodButton: `vn-left-menu a[ui-sref="client.card.billingData"]`, - payMethodInput: `vn-autocomplete[field="$ctrl.client.payMethodFk"] input`, - payMethodIBANOption: `vn-autocomplete[field="$ctrl.client.payMethodFk"] vn-drop-down ul > li:nth-child(5)`, - payMethodOptionOne: `vn-autocomplete[field="$ctrl.client.payMethodFk"] vn-drop-down ul > li:nth-child(2)`, + payMethodAutocomplete: `vn-autocomplete[field="$ctrl.client.payMethodFk"]`, IBANInput: `${components.vnTextfield}[name="iban"]`, dueDayInput: `${components.vnTextfield}[name="dueDay"]`, receivedCoreLCRCheckbox: `vn-check[label='Received LCR'] > label > input`, receivedCoreVNLCheckbox: `vn-check[label='Received core VNL'] > label > input`, receivedB2BVNLCheckbox: `vn-check[label='Received B2B VNL'] > label > input`, - swiftBicInput: 'vn-client-billing-data vn-autocomplete[field="$ctrl.client.bankEntityFk"] input', + swiftBicAutocomplete: 'vn-client-billing-data vn-autocomplete[field="$ctrl.client.bankEntityFk"]', firstSwiftBicOption: `vn-client-billing-data vn-autocomplete[field="$ctrl.client.bankEntityFk"] vn-drop-down ul > li:nth-child(1)`, clearswiftBicButton: `vn-client-billing-data vn-autocomplete[field="$ctrl.client.bankEntityFk"] > div > div > div > vn-icon > i`, newBankEntityButton: 'vn-client-billing-data vn-icon-button[vn-tooltip="New bank entity"] > button', @@ -102,10 +94,8 @@ export default { streetAddressInput: `${components.vnTextfield}[name="street"]`, postcodeInput: `${components.vnTextfield}[name="postalCode"]`, cityInput: `${components.vnTextfield}[name="city"]`, - provinceInput: `vn-autocomplete[field="$ctrl.address.provinceFk"] input`, - provinceSecondOption: `vn-autocomplete[field="$ctrl.address.provinceFk"] vn-drop-down ul > li:nth-child(2)`, - agencyInput: `vn-autocomplete[field="$ctrl.address.agencyModeFk"] input`, - agenctySecondOption: `vn-autocomplete[field="$ctrl.address.agencyModeFk"] vn-drop-down ul > li:nth-child(2)`, + provinceAutocomplete: `vn-autocomplete[field="$ctrl.address.provinceFk"]`, + agencyAutocomplete: `vn-autocomplete[field="$ctrl.address.agencyModeFk"]`, phoneInput: `${components.vnTextfield}[name="phone"]`, mobileInput: `${components.vnTextfield}[name="mobile"]`, defaultAddress: 'vn-client-address-index vn-horizontal:nth-child(2) div[name="street"]', @@ -114,15 +104,10 @@ export default { secondEditButton: `vn-client-address-index vn-horizontal:nth-child(3) vn-icon-button[icon='edit']`, activeCheckbox: `vn-check[label='Enabled'] > label > input`, equalizationTaxCheckboxLabel: `vn-client-address-edit vn-check[label='Is equalizated'] > label > input`, - firstObservationTypeSelect: `vn-client-address-edit [name=observations] :nth-child(1) [field="observation.observationTypeFk"] input`, - firstObservationTypeSelectOptionOne: `vn-client-address-edit [name=observations] :nth-child(1) [field="observation.observationTypeFk"] vn-drop-down ul > li:nth-child(1)`, + firstObservationTypeAutocomplete: `vn-client-address-edit [name=observations] :nth-child(1) [field="observation.observationTypeFk"]`, firstObservationDescriptionInput: `vn-client-address-edit [name=observations] :nth-child(1) [model="observation.description"] input`, - secondObservationTypeSelect: `vn-client-address-edit [name=observations] :nth-child(2) [field="observation.observationTypeFk"] input`, - secondObservationTypeSelectOptionTwo: `vn-client-address-edit [name=observations] :nth-child(2) [field="observation.observationTypeFk"] vn-drop-down ul > li:nth-child(2)`, + secondObservationTypeAutocomplete: `vn-client-address-edit [name=observations] :nth-child(2) [field="observation.observationTypeFk"]`, secondObservationDescriptionInput: `vn-client-address-edit [name=observations] :nth-child(2) [model="observation.description"] input`, - thirdObservationTypeSelect: `vn-client-address-edit [name=observations] :nth-child(3) [field="observation.observationTypeFk"] input`, - thirdObservationTypeSelectOptionThree: `vn-client-address-edit [name=observations] :nth-child(3) [field="observation.observationTypeFk"] vn-drop-down ul > li:nth-child(3)`, - thirdObservationDescriptionInput: `vn-client-address-edit [name=observations] :nth-child(3) [model="observation.description"] input`, addObservationButton: `vn-client-address-edit vn-icon-button[icon="add_circle"]`, saveButton: `${components.vnSubmit}`, cancelButton: `button[ui-sref="client.card.address.index"]` @@ -152,8 +137,7 @@ export default { addGreugeFloatButton: `${components.vnFloatButton}`, amountInput: `${components.vnTextfield}[name="amount"]`, descriptionInput: `${components.vnTextfield}[name="description"]`, - typeInput: `vn-autocomplete[field="$ctrl.greuge.greugeTypeFk"] input`, - typeSecondOption: `vn-autocomplete[field="$ctrl.greuge.greugeTypeFk"] vn-drop-down ul > li`, + typeAutocomplete: `vn-autocomplete[field="$ctrl.greuge.greugeTypeFk"]`, saveButton: `${components.vnSubmit}`, firstGreugeText: 'vn-client-greuge-index vn-card > div vn-table vn-tbody > vn-tr' }, @@ -193,12 +177,9 @@ export default { }, itemCreateView: { name: `${components.vnTextfield}[name="name"]`, - typeSelect: `vn-autocomplete[field="$ctrl.item.typeFk"] input`, - typeSelectOptionThree: `vn-autocomplete[field="$ctrl.item.typeFk"] vn-drop-down ul > li:nth-child(3)`, - intrastatSelect: `vn-autocomplete[field="$ctrl.item.intrastatFk"] input`, - intrastatSelectOptionOne: `vn-autocomplete[field="$ctrl.item.intrastatFk"] vn-drop-down ul > li:nth-child(2)`, - originSelect: `vn-autocomplete[field="$ctrl.item.originFk"] input`, - originSelectOptionOne: `vn-autocomplete[field="$ctrl.item.originFk"] vn-drop-down ul > li:nth-child(2)`, + typeAutocomplete: `vn-autocomplete[field="$ctrl.item.typeFk"]`, + intrastatAutocomplete: `vn-autocomplete[field="$ctrl.item.intrastatFk"]`, + originAutocomplete: `vn-autocomplete[field="$ctrl.item.originFk"]`, createButton: `${components.vnSubmit}`, cancelButton: `button[ui-sref="item.index"]` }, @@ -206,24 +187,19 @@ export default { moreMenu: `vn-item-descriptor > vn-card > div vn-icon-menu > div > vn-icon`, moreMenuRegularizeButton: `vn-item-descriptor vn-icon-menu > div > vn-drop-down > vn-popover ul > li:nth-child(1)`, regularizeQuantityInput: `vn-item-descriptor > vn-dialog > div > form > div.body > tpl-body > div > vn-textfield > div > div > div.infix > input`, - regularizeWarehouseSelect: `#warehouse > div > div > input`, - regularizeWarehouseSelectSecondOption: `#warehouse > vn-drop-down > vn-popover > div > div.content > div > div.list > ul > li:nth-child(2)`, + regularizeWarehouseAutocomplete: `#warehouse`, regularizeSaveButton: `vn-item-descriptor > vn-dialog > div > form > div.buttons > tpl-buttons > button` }, itemBasicData: { goToItemIndexButton: 'vn-item-descriptor [ui-sref="item.index"]', basicDataButton: `vn-left-menu a[ui-sref="item.card.data"]`, - typeSelect: `vn-autocomplete[field="$ctrl.item.typeFk"] input`, - typeSelectOptionThree: `vn-autocomplete[field="$ctrl.item.typeFk"] vn-drop-down ul > li:nth-child(3)`, - intrastatSelect: `vn-autocomplete[field="$ctrl.item.intrastatFk"] input`, - intrastatSelectOptionOne: `vn-autocomplete[field="$ctrl.item.intrastatFk"] vn-drop-down ul > li:nth-child(1)`, + typeAutocomplete: `vn-autocomplete[field="$ctrl.item.typeFk"]`, + intrastatAutocomplete: `vn-autocomplete[field="$ctrl.item.intrastatFk"]`, nameInput: `vn-textfield[label="Name"] input`, relevancyInput: `vn-textfield[label="Relevancy"] input`, - originSelect: `vn-autocomplete[field="$ctrl.item.originFk"] input`, - originSelectOptionTwo: `vn-autocomplete[field="$ctrl.item.originFk"] vn-drop-down ul > li:nth-child(2)`, - expenceSelect: `vn-autocomplete[field="$ctrl.item.expenceFk"] input`, - expenceSelectOptionThree: `vn-autocomplete[field="$ctrl.item.expenceFk"] vn-drop-down ul > li:nth-child(3)`, - longNameInput: `vn-textfield[label="Full name"] input`, + originAutocomplete: `vn-autocomplete[field="$ctrl.item.originFk"]`, + expenceAutocomplete: `vn-autocomplete[field="$ctrl.item.expenceFk"]`, + longNameInput: `vn-textfield[field="$ctrl.item.longName"] input`, isActiveCheckbox: `vn-check[label='Active'] > label > input`, submitBasicDataButton: `${components.vnSubmit}` }, @@ -231,27 +207,22 @@ export default { goToItemIndexButton: 'vn-item-descriptor [ui-sref="item.index"]', tagsButton: `vn-left-menu a[ui-sref="item.card.tags"]`, firstRemoveTagButton: `vn-item-tags vn-horizontal:nth-child(2) vn-icon-button[icon="delete"]`, - firstTagSelect: `vn-item-tags vn-horizontal:nth-child(2) > vn-autocomplete[field="itemTag.tagFk"] input`, - firstTagSelectOptionOne: `vn-item-tags vn-horizontal:nth-child(2) > vn-autocomplete[field="itemTag.tagFk"] vn-drop-down ul > li:nth-child(1)`, + firstTagAutocomplete: `vn-item-tags vn-horizontal:nth-child(2) > vn-autocomplete[field="itemTag.tagFk"]`, firstValueInput: `vn-item-tags vn-horizontal:nth-child(2) > vn-textfield[label="Value"] input`, firstRelevancyInput: `vn-horizontal:nth-child(2) > vn-textfield[label="Relevancy"] input`, - secondTagSelect: `vn-item-tags vn-horizontal:nth-child(3) > vn-autocomplete[field="itemTag.tagFk"] input`, - secondTagSelectOptionOne: `vn-item-tags vn-horizontal:nth-child(3) > vn-autocomplete[field="itemTag.tagFk"] vn-drop-down ul > li:nth-child(1)`, + secondTagAutocomplete: `vn-item-tags vn-horizontal:nth-child(3) > vn-autocomplete[field="itemTag.tagFk"]`, secondValueInput: `vn-item-tags vn-horizontal:nth-child(3) > vn-textfield[label="Value"] input`, secondRelevancyInput: `vn-horizontal:nth-child(3) > vn-textfield[label="Relevancy"] input`, - thirdTagSelect: `vn-item-tags vn-horizontal:nth-child(4) > vn-autocomplete[field="itemTag.tagFk"] input`, - thirdTagSelectOptionOne: `vn-item-tags vn-horizontal:nth-child(4) > vn-autocomplete[field="itemTag.tagFk"] vn-drop-down ul > li:nth-child(1)`, + thirdTagAutocomplete: `vn-item-tags vn-horizontal:nth-child(4) > vn-autocomplete[field="itemTag.tagFk"]`, thirdValueInput: `vn-item-tags vn-horizontal:nth-child(4) > vn-textfield[label="Value"] input`, thirdRelevancyInput: `vn-horizontal:nth-child(4) > vn-textfield[label="Relevancy"] input`, - fourthTagSelect: `vn-item-tags vn-horizontal:nth-child(5) > vn-autocomplete[field="itemTag.tagFk"] input`, - fourthTagSelectOptionOne: `vn-item-tags vn-horizontal:nth-child(5) > vn-autocomplete[field="itemTag.tagFk"] vn-drop-down ul > li:nth-child(1)`, + fourthTagAutocomplete: `vn-item-tags vn-horizontal:nth-child(5) > vn-autocomplete[field="itemTag.tagFk"]`, fourthValueInput: `vn-item-tags vn-horizontal:nth-child(5) > vn-textfield[label="Value"] input`, fourthRelevancyInput: `vn-horizontal:nth-child(5) > vn-textfield[label="Relevancy"] input`, fifthTagSelect: `vn-item-tags vn-horizontal:nth-child(6) > vn-autocomplete[field="itemTag.tagFk"] input`, fifthValueInput: `vn-item-tags vn-horizontal:nth-child(6) > vn-textfield[label="Value"] input`, fifthRelevancyInput: `vn-horizontal:nth-child(6) > vn-textfield[label="Relevancy"] input`, - seventhTagSelectOptionFive: `vn-item-tags vn-horizontal:nth-child(8) > vn-autocomplete[field="itemTag.tagFk"] vn-drop-down ul > li:nth-child(5)`, - seventhTagSelect: `vn-item-tags vn-horizontal:nth-child(8) > vn-autocomplete[field="itemTag.tagFk"] input`, + seventhTagAutocomplete: `vn-item-tags vn-horizontal:nth-child(8) > vn-autocomplete[field="itemTag.tagFk"]`, seventhValueInput: `vn-item-tags vn-horizontal:nth-child(8) > vn-textfield[label="Value"] input`, seventhRelevancyInput: `vn-horizontal:nth-child(8) > vn-textfield[label="Relevancy"] input`, addItemTagButton: `vn-icon-button[icon="add_circle"]`, @@ -259,12 +230,9 @@ export default { }, itemTax: { taxButton: `vn-left-menu a[ui-sref="item.card.tax"]`, - firstClassSelect: `vn-horizontal:nth-child(2) > vn-autocomplete[field="tax.taxClassFk"] input`, - firstClassSelectOptionTwo: `vn-horizontal:nth-child(2) > vn-autocomplete vn-drop-down ul > li:nth-child(2)`, - secondClassSelect: `vn-horizontal:nth-child(3) > vn-autocomplete[field="tax.taxClassFk"] input`, - secondClassSelectOptionOne: `vn-horizontal:nth-child(3) > vn-autocomplete vn-drop-down ul > li:nth-child(1)`, - thirdClassSelect: `vn-horizontal:nth-child(4) > vn-autocomplete[field="tax.taxClassFk"] input`, - thirdClassSelectOptionTwo: `vn-horizontal:nth-child(4) > vn-autocomplete vn-drop-down ul > li:nth-child(2)`, + firstClassAutocomplete: `vn-horizontal:nth-child(2) > vn-autocomplete[field="tax.taxClassFk"]`, + secondClassAutocomplete: `vn-horizontal:nth-child(3) > vn-autocomplete[field="tax.taxClassFk"]`, + thirdClassAutocomplete: `vn-horizontal:nth-child(4) > vn-autocomplete[field="tax.taxClassFk"]`, submitTaxButton: `${components.vnSubmit}` }, itemBarcodes: { @@ -277,26 +245,20 @@ export default { itemNiches: { nicheButton: `vn-left-menu a[ui-sref="item.card.niche"]`, addNicheButton: `vn-icon[icon="add_circle"]`, - firstWarehouseSelect: `vn-autocomplete[field="niche.warehouseFk"] input`, - firstWarehouseSelectSecondOption: `vn-autocomplete[field="niche.warehouseFk"] vn-drop-down ul > li:nth-child(2)`, + firstWarehouseAutocomplete: `vn-autocomplete[field="niche.warehouseFk"] input`, firstCodeInput: `vn-horizontal:nth-child(2) > vn-textfield[label="Code"] input`, secondWarehouseSelect: `vn-horizontal:nth-child(3) > vn-autocomplete[field="niche.warehouseFk"] input`, secondCodeInput: `vn-horizontal:nth-child(3) > vn-textfield[label="Code"] input`, secondNicheRemoveButton: `vn-horizontal:nth-child(3) > vn-none > vn-icon[icon="delete"]`, - thirdWarehouseSelect: `vn-horizontal:nth-child(4) > vn-autocomplete[field="niche.warehouseFk"] input`, - thirdWarehouseSelectFourthOption: `vn-horizontal:nth-child(4) > vn-autocomplete[field="niche.warehouseFk"] vn-drop-down ul > li:nth-child(4)`, + thirdWarehouseAutocomplete: `vn-horizontal:nth-child(4) > vn-autocomplete[field="niche.warehouseFk"]`, thirdCodeInput: `vn-horizontal:nth-child(4) > vn-textfield[label="Code"] input`, submitNichesButton: `${components.vnSubmit}` }, itemBotanical: { botanicalButton: `vn-left-menu a[ui-sref="item.card.botanical"]`, botanicalInput: `vn-horizontal:nth-child(2) > ${components.vnTextfield}`, - genusSelect: `vn-autocomplete[field="$ctrl.botanical.genusFk"] input`, - genusSelectOptionOne: `vn-autocomplete[field="$ctrl.botanical.genusFk"] vn-drop-down ul > li:nth-child(1)`, - genusSelectOptionTwo: `vn-autocomplete[field="$ctrl.botanical.genusFk"] vn-drop-down ul > li:nth-child(2)`, - speciesSelect: `vn-autocomplete[field="$ctrl.botanical.specieFk"] input`, - speciesSelectOptionOne: `vn-autocomplete[field="$ctrl.botanical.specieFk"] vn-drop-down ul > li:nth-child(1)`, - speciesSelectOptionTwo: `vn-autocomplete[field="$ctrl.botanical.specieFk"] vn-drop-down ul > li:nth-child(2)`, + genusAutocomplete: `vn-autocomplete[field="$ctrl.botanical.genusFk"]`, + speciesAutocomplete: `vn-autocomplete[field="$ctrl.botanical.specieFk"]`, submitBotanicalButton: `${components.vnSubmit}` }, itemSummary: { @@ -311,8 +273,7 @@ export default { thirdTicketId: 'vn-item-diary > vn-vertical > vn-card > div > vn-vertical > vn-table > div > vn-tbody > vn-tr:nth-child(3) > vn-td:nth-child(2) > span', firstBalance: 'vn-item-diary > vn-vertical > vn-card > div > vn-vertical > vn-table > div > vn-tbody > vn-tr:nth-child(1) > vn-td.balance', fifthBalance: 'vn-item-diary > vn-vertical > vn-card > div > vn-vertical > vn-table > div > vn-tbody > vn-tr.ng-scope.isToday.isIn > vn-td.balance > span', - warehouseSelect: 'vn-item-diary vn-autocomplete[field="$ctrl.warehouseFk"] > div > div > input', - warehouseSelectFourthOption: 'vn-item-diary > vn-vertical > vn-card > div > vn-vertical > vn-horizontal > vn-autocomplete > vn-drop-down > vn-popover > div > div.content > div > div.list > ul > li:nth-child(4)' + warehouseAutocomplete: 'vn-item-diary vn-autocomplete[field="$ctrl.warehouseFk"]', }, ticketSummary: { sale: 'vn-ticket-summary > vn-card > div > vn-vertical > vn-horizontal:nth-child(3) > vn-one > table > tbody > tr', @@ -345,8 +306,7 @@ export default { notesButton: `vn-left-menu a[ui-sref="ticket.card.observation"]`, firstNoteRemoveButton: `vn-icon[icon="delete"]`, addNoteButton: `vn-icon[icon="add_circle"]`, - firstNoteSelect: `vn-autocomplete[field="observation.observationTypeFk"] input`, - firstNoteSelectSecondOption: `vn-autocomplete[field="observation.observationTypeFk"] vn-drop-down ul > li:nth-child(2)`, + firstNoteTypeAutocomplete: `vn-autocomplete[field="observation.observationTypeFk"]`, firstDescriptionInput: `vn-textfield[label="Description"] input`, submitNotesButton: `${components.vnSubmit}` }, @@ -358,8 +318,7 @@ export default { }, ticketPackages: { packagesButton: `vn-left-menu a[ui-sref="ticket.card.package.index"]`, - firstPackageSelect: `vn-autocomplete[label="Package"] > div > div > input`, - firstPackageSelectOptionTwo: `vn-autocomplete[label="Package"] vn-drop-down ul > li:nth-child(2)`, + firstPackageAutocomplete: `vn-autocomplete[label="Package"]`, firstQuantityInput: `vn-textfield[label="Quantity"] input`, firstRemovePackageButton: `vn-icon[vn-tooltip="Remove package"]`, addPackageButton: `vn-icon-button[vn-tooltip="Add package"]`, @@ -472,9 +431,7 @@ export default { }, claimBasicData: { basicDataButton: `vn-left-menu a[ui-sref="claim.card.basicData"]`, - claimStateSelect: `vn-autocomplete[field="$ctrl.claim.claimStateFk"] input`, - claimStateSelectThirdOption: `vn-autocomplete[field="$ctrl.claim.claimStateFk"] vn-drop-down ul > li:nth-child(3)`, - claimStateSelectFourthOption: `vn-autocomplete[field="$ctrl.claim.claimStateFk"] vn-drop-down ul > li:nth-child(4)`, + claimStateAutocomplete: 'vn-claim-basic-data vn-autocomplete[field="$ctrl.claim.claimStateFk"]', isPaidWithManaCheckbox: `vn-check[field="$ctrl.claim.isChargedToMana"] > label > input`, responsabilityInputRange: `vn-input-range`, observationInput: `vn-textarea[label="Observation"] textarea`, 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 b8354415e..9e5813a5c 100644 --- a/e2e/paths/claim-module/01_edit_basic_data.spec.js +++ b/e2e/paths/claim-module/01_edit_basic_data.spec.js @@ -11,10 +11,9 @@ describe('Claim edit basic data path', () => { .accessToSection('claim.card.basicData'); }); - it(`should edit claim state, is paid with mana and observation fields`, async () => { + it(`should edit claim state, is paid with mana and observation fields`, async() => { const result = await nightmare - .waitToClick(selectors.claimBasicData.claimStateSelect) - .waitToClick(selectors.claimBasicData.claimStateSelectThirdOption) + .autocompleteSearch(selectors.claimBasicData.claimStateAutocomplete, 'Gestionado') .waitToClick(selectors.claimBasicData.isPaidWithManaCheckbox) .clearInput(selectors.claimBasicData.observationInput) .type(selectors.claimBasicData.observationInput, 'edited observation') @@ -24,18 +23,18 @@ describe('Claim edit basic data path', () => { expect(result).toEqual(jasmine.arrayContaining(['Data saved!'])); }); - it('should confirm the claim state was edited', async () => { + it('should confirm the claim state was edited', async() => { const result = await nightmare .click(selectors.claimDetails.detailsButton) .wait(selectors.claimDetails.addItemButton) .click(selectors.claimBasicData.basicDataButton) .wait(selectors.claimBasicData.claimStateSelect) - .waitToGetProperty(selectors.claimBasicData.claimStateSelect, 'value'); + .waitToGetProperty(`${selectors.claimBasicData.claimStateAutocomplete} input`, 'value'); expect(result).toEqual('Gestionado'); }); - it('should confirm the Is paid with mana checkbox is checked', async () => { + it('should confirm the Is paid with mana checkbox is checked', async() => { const value = await nightmare .evaluate(selector => { return document.querySelector(selector).checked; @@ -44,17 +43,16 @@ describe('Claim edit basic data path', () => { expect(value).toBeTruthy(); }); - it('should confirm the claim observation was edited', async () => { + it('should confirm the claim observation was edited', async() => { const result = await nightmare .waitToGetProperty(selectors.claimBasicData.observationInput, 'value'); expect(result).toEqual('edited observation'); }); - it(`should edit the claim to leave it untainted`, async () => { + it(`should edit the claim to leave it untainted`, async() => { const result = await nightmare - .waitToClick(selectors.claimBasicData.claimStateSelect) - .waitToClick(selectors.claimBasicData.claimStateSelectFourthOption) + .autocompleteSearch(selectors.claimBasicData.claimStateAutocomplete, 'Pendiente') .waitToClick(selectors.claimBasicData.isPaidWithManaCheckbox) .clearInput(selectors.claimBasicData.observationInput) .type(selectors.claimBasicData.observationInput, 'Observation one') diff --git a/e2e/paths/client-module/01_create_client.spec.js b/e2e/paths/client-module/01_create_client.spec.js index 440ac6b1d..06c981c15 100644 --- a/e2e/paths/client-module/01_create_client.spec.js +++ b/e2e/paths/client-module/01_create_client.spec.js @@ -9,7 +9,7 @@ describe('Client create path', () => { .loginAndModule('employee', 'client'); }); - it(`should search for the user Carol Danvers to confirm it isn't created yet`, async () => { + 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') @@ -20,7 +20,7 @@ describe('Client create path', () => { expect(result).toEqual(0); }); - it('should now access to the create client view by clicking the create-client floating button', async () => { + 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) .wait(selectors.createClientView.createButton) @@ -29,7 +29,7 @@ describe('Client create path', () => { expect(url.hash).toEqual('#!/client/create'); }); - it('should receive an error when clicking the create button having all the form fields empty', async () => { + 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) .waitForLastSnackbar(); @@ -37,20 +37,19 @@ describe('Client create path', () => { expect(result).toEqual('Some fields are invalid'); }); - it('should receive an error when clicking the create button having name and Business name fields empty', async () => { + 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') - .waitToClick(selectors.createClientView.salesPersonInput) - .waitToClick(selectors.createClientView.salesBruceBannerOption) + .autocompleteSearch(selectors.createClientView.salesPersonAutocomplete, 'Accessory') .click(selectors.createClientView.createButton) .waitForLastSnackbar(); expect(result).toEqual('Some fields are invalid'); }); - it(`should attempt to create a new user with all it's data but wrong email`, async () => { + 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') @@ -62,7 +61,7 @@ describe('Client create path', () => { expect(result).toEqual('Some fields are invalid'); }); - it(`should create a new user with all correct data`, async () => { + 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') @@ -72,7 +71,7 @@ describe('Client create path', () => { expect(result).toEqual('Data saved!'); }); - it('should click on the Clients button of the top bar menu', async () => { + it('should click on the Clients button of the top bar menu', async() => { const url = await nightmare .waitToClick(selectors.globalItems.applicationsMenuButton) .wait(selectors.globalItems.applicationsMenuVisible) @@ -83,7 +82,7 @@ describe('Client create path', () => { expect(url.hash).toEqual('#!/client/index'); }); - it(`should search for the user Carol Danvers to confirm it exists`, async () => { + 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') 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 7ca1d9874..0f3111ab9 100644 --- a/e2e/paths/client-module/02_edit_basic_data.spec.js +++ b/e2e/paths/client-module/02_edit_basic_data.spec.js @@ -11,17 +11,17 @@ describe('Client Edit basicData path', () => { .accessToSection('client.card.basicData'); }); - it('should not be able to change the salesPerson', async () => { + it('should not be able to change the salesPerson', async() => { const result = await nightmare .wait(selectors.clientBasicData.nameInput) .evaluate(selector => { return document.querySelector(selector).disabled; - }, selectors.clientBasicData.salesPersonInput); + }, `${selectors.clientBasicData.salesPersonAutocomplete} input`); expect(result).toBeTruthy(); }); - it('should edit the client basic data but leave salesPerson untainted', async () => { + 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') @@ -33,15 +33,14 @@ describe('Client Edit basicData path', () => { .type(selectors.clientBasicData.mobileInput, '123456789') .clearInput(selectors.clientBasicData.emailInput) .type(selectors.clientBasicData.emailInput, 'PWallace@verdnatura.es') - .waitToClick(selectors.clientBasicData.channelInput) - .waitToClick(selectors.clientBasicData.channelRumorsOption) + .autocompleteSearch(selectors.clientBasicData.channelAutocomplete, 'Rumors on the streets') .click(selectors.clientBasicData.saveButton) .waitForLastSnackbar(); expect(result).toEqual('Data saved!'); }); - it('should confirm the name have been edited', async () => { + it('should confirm the name have been edited', async() => { const result = await nightmare .click(selectors.clientFiscalData.fiscalDataButton) .wait(selectors.clientFiscalData.addressInput) @@ -51,37 +50,37 @@ describe('Client Edit basicData path', () => { expect(result).toEqual('Ptonomy Wallace'); }); - it('should confirm the contact name have been edited', async () => { + it('should confirm the contact name have been edited', async() => { const result = await nightmare .waitToGetProperty(selectors.clientBasicData.contactInput, 'value'); expect(result).toEqual('David Haller'); }); - it('should confirm the landline phone number have been added', async () => { + it('should confirm the landline phone number have been added', async() => { const result = await nightmare .waitToGetProperty(selectors.clientBasicData.phoneInput, 'value'); expect(result).toEqual('987654321'); }); - it('should confirm the mobile phone number have been added', async () => { + it('should confirm the mobile phone number have been added', async() => { const result = await nightmare .waitToGetProperty(selectors.clientBasicData.mobileInput, 'value'); expect(result).toEqual('123456789'); }); - it('should confirm the email have been edited', async () => { + it('should confirm the email have been edited', async() => { const result = await nightmare .waitToGetProperty(selectors.clientBasicData.emailInput, 'value'); expect(result).toEqual('PWallace@verdnatura.es'); }); - it('should confirm the channel have been selected', async () => { + it('should confirm the channel have been selected', async() => { const result = await nightmare - .waitToGetProperty(selectors.clientBasicData.channelInput, 'value'); + .waitToGetProperty(`${selectors.clientBasicData.channelAutocomplete} input`, 'value'); expect(result).toEqual('Rumors on the streets'); }); @@ -96,17 +95,17 @@ describe('Client Edit basicData path', () => { .accessToSection('client.card.basicData'); }); - it('should be able to change the salesPerson', async () => { + it('should be able to change the salesPerson', async() => { const result = await nightmare .wait(selectors.clientBasicData.nameInput) .evaluate(selector => { return document.querySelector(selector).disabled; - }, selectors.clientBasicData.salesPersonInput); + }, `${selectors.clientBasicData.salesPersonAutocomplete} input`); expect(result).toBeFalsy(); }); - it('should edit the client basic data including salesPerson', async () => { + it('should edit the client basic data including salesPerson', async() => { const result = await nightmare .clearInput(selectors.clientBasicData.nameInput) .type(selectors.clientBasicData.nameInput, 'Ororo Munroe') @@ -118,17 +117,15 @@ describe('Client Edit basicData path', () => { .type(selectors.clientBasicData.mobileInput, '987654321') .clearInput(selectors.clientBasicData.emailInput) .type(selectors.clientBasicData.emailInput, 'Storm@verdnatura.es') - .waitToClick(selectors.clientBasicData.salesPersonInput) - .waitToClick(selectors.clientBasicData.salesPersonOptionOne) - .waitToClick(selectors.clientBasicData.channelInput) - .waitToClick(selectors.clientBasicData.channelMetropolisOption) + .autocompleteSearch(selectors.clientBasicData.salesPersonAutocomplete, 'Accessory') + .autocompleteSearch(selectors.clientBasicData.channelAutocomplete, 'Metropolis newspaper') .click(selectors.clientBasicData.saveButton) .waitForLastSnackbar(); expect(result).toEqual('Data saved!'); }); - it('should now confirm the name have been edited', async () => { + it('should now confirm the name have been edited', async() => { const result = await nightmare .click(selectors.clientFiscalData.fiscalDataButton) .wait(selectors.clientFiscalData.addressInput) @@ -138,44 +135,44 @@ describe('Client Edit basicData path', () => { expect(result).toEqual('Ororo Munroe'); }); - it('should now confirm the contact name have been edited', async () => { + it('should now confirm the contact name have been edited', async() => { const result = await nightmare .waitToGetProperty(selectors.clientBasicData.contactInput, 'value'); expect(result).toEqual('Black Panther'); }); - it('should now confirm the landline phone number have been added', async () => { + it('should now confirm the landline phone number have been added', async() => { const result = await nightmare .waitToGetProperty(selectors.clientBasicData.phoneInput, 'value'); expect(result).toEqual('123456789'); }); - it('should now confirm the mobile phone number have been added', async () => { + it('should now confirm the mobile phone number have been added', async() => { const result = await nightmare .waitToGetProperty(selectors.clientBasicData.mobileInput, 'value'); expect(result).toEqual('987654321'); }); - it('should now confirm the email have been edited', async () => { + it('should now confirm the email have been edited', async() => { const result = await nightmare .waitToGetProperty(selectors.clientBasicData.emailInput, 'value'); expect(result).toEqual('Storm@verdnatura.es'); }); - it('should confirm the sales person have been selected', async () => { + it('should confirm the sales person have been selected', async() => { const result = await nightmare - .waitToGetProperty(selectors.clientBasicData.salesPersonInput, 'value'); + .waitToGetProperty(`${selectors.clientBasicData.salesPersonAutocomplete} input`, 'value'); expect(result).toEqual('accessory accessory'); }); - it('should now confirm the channel have been selected', async () => { + it('should now confirm the channel have been selected', async() => { const result = await nightmare - .waitToGetProperty(selectors.clientBasicData.channelInput, 'value'); + .waitToGetProperty(`${selectors.clientBasicData.channelAutocomplete} input`, 'value'); expect(result).toEqual('Metropolis newspaper'); }); 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 8e2617a0e..7144e76a2 100644 --- a/e2e/paths/client-module/03_edit_fiscal_data.spec.js +++ b/e2e/paths/client-module/03_edit_fiscal_data.spec.js @@ -12,7 +12,7 @@ describe('Client Edit fiscalData path', () => { }); // Confirms all addresses have EQtax false for future propagation test step 1 - it(`should click on the 1st edit icon to check EQtax isnt checked`, async () => { + it(`should click on the 1st edit icon to check EQtax isnt checked`, async() => { const result = await nightmare .waitToClick(selectors.clientAddresses.firstEditButton) .wait(selectors.clientAddresses.equalizationTaxCheckboxLabel) @@ -24,7 +24,7 @@ describe('Client Edit fiscalData path', () => { }); // Confirms all addresses have EQtax false for future propagation test step 2 - it(`should go back to addresses then select the second one and confirm the EQtax isnt checked`, async () => { + it(`should go back to addresses then select the second one and confirm the EQtax isnt checked`, async() => { const result = await nightmare .waitToClick(selectors.clientAddresses.addressesButton) .waitToClick(selectors.clientAddresses.secondEditButton) @@ -36,7 +36,7 @@ describe('Client Edit fiscalData path', () => { expect(result).toBeFalsy(); }); - it(`should click on the fiscal data button`, async () => { + it(`should click on the fiscal data button`, async() => { const url = await nightmare .waitToClick(selectors.clientFiscalData.fiscalDataButton) .waitForURL('fiscal-data') @@ -45,7 +45,7 @@ describe('Client Edit fiscalData path', () => { expect(url.hash).toContain('fiscal-data'); }); - it('should not be able to edit the verified data checkbox', async () => { + it('should not be able to edit the verified data checkbox', async() => { const result = await nightmare .evaluate(selector => { return document.querySelector(selector).disabled; @@ -63,7 +63,7 @@ describe('Client Edit fiscalData path', () => { .accessToSection('client.card.fiscalData'); }); - it('should receive an error if VIES and EQtax are being ticked together', async () => { + it('should receive an error if VIES and EQtax are being ticked together', async() => { const result = await nightmare .wait(selectors.clientFiscalData.socialNameInput) .clearInput(selectors.clientFiscalData.socialNameInput) @@ -76,10 +76,8 @@ describe('Client Edit fiscalData path', () => { .type(selectors.clientFiscalData.postcodeInput, '12345') .clearInput(selectors.clientFiscalData.cityInput) .type(selectors.clientFiscalData.cityInput, 'N/A') - .waitToClick(selectors.clientFiscalData.countryInput) - .waitToClick(selectors.clientFiscalData.countryThirdOption) - .waitToClick(selectors.clientFiscalData.provinceInput) - .waitToClick(selectors.clientFiscalData.provinceFifthOption) + .autocompleteSearch(selectors.clientFiscalData.countryAutocomplete, 'Francia') + .autocompleteSearch(selectors.clientFiscalData.provinceAutocomplete, 'Province two') .waitToClick(selectors.clientFiscalData.activeCheckboxLabel) .waitToClick(selectors.clientFiscalData.frozenCheckboxLabel) .waitToClick(selectors.clientFiscalData.hasToInvoiceCheckboxLabel) @@ -94,7 +92,7 @@ describe('Client Edit fiscalData path', () => { expect(result).toEqual('Cannot check VIES and Equalization Tax'); }); - it('should receive an error if the fiscal id contains A or B at the beginning', async () => { + it('should receive an error if the fiscal id contains A or B at the beginning', async() => { const result = await nightmare .waitToClick(selectors.clientFiscalData.viesCheckboxInput) .clearInput(selectors.clientFiscalData.fiscalIdInput) @@ -105,7 +103,7 @@ describe('Client Edit fiscalData path', () => { expect(result).toEqual('Cannot check Equalization Tax in this NIF/CIF'); }); - it('should finally edit the fixcal data correctly as VIES isnt checked and fiscal id is valid for EQtax', async () => { + 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') @@ -115,7 +113,7 @@ describe('Client Edit fiscalData path', () => { expect(result).toEqual('Data saved!'); }); - it('should propagate the Equalization tax', async () => { + it('should propagate the Equalization tax', async() => { const result = await nightmare .waitToClick(selectors.clientFiscalData.acceptPropagationButton) .waitForLastSnackbar(); @@ -124,7 +122,7 @@ describe('Client Edit fiscalData path', () => { }); // confirm all addresses have now EQtax checked step 1 - it(`should click on the addresses button to access to the client's addresses`, async () => { + it(`should click on the addresses button to access to the client's addresses`, async() => { const url = await nightmare .waitToClick(selectors.clientAddresses.addressesButton) .waitForURL('/address/index') @@ -134,7 +132,7 @@ describe('Client Edit fiscalData path', () => { }); // confirm all addresses have now EQtax checked step 2 - it(`should click on the 1st edit icon to confirm EQtax is checked`, async () => { + it(`should click on the 1st edit icon to confirm EQtax is checked`, async() => { const result = await nightmare .waitToClick(selectors.clientAddresses.firstEditButton) .wait(selectors.clientAddresses.equalizationTaxCheckboxLabel) @@ -146,7 +144,7 @@ describe('Client Edit fiscalData path', () => { }); // confirm all addresses have now EQtax checked step 3 - it(`should go back to addresses then select the second one and confirm the EQtax is checked`, async () => { + it(`should go back to addresses then select the second one and confirm the EQtax is checked`, async() => { const result = await nightmare .waitToClick(selectors.clientAddresses.addressesButton) .waitToClick(selectors.clientAddresses.secondEditButton) @@ -158,7 +156,7 @@ describe('Client Edit fiscalData path', () => { expect(result).toBeTruthy(); }); - it('should navigate back to fiscal data and uncheck EQtax then check VIES', async () => { + it('should navigate back to fiscal data and uncheck EQtax then check VIES', async() => { const result = await nightmare .waitToClick(selectors.clientFiscalData.fiscalDataButton) .waitToClick(selectors.clientFiscalData.viesCheckboxInput) @@ -169,7 +167,7 @@ describe('Client Edit fiscalData path', () => { expect(result).toEqual('Data saved!'); }); - it('should propagate the Equalization tax changes', async () => { + it('should propagate the Equalization tax changes', async() => { const result = await nightmare .waitToClick(selectors.clientFiscalData.acceptPropagationButton) .waitForLastSnackbar(); @@ -177,7 +175,7 @@ describe('Client Edit fiscalData path', () => { expect(result).toEqual('Equivalent tax spreaded'); }); - it('should confirm its name have been edited', async () => { + it('should confirm its name have been edited', async() => { const result = await nightmare .waitToClick(selectors.clientFiscalData.fiscalDataButton) .waitToGetProperty(selectors.clientFiscalData.socialNameInput, 'value'); @@ -185,49 +183,49 @@ describe('Client Edit fiscalData path', () => { expect(result).toEqual('SMASH!'); }); - it('should confirm the fiscal id have been edited', async () => { + it('should confirm the fiscal id have been edited', async() => { const result = await nightmare .waitToGetProperty(selectors.clientFiscalData.fiscalIdInput, 'value'); expect(result).toEqual('94980061C'); }); - it('should confirm the address have been edited', async () => { + it('should confirm the address have been edited', async() => { const result = await nightmare .waitToGetProperty(selectors.clientFiscalData.addressInput, 'value'); expect(result).toEqual('Somewhere edited'); }); - it('should confirm the postcode have been edited', async () => { + it('should confirm the postcode have been edited', async() => { const result = await nightmare .waitToGetProperty(selectors.clientFiscalData.postcodeInput, 'value'); expect(result).toEqual('12345'); }); - it('should confirm the city have been edited', async () => { + it('should confirm the city have been edited', async() => { const result = await nightmare .waitToGetProperty(selectors.clientFiscalData.cityInput, 'value'); expect(result).toEqual('N/A'); }); - it(`should confirm the country have been selected`, async () => { + it(`should confirm the country have been selected`, async() => { const result = await nightmare - .waitToGetProperty(selectors.clientFiscalData.countryInput, 'value'); + .waitToGetProperty(`${selectors.clientFiscalData.countryAutocomplete} input`, 'value'); expect(result).toEqual('Francia'); }); - it(`should confirm the province have been selected`, async () => { + it(`should confirm the province have been selected`, async() => { const result = await nightmare - .waitToGetProperty(selectors.clientFiscalData.provinceInput, 'value'); + .waitToGetProperty(`${selectors.clientFiscalData.provinceAutocomplete} input`, 'value'); expect(result).toEqual('Province two'); }); - it('should confirm active checkbox is unchecked', async () => { + it('should confirm active checkbox is unchecked', async() => { const result = await nightmare .evaluate(selector => { return document.querySelector(selector).checked; @@ -236,7 +234,7 @@ describe('Client Edit fiscalData path', () => { expect(result).toBeFalsy(); }); - it('should confirm frozen checkbox is unchecked', async () => { + it('should confirm frozen checkbox is unchecked', async() => { const result = await nightmare .evaluate(selector => { return document.querySelector(selector).checked; @@ -245,7 +243,7 @@ describe('Client Edit fiscalData path', () => { expect(result).toBeFalsy(); }); - it('should confirm Has to invoice checkbox is unchecked', async () => { + it('should confirm Has to invoice checkbox is unchecked', async() => { const result = await nightmare .evaluate(selector => { return document.querySelector(selector).checked; @@ -254,7 +252,7 @@ describe('Client Edit fiscalData path', () => { expect(result).toBeFalsy(); }); - it('should confirm Vies checkbox is checked', async () => { + it('should confirm Vies checkbox is checked', async() => { const result = await nightmare .evaluate(selector => { return document.querySelector(selector).checked; @@ -263,7 +261,7 @@ describe('Client Edit fiscalData path', () => { expect(result).toBeTruthy(); }); - it('should confirm Invoice by mail checkbox is unchecked', async () => { + it('should confirm Invoice by mail checkbox is unchecked', async() => { const result = await nightmare .evaluate(selector => { return document.querySelector(selector).checked; @@ -272,7 +270,7 @@ describe('Client Edit fiscalData path', () => { expect(result).toBeFalsy(); }); - it('should confirm invoice by address checkbox is unchecked', async () => { + it('should confirm invoice by address checkbox is unchecked', async() => { const result = await nightmare .evaluate(selector => { return document.querySelector(selector).checked; @@ -281,7 +279,7 @@ describe('Client Edit fiscalData path', () => { expect(result).toBeFalsy(); }); - it('should confirm Equalization tax checkbox is unchecked', async () => { + it('should confirm Equalization tax checkbox is unchecked', async() => { const result = await nightmare .evaluate(selector => { return document.querySelector(selector).checked; @@ -290,7 +288,7 @@ describe('Client Edit fiscalData path', () => { expect(result).toBeFalsy(); }); - it('should confirm Verified data checkbox is checked', async () => { + it('should confirm Verified data checkbox is checked', async() => { const result = await nightmare .evaluate(selector => { return document.querySelector(selector).checked; @@ -300,7 +298,7 @@ describe('Client Edit fiscalData path', () => { }); // confirm invoice by address checkbox gets checked if the EQtax differs between addresses step 1 - it(`should click on the addresses button to access to the client's addresses`, async () => { + it(`should click on the addresses button to access to the client's addresses`, async() => { const url = await nightmare .waitToClick(selectors.clientAddresses.addressesButton) .waitForURL('/address/index') @@ -310,7 +308,7 @@ describe('Client Edit fiscalData path', () => { }); // confirm invoice by address checkbox gets checked if the EQtax differs between addresses step 2 - it(`should click on the 1st edit icon to access the address details and uncheck EQtax checkbox`, async () => { + it(`should click on the 1st edit icon to access the address details and uncheck EQtax checkbox`, async() => { const result = await nightmare .waitToClick(selectors.clientAddresses.firstEditButton) .waitToClick(selectors.clientAddresses.equalizationTaxCheckboxLabel) @@ -321,7 +319,7 @@ describe('Client Edit fiscalData path', () => { }); // confirm invoice by address checkbox gets checked if the EQtax differs between addresses step 3 - it('should navigate back to fiscal data to confirm invoice by address is now checked', async () => { + it('should navigate back to fiscal data to confirm invoice by address is now checked', async() => { const result = await nightmare .waitToClick(selectors.clientFiscalData.fiscalDataButton) .wait(selectors.clientFiscalData.invoiceByAddressCheckboxInput) 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 cab7b317c..c785c64a3 100644 --- a/e2e/paths/client-module/04_edit_pay_method.spec.js +++ b/e2e/paths/client-module/04_edit_pay_method.spec.js @@ -11,14 +11,10 @@ describe('Client Edit pay method path', () => { .accessToSection('client.card.billingData'); }); - it(`should attempt to edit the Pay method without an IBAN but fail`, async () => { + it(`should attempt to edit the Pay method without an IBAN but fail`, async() => { const snackbarMessage = await nightmare - .waitToClick(selectors.clientPayMethod.payMethodInput) - .waitToClick(selectors.clientPayMethod.payMethodIBANOption) - .waitForTextInInput(selectors.clientPayMethod.payMethodInput, 'PayMethod with IBAN') - .waitToClick(selectors.clientPayMethod.swiftBicInput) - .waitToClick(selectors.clientPayMethod.firstSwiftBicOption) - .waitForTextInInput(selectors.clientPayMethod.swiftBicInput, 'BBKKESMMMMM') + .autocompleteSearch(selectors.clientPayMethod.payMethodAutocomplete, 'PayMethod with IBAN') + .autocompleteSearch(selectors.clientPayMethod.swiftBicAutocomplete, 'BBKKESMMMMM') .clearInput(selectors.clientPayMethod.dueDayInput) .type(selectors.clientPayMethod.dueDayInput, '60') .waitForTextInInput(selectors.clientPayMethod.dueDayInput, '60') @@ -31,7 +27,7 @@ describe('Client Edit pay method path', () => { expect(snackbarMessage).toEqual('That payment method requires an IBAN'); }); - it(`should add the IBAN but fail as it requires a BIC code`, async () => { + it(`should add the IBAN but fail as it requires a BIC code`, async() => { const snackbarMessage = await nightmare .clearInput(selectors.clientPayMethod.IBANInput) .type(selectors.clientPayMethod.IBANInput, 'ES9121000418450200051332') @@ -43,46 +39,46 @@ describe('Client Edit pay method path', () => { expect(snackbarMessage).toEqual('That payment method requires a BIC'); }); - it(`should create a new BIC code`, async () => { + it(`should create a new BIC code`, async() => { const newcode = await nightmare .click(selectors.clientPayMethod.newBankEntityButton) .type(selectors.clientPayMethod.newBankEntityName, 'Gotham City Banks') .type(selectors.clientPayMethod.newBankEntityBIC, 'GTHMCT') .click(selectors.clientPayMethod.acceptBankEntityButton) - .waitToGetProperty(selectors.clientPayMethod.swiftBicInput, 'value'); + .waitToGetProperty(`${selectors.clientPayMethod.swiftBicAutocomplete} input`, 'value'); expect(newcode).toEqual('GTHMCT Gotham City Banks'); }); - it(`should confirm the IBAN pay method is sucessfully saved`, async () => { + it(`should confirm the IBAN pay method is sucessfully saved`, async() => { const payMethod = await nightmare - .waitToGetProperty(selectors.clientPayMethod.payMethodInput, 'value'); + .waitToGetProperty(`${selectors.clientPayMethod.payMethodAutocomplete} input`, 'value'); expect(payMethod).toEqual('PayMethod with IBAN'); }); - it('should confirm the due day have been edited', async () => { + it('should confirm the due day have been edited', async() => { const dueDate = await nightmare .waitToGetProperty(selectors.clientPayMethod.dueDayInput, 'value'); expect(dueDate).toEqual('60'); }); - it('should confirm the IBAN was saved', async () => { + it('should confirm the IBAN was saved', async() => { const IBAN = await nightmare .waitToGetProperty(selectors.clientPayMethod.IBANInput, 'value'); expect(IBAN).toEqual('ES9121000418450200051332'); }); - it('should confirm the swift / BIC code was saved', async () => { + it('should confirm the swift / BIC code was saved', async() => { const code = await nightmare - .waitToGetProperty(selectors.clientPayMethod.swiftBicInput, 'value'); + .waitToGetProperty(`${selectors.clientPayMethod.swiftBicAutocomplete} input`, 'value'); expect(code).toEqual('GTHMCT Gotham City Banks'); }); - it('should confirm Received LCR checkbox is checked', async () => { + it('should confirm Received LCR checkbox is checked', async() => { const checkedBox = await nightmare .evaluate(selector => { return document.querySelector(selector).checked; @@ -91,7 +87,7 @@ describe('Client Edit pay method path', () => { expect(checkedBox).toBeTruthy(); }); - it('should confirm Received core VNL checkbox is unchecked', async () => { + it('should confirm Received core VNL checkbox is unchecked', async() => { const checkedBox = await nightmare .evaluate(selector => { return document.querySelector(selector).checked; @@ -100,7 +96,7 @@ describe('Client Edit pay method path', () => { expect(checkedBox).toBeFalsy(); }); - it('should confirm Received B2B VNL checkbox is unchecked', async () => { + it('should confirm Received B2B VNL checkbox is unchecked', async() => { const checkedBox = await nightmare .evaluate(selector => { return document.querySelector(selector).checked; diff --git a/e2e/paths/client-module/05_add_address.spec.js b/e2e/paths/client-module/05_add_address.spec.js index b24acf57f..f7f3e361e 100644 --- a/e2e/paths/client-module/05_add_address.spec.js +++ b/e2e/paths/client-module/05_add_address.spec.js @@ -11,7 +11,7 @@ describe('Client Add address path', () => { .accessToSection('client.card.address.index'); }); - it(`should click on the add new address button to access to the new address form`, async () => { + it(`should click on the add new address button to access to the new address form`, async() => { const url = await nightmare .waitToClick(selectors.clientAddresses.createAddress) .waitForURL('address/create') @@ -20,7 +20,7 @@ describe('Client Add address path', () => { expect(url.hash).toContain('address/create'); }); - it(`should return to the addreses section by clicking the cancel button`, async () => { + it(`should return to the addreses section by clicking the cancel button`, async() => { const url = await nightmare .waitToClick(selectors.clientAddresses.cancelButton) .waitForURL('address/index') @@ -29,7 +29,7 @@ describe('Client Add address path', () => { expect(url.hash).toContain('address/index'); }); - it(`should now click on the add new address button to access to the new address form`, async () => { + it(`should now click on the add new address button to access to the new address form`, async() => { const url = await nightmare .waitToClick(selectors.clientAddresses.createAddress) .waitForURL('address/create') @@ -38,15 +38,13 @@ describe('Client Add address path', () => { expect(url.hash).toContain('address/create'); }); - it('should receive an error after clicking save button as consignee, street and town fields are empty', async () => { + it('should receive an error after clicking save button as consignee, street and town fields are empty', async() => { const result = await nightmare .waitToClick(selectors.clientAddresses.defaultCheckboxInput) .clearInput(selectors.clientAddresses.streetAddressInput) .type(selectors.clientAddresses.postcodeInput, '10022') - .waitToClick(selectors.clientAddresses.provinceInput) - .waitToClick(selectors.clientAddresses.provinceSecondOption) - .waitToClick(selectors.clientAddresses.agencyInput) - .waitToClick(selectors.clientAddresses.agenctySecondOption) + .autocompleteSearch(selectors.clientAddresses.provinceAutocomplete, 'Province four') + .autocompleteSearch(selectors.clientAddresses.agencyAutocomplete, 'Entanglement') .type(selectors.clientAddresses.phoneInput, '999887744') .type(selectors.clientAddresses.mobileInput, '999887744') .waitToClick(selectors.clientFiscalData.saveButton) @@ -55,7 +53,7 @@ describe('Client Add address path', () => { expect(result).toEqual('Some fields are invalid'); }); - it(`should create a new address with all it's data`, async () => { + it(`should create a new address with all it's data`, async() => { const result = await nightmare .type(selectors.clientAddresses.consigneeInput, 'Bruce Bunner') .type(selectors.clientAddresses.streetAddressInput, '320 Park Avenue New York') @@ -66,7 +64,7 @@ describe('Client Add address path', () => { expect(result).toEqual('Data saved!'); }); - it(`should click on the addresses button confirm the new address exists and it's the default one`, async () => { + it(`should click on the addresses button confirm the new address exists and it's the default one`, async() => { const result = await nightmare .waitToClick(selectors.clientAddresses.addressesButton) .waitToGetProperty(selectors.clientAddresses.defaultAddress, 'innerText'); @@ -74,7 +72,7 @@ describe('Client Add address path', () => { expect(result).toContain('320 Park Avenue New York'); }); - it(`should click on the make default icon of the second address then confirm it is the default one now`, async () => { + it(`should click on the make default icon of the second address then confirm it is the default one now`, async() => { const result = await nightmare .waitToClick(selectors.clientAddresses.secondMakeDefaultStar) .waitForTextInElement(selectors.clientAddresses.defaultAddress, 'Somewhere in Thailand') @@ -83,7 +81,7 @@ describe('Client Add address path', () => { expect(result).toContain('Somewhere in Thailand'); }); - it(`should click on the edit icon of the default address`, async () => { + it(`should click on the edit icon of the default address`, async() => { const url = await nightmare .waitForTextInElement(selectors.clientAddresses.defaultAddress, 'Somewhere in Thailand') .waitToClick(selectors.clientAddresses.firstEditButton) @@ -93,7 +91,7 @@ describe('Client Add address path', () => { expect(url.hash).toContain('/edit'); }); - it(`should click on the active checkbox and receive an error to save it because it is the default address`, async () => { + it(`should click on the active checkbox and receive an error to save it because it is the default address`, async() => { const result = await nightmare .waitToClick(selectors.clientAddresses.activeCheckbox) .waitToClick(selectors.clientAddresses.saveButton) 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 bd5582de4..a27f62430 100644 --- a/e2e/paths/client-module/06_add_address_notes.spec.js +++ b/e2e/paths/client-module/06_add_address_notes.spec.js @@ -11,7 +11,7 @@ describe('Client add address notes path', () => { .accessToSection('client.card.address.index'); }); - it(`should click on the edit icon of the default address`, async () => { + it(`should click on the edit icon of the default address`, async() => { const url = await nightmare .waitForTextInElement(selectors.clientAddresses.defaultAddress, '20 Ingram Street') .waitToClick(selectors.clientAddresses.firstEditButton) @@ -21,7 +21,7 @@ describe('Client add address notes path', () => { expect(url.hash).toContain('/edit'); }); - it('should not save a description without observation type', async () => { + it('should not save a description without observation type', async() => { const result = await nightmare .waitToClick(selectors.clientAddresses.addObservationButton) .wait(selectors.clientAddresses.firstObservationDescriptionInput) @@ -32,23 +32,21 @@ describe('Client add address notes path', () => { expect(result).toEqual('Observation type cannot be blank'); }); - it('should not save an observation type without description', async () => { + it('should not save an observation type without description', async() => { const result = await nightmare .clearInput(selectors.clientAddresses.firstObservationDescriptionInput) - .waitToClick(selectors.clientAddresses.firstObservationTypeSelect) - .waitToClick(selectors.clientAddresses.firstObservationTypeSelectOptionOne) + .autocompleteSearch(selectors.clientAddresses.firstObservationTypeAutocomplete, 'comercial') .waitToClick(selectors.clientAddresses.saveButton) .waitForLastSnackbar(); expect(result).toEqual('Some fields are invalid'); }); - it('should create two new observations', async () => { + it('should create two new observations', async() => { const result = await nightmare .type(selectors.clientAddresses.firstObservationDescriptionInput, 'first description') .waitToClick(selectors.clientAddresses.addObservationButton) - .waitToClick(selectors.clientAddresses.secondObservationTypeSelect) - .waitToClick(selectors.clientAddresses.secondObservationTypeSelectOptionTwo) + .autocompleteSearch(selectors.clientAddresses.secondObservationTypeAutocomplete, 'observation one') .type(selectors.clientAddresses.secondObservationDescriptionInput, 'second description') .waitToClick(selectors.clientAddresses.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 9859fd07e..c1ca1ba18 100644 --- a/e2e/paths/client-module/10_add_greuge.spec.js +++ b/e2e/paths/client-module/10_add_greuge.spec.js @@ -11,7 +11,7 @@ describe('Client Add greuge path', () => { .accessToSection('client.card.greuge.index'); }); - it(`should click on the add greuge button`, async () => { + it(`should click on the add greuge button`, async() => { const url = await nightmare .waitToClick(selectors.clientGreuge.addGreugeFloatButton) .waitForURL('greuge/create') @@ -20,17 +20,16 @@ describe('Client Add greuge path', () => { expect(url.hash).toContain('greuge/create'); }); - it(`should receive an error if all fields are empty but date and type on submit`, async () => { + it(`should receive an error if all fields are empty but date and type on submit`, async() => { const result = await nightmare - .waitToClick(selectors.clientGreuge.typeInput) - .waitToClick(selectors.clientGreuge.typeSecondOption) + .autocompleteSearch(selectors.clientGreuge.typeAutocomplete, 'Diff') .click(selectors.clientGreuge.saveButton) .waitForLastSnackbar(); expect(result).toEqual('Some fields are invalid'); }); - it(`should create a new greuge with all its data`, async () => { + it(`should create a new greuge with all its data`, async() => { const result = await nightmare .type(selectors.clientGreuge.amountInput, 999) .waitForTextInInput(selectors.clientGreuge.amountInput, '999') @@ -41,7 +40,7 @@ describe('Client Add greuge path', () => { expect(result).toEqual('Data saved!'); }); - it('should confirm the greuge was added to the list', async () => { + it('should confirm the greuge was added to the list', async() => { const result = await nightmare .waitToGetProperty(selectors.clientGreuge.firstGreugeText, 'innerText'); 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 3cd383115..d931a4e8d 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 @@ -11,31 +11,27 @@ describe('Item Edit basic data path', () => { .accessToSection('item.card.data'); }); - it(`should edit the item basic data`, async () => { + 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') - .waitToClick(selectors.itemBasicData.typeSelect) - .waitToClick(selectors.itemBasicData.typeSelectOptionThree) - .waitToClick(selectors.itemBasicData.intrastatSelect) - .waitToClick(selectors.itemBasicData.intrastatSelectOptionOne) + .autocompleteSearch(selectors.itemBasicData.typeAutocomplete, 'Crisantemo') + .autocompleteSearch(selectors.itemBasicData.intrastatAutocomplete, 'Coral y materiales similares') .clearInput(selectors.itemBasicData.relevancyInput) .type(selectors.itemBasicData.relevancyInput, '1') - .waitToClick(selectors.itemBasicData.originSelect) - .waitToClick(selectors.itemBasicData.originSelectOptionTwo) - .waitToClick(selectors.itemBasicData.expenceSelect) - .waitToClick(selectors.itemBasicData.expenceSelectOptionThree) + .autocompleteSearch(selectors.itemBasicData.originAutocomplete, 'Spain') + .autocompleteSearch(selectors.itemBasicData.expenceAutocomplete, 'Alquiler VNH') .clearInput(selectors.itemBasicData.longNameInput) .type(selectors.itemBasicData.longNameInput, 'RS Rose of Purity') .waitToClick(selectors.itemBasicData.isActiveCheckbox) - .click(selectors.itemBasicData.submitBasicDataButton) + .waitToClick(selectors.itemBasicData.submitBasicDataButton) .waitForLastSnackbar(); expect(result).toEqual('Data saved!'); - }); + }, 15000); - it(`should confirm the item name was edited`, async () => { + it(`should confirm the item name was edited`, async() => { const result = await nightmare .click(selectors.itemNiches.nicheButton) .wait(selectors.itemNiches.firstWarehouseDisabled) @@ -45,49 +41,49 @@ describe('Item Edit basic data path', () => { expect(result).toEqual('Rose of Purity'); }); - it(`should confirm the item type was edited`, async () => { + it(`should confirm the item type was edited`, async() => { const result = await nightmare - .waitToGetProperty(selectors.itemBasicData.typeSelect, 'value'); + .waitToGetProperty(`${selectors.itemBasicData.typeAutocomplete} input`, 'value'); expect(result).toEqual('Crisantemo'); }); - it(`should confirm the item intrastad was edited`, async () => { + it(`should confirm the item intrastad was edited`, async() => { const result = await nightmare - .waitToGetProperty(selectors.itemBasicData.intrastatSelect, 'value'); + .waitToGetProperty(`${selectors.itemBasicData.intrastatAutocomplete} input`, 'value'); expect(result).toEqual('5080000 Coral y materiales similares'); }); - it(`should confirm the item relevancy was edited`, async () => { + it(`should confirm the item relevancy was edited`, async() => { const result = await nightmare .waitToGetProperty(selectors.itemBasicData.relevancyInput, 'value'); expect(result).toEqual('1'); }); - it(`should confirm the item origin was edited`, async () => { + it(`should confirm the item origin was edited`, async() => { const result = await nightmare - .waitToGetProperty(selectors.itemBasicData.originSelect, 'value'); + .waitToGetProperty(`${selectors.itemBasicData.originAutocomplete} input`, 'value'); expect(result).toEqual('Spain'); }); - it(`should confirm the item expence was edited`, async () => { + it(`should confirm the item expence was edited`, async() => { const result = await nightmare - .waitToGetProperty(selectors.itemBasicData.expenceSelect, 'value'); + .waitToGetProperty(`${selectors.itemBasicData.expenceAutocomplete} input`, 'value'); - expect(result).toEqual('Adquisición mercancia Extracomunitaria'); + expect(result).toEqual('Alquiler VNH'); }); - it(`should confirm the item long name was edited`, async () => { + it(`should confirm the item long name was edited`, async() => { const result = await nightmare .waitToGetProperty(selectors.itemBasicData.longNameInput, 'value'); expect(result).toEqual('RS Rose of Purity'); }); - it('should confirm isActive checkbox is unchecked', async () => { + it('should confirm isActive checkbox is unchecked', async() => { const result = await nightmare .evaluate(selector => { return document.querySelector(selector).checked; 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 2db067481..7fa370ebc 100644 --- a/e2e/paths/item-module/03_edit_item_tax.spec.js +++ b/e2e/paths/item-module/03_edit_item_tax.spec.js @@ -11,42 +11,38 @@ describe('Item edit tax path', () => { .accessToSection('item.card.tax'); }); - it(`should add the item tax to all countries`, async () => { + it(`should add the item tax to all countries`, async() => { const result = await nightmare - .waitToClick(selectors.itemTax.firstClassSelect) - .waitToClick(selectors.itemTax.firstClassSelectOptionTwo) - .waitToClick(selectors.itemTax.secondClassSelect) - .waitToClick(selectors.itemTax.secondClassSelectOptionOne) - .waitToClick(selectors.itemTax.thirdClassSelect) - .waitToClick(selectors.itemTax.thirdClassSelectOptionTwo) + .autocompleteSearch(selectors.itemTax.firstClassAutocomplete, 'Reduced VAT') + .autocompleteSearch(selectors.itemTax.secondClassAutocomplete, 'General VAT') + .autocompleteSearch(selectors.itemTax.thirdClassAutocomplete, 'Reduced VAT') .click(selectors.itemTax.submitTaxButton) .waitForLastSnackbar(); expect(result).toEqual('Data saved!'); }); - it(`should confirm the first item tax class was edited`, async () => { + it(`should confirm the first item tax class was edited`, async() => { const firstVatType = await nightmare .click(selectors.itemTags.tagsButton) .wait(selectors.itemTags.firstTagDisabled) .click(selectors.itemTax.taxButton) .waitToClick(selectors.itemTax.taxButton) - .waitForTextInInput(selectors.itemTax.firstClassSelect, 'reduced') - .waitToGetProperty(selectors.itemTax.firstClassSelect, 'value'); + .waitToGetProperty(`${selectors.itemTax.firstClassAutocomplete} input`, 'value'); expect(firstVatType).toEqual('Reduced VAT'); }); - it(`should confirm the second item tax class was edited`, async () => { + it(`should confirm the second item tax class was edited`, async() => { const secondVatType = await nightmare - .waitToGetProperty(selectors.itemTax.secondClassSelect, 'value'); + .waitToGetProperty(`${selectors.itemTax.secondClassAutocomplete} input`, 'value'); expect(secondVatType).toEqual('General VAT'); }); - it(`should confirm the third item tax class was edited`, async () => { + it(`should confirm the third item tax class was edited`, async() => { const thirdVatType = await nightmare - .waitToGetProperty(selectors.itemTax.thirdClassSelect, 'value'); + .waitToGetProperty(`${selectors.itemTax.thirdClassAutocomplete} input`, 'value'); expect(thirdVatType).toEqual('Reduced VAT'); }); 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 075dfd478..27a07ec27 100644 --- a/e2e/paths/item-module/04_create_item_tags.spec.js +++ b/e2e/paths/item-module/04_create_item_tags.spec.js @@ -11,12 +11,11 @@ describe('Item create tags path', () => { .accessToSection('item.card.tags'); }); - it(`should create a new tag and delete a former one`, async () => { + it(`should create a new tag and delete a former one`, async() => { const result = await nightmare .waitToClick(selectors.itemTags.firstRemoveTagButton) .waitToClick(selectors.itemTags.addItemTagButton) - .waitToClick(selectors.itemTags.seventhTagSelect) - .waitToClick(selectors.itemTags.seventhTagSelectOptionFive) + .autocompleteSearch(selectors.itemTags.seventhTagAutocomplete, 'Ancho de la base') .type(selectors.itemTags.seventhValueInput, '50') .clearInput(selectors.itemTags.seventhRelevancyInput) .type(selectors.itemTags.seventhRelevancyInput, '1') @@ -26,13 +25,13 @@ describe('Item create tags path', () => { expect(result).toEqual('Data saved!'); }); - it(`should confirm the first row data is the expected one`, async () => { + it(`should confirm the first row data is the expected one`, async() => { let result = await nightmare .click(selectors.itemBasicData.basicDataButton) .wait(selectors.itemBasicData.nameInput) .click(selectors.itemTags.tagsButton) .wait('vn-item-tags') - .waitToGetProperty(selectors.itemTags.firstTagSelect, 'value'); + .waitToGetProperty(`${selectors.itemTags.firstTagAutocomplete} input`, 'value'); expect(result).toEqual('Ancho de la base'); @@ -47,9 +46,9 @@ describe('Item create tags path', () => { expect(result).toEqual('1'); }); - it(`should confirm the second row data is the expected one`, async () => { + it(`should confirm the second row data is the expected one`, async() => { let tag = await nightmare - .waitToGetProperty(selectors.itemTags.secondTagSelect, 'value'); + .waitToGetProperty(`${selectors.itemTags.secondTagAutocomplete} input`, 'value'); let value = await nightmare .waitToGetProperty(selectors.itemTags.secondValueInput, 'value'); @@ -62,9 +61,9 @@ describe('Item create tags path', () => { expect(relevancy).toEqual('2'); }); - it(`should confirm the third row data is the expected one`, async () => { + it(`should confirm the third row data is the expected one`, async() => { let tag = await nightmare - .waitToGetProperty(selectors.itemTags.thirdTagSelect, 'value'); + .waitToGetProperty(`${selectors.itemTags.thirdTagAutocomplete} input`, 'value'); let value = await nightmare .waitToGetProperty(selectors.itemTags.thirdValueInput, 'value'); @@ -77,9 +76,9 @@ describe('Item create tags path', () => { expect(relevancy).toEqual('3'); }); - it(`should confirm the fourth row data is the expected one`, async () => { + it(`should confirm the fourth row data is the expected one`, async() => { let tag = await nightmare - .waitToGetProperty(selectors.itemTags.fourthTagSelect, 'value'); + .waitToGetProperty(`${selectors.itemTags.fourthTagAutocomplete} input`, 'value'); let value = await nightmare .waitToGetProperty(selectors.itemTags.fourthValueInput, 'value'); @@ -92,7 +91,7 @@ describe('Item create tags path', () => { expect(relevancy).toEqual('4'); }); - it(`should confirm the fifth row data is the expected one`, async () => { + it(`should confirm the fifth row data is the expected one`, async() => { let tag = await nightmare .waitToGetProperty(selectors.itemTags.fifthTagSelect, '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 a3c2b1d3d..8a1d91c5a 100644 --- a/e2e/paths/item-module/05_create_item_niche.spec.js +++ b/e2e/paths/item-module/05_create_item_niche.spec.js @@ -11,12 +11,11 @@ describe('Item create niche path', () => { .accessToSection('item.card.niche'); }); - it(`should click create a new niche and delete a former one`, async () => { + it(`should click create a new niche and delete a former one`, async() => { const result = await nightmare .waitToClick(selectors.itemNiches.addNicheButton) .waitToClick(selectors.itemNiches.secondNicheRemoveButton) - .waitToClick(selectors.itemNiches.thirdWarehouseSelect) - .waitToClick(selectors.itemNiches.thirdWarehouseSelectFourthOption) + .autocompleteSearch(selectors.itemNiches.thirdWarehouseAutocomplete, 'Warehouse Two') .type(selectors.itemNiches.thirdCodeInput, 'A4') .click(selectors.itemNiches.submitNichesButton) .waitForLastSnackbar(); @@ -24,13 +23,13 @@ describe('Item create niche path', () => { expect(result).toEqual('Data saved!'); }); - it(`should confirm the first niche is the expected one`, async () => { + it(`should confirm the first niche is the expected one`, async() => { let result = await nightmare .click(selectors.itemBasicData.basicDataButton) .wait(selectors.itemBasicData.nameInput) .click(selectors.itemNiches.nicheButton) - .waitForTextInInput(selectors.itemNiches.firstWarehouseSelect, 'Warehouse One') - .waitToGetProperty(selectors.itemNiches.firstWarehouseSelect, 'value'); + .waitForTextInInput(`${selectors.itemNiches.firstWarehouseAutocomplete}`, 'Warehouse One') + .waitToGetProperty(`${selectors.itemNiches.firstWarehouseAutocomplete}`, 'value'); expect(result).toEqual('Warehouse One'); result = await nightmare @@ -39,7 +38,7 @@ describe('Item create niche path', () => { expect(result).toEqual('A1'); }); - it(`should confirm the second niche is the expected one`, async () => { + it(`should confirm the second niche is the expected one`, async() => { let result = await nightmare .waitToGetProperty(selectors.itemNiches.secondWarehouseSelect, 'value'); @@ -51,9 +50,9 @@ describe('Item create niche path', () => { expect(result).toEqual('A3'); }); - it(`should confirm the third niche is the expected one`, async () => { + it(`should confirm the third niche is the expected one`, async() => { let result = await nightmare - .waitToGetProperty(selectors.itemNiches.thirdWarehouseSelect, 'value'); + .waitToGetProperty(`${selectors.itemNiches.thirdWarehouseAutocomplete} input`, 'value'); expect(result).toEqual('Warehouse Two'); result = await nightmare 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 d52c877d4..a7f91a8d8 100644 --- a/e2e/paths/item-module/06_create_item_botanical.spec.js +++ b/e2e/paths/item-module/06_create_item_botanical.spec.js @@ -11,21 +11,19 @@ describe('Item Create botanical path', () => { .accessToSection('item.card.botanical'); }); - it(`should create a new botanical for the item Mjolnir`, async () => { + it(`should create a new botanical for the item Mjolnir`, async() => { const result = await nightmare .wait(selectors.itemBotanical.botanicalInput) .type(selectors.itemBotanical.botanicalInput, 'Cicuta maculata') - .waitToClick(selectors.itemBotanical.genusSelect) - .waitToClick(selectors.itemBotanical.genusSelectOptionOne) - .waitToClick(selectors.itemBotanical.speciesSelect) - .waitToClick(selectors.itemBotanical.speciesSelectOptionOne) + .autocompleteSearch(selectors.itemBotanical.genusAutocomplete, 'Abelia') + .autocompleteSearch(selectors.itemBotanical.speciesAutocomplete, 'dealbata') .waitToClick(selectors.itemBotanical.submitBotanicalButton) .waitForLastSnackbar(); expect(result).toEqual('Data saved!'); }); - it(`should confirm the botanical for item Mjolnir was created`, async () => { + it(`should confirm the botanical for item Mjolnir was created`, async() => { const result = await nightmare .click(selectors.itemBasicData.basicDataButton) .wait(selectors.itemBasicData.nameInput) @@ -36,36 +34,34 @@ describe('Item Create botanical path', () => { expect(result).toEqual('Cicuta maculata'); }); - it(`should confirm the Genus for item Mjolnir was created`, async () => { + it(`should confirm the Genus for item Mjolnir was created`, async() => { const result = await nightmare - .waitForTextInInput(selectors.itemBotanical.genusSelect, 'Abelia') - .waitToGetProperty(selectors.itemBotanical.genusSelect, 'value'); + .waitForTextInInput(`${selectors.itemBotanical.genusAutocomplete} input`, 'Abelia') + .waitToGetProperty(`${selectors.itemBotanical.genusAutocomplete} input`, 'value'); expect(result).toEqual('Abelia'); }); - it(`should confirm the Species for item Mjolnir was created`, async () => { + it(`should confirm the Species for item Mjolnir was created`, async() => { const result = await nightmare - .waitToGetProperty(selectors.itemBotanical.speciesSelect, 'value'); + .waitToGetProperty(`${selectors.itemBotanical.speciesAutocomplete} input`, 'value'); expect(result).toEqual('dealbata'); }); - it(`should edit botanical for the item Mjolnir`, async () => { + it(`should edit botanical for the item Mjolnir`, async() => { const result = await nightmare .clearInput(selectors.itemBotanical.botanicalInput) .type(selectors.itemBotanical.botanicalInput, 'Herp Derp') - .waitToClick(selectors.itemBotanical.genusSelect) - .waitToClick(selectors.itemBotanical.genusSelectOptionTwo) - .waitToClick(selectors.itemBotanical.speciesSelect) - .waitToClick(selectors.itemBotanical.speciesSelectOptionTwo) + .autocompleteSearch(selectors.itemBotanical.genusAutocomplete, 'Abies') + .autocompleteSearch(selectors.itemBotanical.speciesAutocomplete, 'decurrens') .waitToClick(selectors.itemBotanical.submitBotanicalButton) .waitForLastSnackbar(); expect(result).toEqual('Data saved!'); }); - it(`should confirm the botanical for item Mjolnir was edited`, async () => { + it(`should confirm the botanical for item Mjolnir was edited`, async() => { const result = await nightmare .click(selectors.itemBasicData.basicDataButton) .wait(selectors.itemBasicData.nameInput) @@ -76,17 +72,17 @@ describe('Item Create botanical path', () => { expect(result).toEqual('Herp Derp'); }); - it(`should confirm the Genus for item Mjolnir was edited`, async () => { + it(`should confirm the Genus for item Mjolnir was edited`, async() => { const result = await nightmare - .waitForTextInInput(selectors.itemBotanical.genusSelect, 'Abies') - .waitToGetProperty(selectors.itemBotanical.genusSelect, 'value'); + .waitForTextInInput(`${selectors.itemBotanical.genusAutocomplete} input`, 'Abies') + .waitToGetProperty(`${selectors.itemBotanical.genusAutocomplete} input`, 'value'); expect(result).toEqual('Abies'); }); - it(`should confirm the Species for item Mjolnir was edited`, async () => { + it(`should confirm the Species for item Mjolnir was edited`, async() => { const result = await nightmare - .waitToGetProperty(selectors.itemBotanical.speciesSelect, 'value'); + .waitToGetProperty(`${selectors.itemBotanical.speciesAutocomplete} input`, 'value'); expect(result).toEqual('decurrens'); }); 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 31a31b52e..2d82c16d8 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 @@ -9,7 +9,7 @@ describe('Item Create/Clone path', () => { .loginAndModule('buyer', 'item'); }); - it(`should search for the item Infinity Gauntlet to confirm it isn't created yet`, async () => { + it(`should search for the item Infinity Gauntlet to confirm it isn't created yet`, async() => { const result = await nightmare .wait(selectors.itemsIndex.searchItemInput) .type(selectors.itemsIndex.searchItemInput, 'Infinity Gauntlet') @@ -20,7 +20,7 @@ describe('Item Create/Clone path', () => { expect(result).toEqual(0); }); - it('should access to the create item view by clicking the create floating button', async () => { + it('should access to the create item view by clicking the create floating button', async() => { const url = await nightmare .click(selectors.itemsIndex.createItemButton) .wait(selectors.itemCreateView.createButton) @@ -29,7 +29,7 @@ describe('Item Create/Clone path', () => { expect(url.hash).toEqual('#!/item/create'); }); - it('should return to the item index by clickig the cancel button', async () => { + it('should return to the item index by clickig the cancel button', async() => { const url = await nightmare .click(selectors.itemCreateView.cancelButton) .wait(selectors.itemsIndex.createItemButton) @@ -38,7 +38,7 @@ describe('Item Create/Clone path', () => { expect(url.hash).toEqual('#!/item/index'); }); - it('should now access to the create item view by clicking the create floating button', async () => { + it('should now access to the create item view by clicking the create floating button', async() => { const url = await nightmare .click(selectors.itemsIndex.createItemButton) .wait(selectors.itemCreateView.createButton) @@ -47,22 +47,19 @@ describe('Item Create/Clone path', () => { expect(url.hash).toEqual('#!/item/create'); }); - it('should create the Infinity Gauntlet item', async () => { + it('should create the Infinity Gauntlet item', async() => { const result = await nightmare .type(selectors.itemCreateView.name, 'Infinity Gauntlet') - .waitToClick(selectors.itemCreateView.typeSelect) - .waitToClick(selectors.itemCreateView.typeSelectOptionThree) - .waitToClick(selectors.itemCreateView.intrastatSelect) - .waitToClick(selectors.itemCreateView.intrastatSelectOptionOne) - .waitToClick(selectors.itemCreateView.originSelect) - .waitToClick(selectors.itemCreateView.originSelectOptionOne) + .autocompleteSearch(selectors.itemCreateView.typeAutocomplete, 'Crisantemo') + .autocompleteSearch(selectors.itemCreateView.intrastatAutocomplete, 'Coral y materiales similares') + .autocompleteSearch(selectors.itemCreateView.originAutocomplete, 'Holand') .click(selectors.itemCreateView.createButton) .waitForLastSnackbar(); expect(result).toEqual('Data saved!'); }); - it('should confirm Infinity Gauntlet item was created', async () => { + it('should confirm Infinity Gauntlet item was created', async() => { let result = await nightmare .waitToGetProperty(selectors.itemBasicData.nameInput, 'value'); @@ -70,24 +67,24 @@ describe('Item Create/Clone path', () => { result = await nightmare - .waitToGetProperty(selectors.itemBasicData.typeSelect, 'value'); + .waitToGetProperty(`${selectors.itemBasicData.typeAutocomplete} input`, 'value'); expect(result).toEqual('Crisantemo'); result = await nightmare - .waitToGetProperty(selectors.itemBasicData.intrastatSelect, 'value'); + .waitToGetProperty(`${selectors.itemBasicData.intrastatAutocomplete} input`, 'value'); - expect(result).toEqual('6021010 Plantas vivas: Esqueje/injerto, Vid'); + expect(result).toEqual('5080000 Coral y materiales similares'); result = await nightmare - .waitToGetProperty(selectors.itemBasicData.originSelect, 'value'); + .waitToGetProperty(`${selectors.itemBasicData.originAutocomplete} input`, 'value'); - expect(result).toEqual('Spain'); + expect(result).toEqual('Holand'); }); }); describe('clone', () => { - it('should return to the items index by clicking the return to items button', async () => { + it('should return to the items index by clicking the return to items button', async() => { const url = await nightmare .click(selectors.itemBasicData.goToItemIndexButton) .wait(selectors.itemsIndex.createItemButton) @@ -97,7 +94,7 @@ describe('Item Create/Clone path', () => { expect(url.hash).toContain('#!/item/index'); }); - it(`should search for the item Infinity Gauntlet`, async () => { + it(`should search for the item Infinity Gauntlet`, async() => { const result = await nightmare .wait(selectors.itemsIndex.searchItemInput) .type(selectors.itemsIndex.searchItemInput, 'Infinity Gauntlet') @@ -108,7 +105,7 @@ describe('Item Create/Clone path', () => { expect(result).toEqual(1); }); - it(`should clone the Infinity Gauntlet`, async () => { + it(`should clone the Infinity Gauntlet`, async() => { const url = await nightmare .waitForTextInElement(selectors.itemsIndex.searchResult, 'Infinity Gauntlet') .click(selectors.itemsIndex.searchResultCloneButton) @@ -119,7 +116,7 @@ describe('Item Create/Clone path', () => { expect(url.hash).toContain('tags'); }); - it('should search for the item Infinity Gauntlet and find two', async () => { + it('should search for the item Infinity Gauntlet and find two', async() => { const result = await nightmare .waitToClick(selectors.itemTags.goToItemIndexButton) .wait(selectors.itemsIndex.searchItemInput) diff --git a/e2e/paths/item-module/09_regularize_item.spec.js b/e2e/paths/item-module/09_regularize_item.spec.js index 933572495..68a59009d 100644 --- a/e2e/paths/item-module/09_regularize_item.spec.js +++ b/e2e/paths/item-module/09_regularize_item.spec.js @@ -8,7 +8,7 @@ describe('Item regularize path', () => { .loginAndModule('employee', 'item'); }); - it('should search for the item Mjolnir', async () => { + it('should search for the item Mjolnir', async() => { const resultCount = await nightmare .wait(selectors.itemsIndex.searchItemInput) .type(selectors.itemsIndex.searchItemInput, 'Mjolnir') @@ -19,7 +19,7 @@ describe('Item regularize path', () => { expect(resultCount).toEqual(1); }); - it(`should click on the search result to access to the item tax`, async () => { + it(`should click on the search result to access to the item tax`, async() => { const url = await nightmare .waitForTextInElement(selectors.itemsIndex.searchResult, 'Mjolnir') .waitToClick(selectors.itemsIndex.searchResult) @@ -29,21 +29,20 @@ describe('Item regularize path', () => { expect(url.hash).toContain('/summary'); }); - it('should regularize the item', async () => { + it('should regularize the item', async() => { const result = await nightmare .waitToClick(selectors.itemDescriptor.moreMenu) .waitToClick(selectors.itemDescriptor.moreMenuRegularizeButton) .wait(selectors.itemDescriptor.regularizeQuantityInput) .type(selectors.itemDescriptor.regularizeQuantityInput, 100) - .waitToClick(selectors.itemDescriptor.regularizeWarehouseSelect) - .waitToClick(selectors.itemDescriptor.regularizeWarehouseSelectSecondOption) + .autocompleteSearch(selectors.itemDescriptor.regularizeWarehouseAutocomplete, 'Warehouse One') .waitToClick(selectors.itemDescriptor.regularizeSaveButton) .waitForLastSnackbar(); expect(result).toEqual('Data saved!'); }); - it('should click on the Tickets button of the top bar menu', async () => { + it('should click on the Tickets button of the top bar menu', async() => { const url = await nightmare .waitToClick(selectors.globalItems.applicationsMenuButton) .wait(selectors.globalItems.applicationsMenuVisible) @@ -54,7 +53,7 @@ describe('Item regularize path', () => { expect(url.hash).toEqual('#!/ticket/index'); }); - it('should search for the ticket with alias missing', async () => { + it('should search for the ticket with alias missing', async() => { const result = await nightmare .wait(selectors.ticketsIndex.searchTicketInput) .type(selectors.ticketsIndex.searchTicketInput, 'missing') @@ -65,7 +64,7 @@ describe('Item regularize path', () => { expect(result).toEqual(1); }); - it(`should click on the search result to access to the ticket summary`, async () => { + it(`should click on the search result to access to the ticket summary`, async() => { const url = await nightmare .waitForTextInElement(selectors.ticketsIndex.searchResult, 'Missing') .waitToClick(selectors.ticketsIndex.searchResult) @@ -75,7 +74,7 @@ describe('Item regularize path', () => { expect(url.hash).toContain('/summary'); }); - it(`should check the ticket sale quantity is showing a negative value`, async () => { + it(`should check the ticket sale quantity is showing a negative value`, async() => { const result = await nightmare .waitForTextInElement(selectors.ticketSummary.firstSaleQuantity, '-100') .waitToGetProperty(selectors.ticketSummary.firstSaleQuantity, 'innerText'); @@ -83,14 +82,14 @@ describe('Item regularize path', () => { expect(result).toContain('-100'); }); - it(`should check the ticket sale discount is 100%`, async () => { + it(`should check the ticket sale discount is 100%`, async() => { const result = await nightmare .waitToGetProperty(selectors.ticketSummary.firstSaleDiscount, 'innerText'); expect(result).toContain('100 %'); }); - it('should now click on the Items button of the top bar menu', async () => { + it('should now click on the Items button of the top bar menu', async() => { const url = await nightmare .waitToClick(selectors.globalItems.applicationsMenuButton) .wait(selectors.globalItems.applicationsMenuVisible) @@ -101,7 +100,7 @@ describe('Item regularize path', () => { expect(url.hash).toEqual('#!/item/index'); }); - it('should search for the item Mjolnir once again', async () => { + it('should search for the item Mjolnir once again', async() => { const resultCount = await nightmare .wait(selectors.itemsIndex.searchItemInput) .type(selectors.itemsIndex.searchItemInput, 'Mjolnir') @@ -112,7 +111,7 @@ describe('Item regularize path', () => { expect(resultCount).toEqual(1); }); - it(`should click on the search result to access to the item tax`, async () => { + it(`should click on the search result to access to the item tax`, async() => { const url = await nightmare .waitForTextInElement(selectors.itemsIndex.searchResult, 'Mjolnir') .waitToClick(selectors.itemsIndex.searchResult) @@ -122,21 +121,20 @@ describe('Item regularize path', () => { expect(url.hash).toContain('/summary'); }); - it('should regularize the item once more', async () => { + it('should regularize the item once more', async() => { const result = await nightmare .waitToClick(selectors.itemDescriptor.moreMenu) .waitToClick(selectors.itemDescriptor.moreMenuRegularizeButton) .wait(selectors.itemDescriptor.regularizeQuantityInput) .type(selectors.itemDescriptor.regularizeQuantityInput, 100) - .waitToClick(selectors.itemDescriptor.regularizeWarehouseSelect) - .waitToClick(selectors.itemDescriptor.regularizeWarehouseSelectSecondOption) + .autocompleteSearch(selectors.itemDescriptor.regularizeWarehouseAutocomplete, 'Warehouse One') .waitToClick(selectors.itemDescriptor.regularizeSaveButton) .waitForLastSnackbar(); expect(result).toEqual('Data saved!'); }); - it('should again click on the Tickets button of the top bar menu', async () => { + it('should again click on the Tickets button of the top bar menu', async() => { const url = await nightmare .waitToClick(selectors.globalItems.applicationsMenuButton) .wait(selectors.globalItems.applicationsMenuVisible) @@ -147,7 +145,7 @@ describe('Item regularize path', () => { expect(url.hash).toEqual('#!/ticket/index'); }); - it('should search for the ticket with id 22 once again', async () => { + it('should search for the ticket with id 22 once again', async() => { const result = await nightmare .wait(selectors.ticketsIndex.searchTicketInput) .type(selectors.ticketsIndex.searchTicketInput, 'id:22') @@ -158,7 +156,7 @@ describe('Item regularize path', () => { expect(result).toEqual(1); }); - it(`should now click on the search result to access to the ticket summary`, async () => { + it(`should now click on the search result to access to the ticket summary`, async() => { const url = await nightmare .waitForTextInElement(selectors.ticketsIndex.searchResult, '22') .waitToClick(selectors.ticketsIndex.searchResult) @@ -168,7 +166,7 @@ describe('Item regularize path', () => { expect(url.hash).toContain('/summary'); }); - it(`should check the ticket contains now two sales`, async () => { + it(`should check the ticket contains now two sales`, async() => { const result = await nightmare .waitForTextInElement(selectors.ticketSummary.firstSaleQuantity, '-100') .countElement(selectors.ticketSummary.sale); 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 0a5a2b4ce..0beded970 100644 --- a/e2e/paths/ticket-module/01_create_ticket_observations.spec.js +++ b/e2e/paths/ticket-module/01_create_ticket_observations.spec.js @@ -11,12 +11,11 @@ describe('Ticket Create notes path', () => { .accessToSection('ticket.card.observation'); }); - it(`should click create a new note and delete a former one`, async () => { + it(`should click create a new note and delete a former one`, async() => { let result = await nightmare .waitToClick(selectors.ticketNotes.firstNoteRemoveButton) .waitToClick(selectors.ticketNotes.addNoteButton) - .waitToClick(selectors.ticketNotes.firstNoteSelect) - .waitToClick(selectors.ticketNotes.firstNoteSelectSecondOption) + .autocompleteSearch(selectors.ticketNotes.firstNoteTypeAutocomplete, 'observation one') .type(selectors.ticketNotes.firstDescriptionInput, 'description') .click(selectors.ticketNotes.submitNotesButton) .waitForLastSnackbar(); @@ -24,14 +23,14 @@ describe('Ticket Create notes path', () => { expect(result).toEqual('Data saved!'); }); - it(`should confirm the note is the expected one`, async () => { - let firstNoteSelect = await nightmare + it(`should confirm the note is the expected one`, async() => { + let result = await nightmare .click(selectors.ticketPackages.packagesButton) - .wait(selectors.ticketPackages.firstPackageSelect) + .wait(selectors.ticketPackages.firstPackageAutocomplete) .click(selectors.ticketNotes.notesButton) - .waitToGetProperty(selectors.ticketNotes.firstNoteSelect, 'value'); + .waitToGetProperty(`${selectors.ticketNotes.firstNoteTypeAutocomplete} input`, 'value'); - expect(firstNoteSelect).toEqual('observation one'); + expect(result).toEqual('observation one'); let firstDescription = await nightmare .waitToGetProperty(selectors.ticketNotes.firstDescriptionInput, 'value'); diff --git a/e2e/paths/ticket-module/02_delete_ticket_expeditions.spec.js b/e2e/paths/ticket-module/02_delete_ticket_expeditions.spec.js index 2d589ea9a..087613b3f 100644 --- a/e2e/paths/ticket-module/02_delete_ticket_expeditions.spec.js +++ b/e2e/paths/ticket-module/02_delete_ticket_expeditions.spec.js @@ -11,12 +11,12 @@ describe('Ticket Delete expeditions path', () => { .accessToSection('ticket.card.expedition'); }); - it(`should delete a former expedition and confirm the remaining expedition are the expected ones`, async () => { + it(`should delete a former expedition and confirm the remaining expedition are the expected ones`, async() => { const result = await nightmare .waitToClick(selectors.ticketExpedition.secondExpeditionRemoveButton) .waitToClick(selectors.ticketExpedition.acceptDeleteRowButton) .click(selectors.ticketPackages.packagesButton) - .wait(selectors.ticketPackages.firstPackageSelect) + .wait(selectors.ticketPackages.firstPackageAutocomplete) .click(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 1f514fb3a..b9bd82453 100644 --- a/e2e/paths/ticket-module/04_create_ticket_packages.spec.js +++ b/e2e/paths/ticket-module/04_create_ticket_packages.spec.js @@ -11,19 +11,18 @@ describe('Ticket Create packages path', () => { .accessToSection('ticket.card.package.index'); }); - it(`should delete the first package and receive and error to save a new one with blank quantity`, async () => { + it(`should delete the first package and receive and error to save a new one with blank quantity`, async() => { const result = await nightmare .waitToClick(selectors.ticketPackages.firstRemovePackageButton) .waitToClick(selectors.ticketPackages.addPackageButton) - .waitToClick(selectors.ticketPackages.firstPackageSelect) - .waitToClick(selectors.ticketPackages.firstPackageSelectOptionTwo) + .autocompleteSearch(selectors.ticketPackages.firstPackageAutocomplete, 'Legendary Box') .click(selectors.ticketPackages.savePackagesButton) .waitForLastSnackbar(); expect(result).toEqual('Some fields are invalid'); }); - it(`should attempt create a new package but receive an error if quantity is a string`, async () => { + 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') .click(selectors.ticketPackages.savePackagesButton) @@ -32,7 +31,7 @@ describe('Ticket Create packages path', () => { expect(result).toEqual('Some fields are invalid'); }); - it(`should attempt create a new package but receive an error if quantity is 0`, async () => { + 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) @@ -42,7 +41,7 @@ describe('Ticket Create packages path', () => { expect(result).toEqual('Some fields are invalid'); }); - it(`should attempt create a new package but receive an error if package is blank`, async () => { + 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) @@ -53,29 +52,27 @@ describe('Ticket Create packages path', () => { expect(result).toEqual('Package cannot be blank'); }); - it(`should create a new package with correct data`, async () => { + it(`should create a new package with correct data`, async() => { const result = await nightmare - .waitToClick(selectors.ticketPackages.firstPackageSelect) - .waitToClick(selectors.ticketPackages.firstPackageSelectOptionTwo) - .waitForTextInInput(selectors.ticketPackages.firstPackageSelect, 'Legendary Box') + .autocompleteSearch(selectors.ticketPackages.firstPackageAutocomplete, 'Legendary Box') .click(selectors.ticketPackages.savePackagesButton) .waitForLastSnackbar(); expect(result).toEqual('Data saved!'); }); - it(`should confirm the first select is the expected one`, async () => { + it(`should confirm the first select is the expected one`, async() => { const result = await nightmare - .click(selectors.ticketSales.saleButton) - .wait(selectors.ticketSales.firstPackageSelect) - .click(selectors.ticketPackages.packagesButton) - .waitForTextInInput(selectors.ticketPackages.firstPackageSelect, 'Legendary Box') - .waitToGetProperty(selectors.ticketPackages.firstPackageSelect, 'value'); + .waitToClick(selectors.ticketSales.saleButton) + .wait(selectors.ticketSales.firstPackageAutocomplete) + .waitToClick(selectors.ticketPackages.packagesButton) + .waitForTextInInput(`${selectors.ticketPackages.firstPackageAutocomplete} input`, 'Legendary Box') + .waitToGetProperty(`${selectors.ticketPackages.firstPackageAutocomplete} input`, 'value'); expect(result).toEqual('7 : Legendary Box'); }); - it(`should confirm the first quantity is the expected one`, async () => { + it(`should confirm the first quantity is the expected one`, async() => { const result = await nightmare .waitForTextInInput(selectors.ticketPackages.firstQuantityInput, '99') .waitToGetProperty(selectors.ticketPackages.firstQuantityInput, 'value'); diff --git a/e2e/paths/ticket-module/07_edit_sale.spec.js b/e2e/paths/ticket-module/07_edit_sale.spec.js index a0806994b..f75ffc885 100644 --- a/e2e/paths/ticket-module/07_edit_sale.spec.js +++ b/e2e/paths/ticket-module/07_edit_sale.spec.js @@ -11,17 +11,17 @@ describe('Ticket Edit sale path', () => { .accessToSection('ticket.card.sale'); }); - it(`should click on the first claim id to navigate over there`, async () => { + it(`should click on the first claim id to navigate over there`, async() => { const url = await nightmare .waitToClick(selectors.ticketSales.secondSaleClaimId) - .wait(selectors.claimBasicData.claimStateSelect) + .wait(selectors.claimBasicData.claimStateAutocomplete) .parsedUrl(); expect(url.hash).toEqual('#!/claim/2/basic-data'); }); - it('should now click on the Tickets button of the top bar menu', async () => { + it('should now click on the Tickets button of the top bar menu', async() => { const url = await nightmare .waitToClick(selectors.globalItems.applicationsMenuButton) .wait(selectors.globalItems.applicationsMenuVisible) @@ -32,7 +32,7 @@ describe('Ticket Edit sale path', () => { expect(url.hash).toEqual('#!/ticket/index'); }); - it('should again search for a specific ticket', async () => { + it('should again search for a specific ticket', async() => { const result = await nightmare .wait(selectors.ticketsIndex.searchTicketInput) .type(selectors.ticketsIndex.searchTicketInput, 'id:16') @@ -43,7 +43,7 @@ describe('Ticket Edit sale path', () => { expect(result).toEqual(1); }); - it(`should now click on the search result to access to the ticket Sale`, async () => { + it(`should now click on the search result to access to the ticket Sale`, async() => { const url = await nightmare .waitForTextInElement(selectors.ticketsIndex.searchResult, 'address 21') .waitToClick(selectors.ticketsIndex.searchResult) @@ -54,14 +54,14 @@ describe('Ticket Edit sale path', () => { expect(url.hash).toContain('/sale'); }); - it(`should check the zoomed image isnt present`, async () => { + it(`should check the zoomed image isnt present`, async() => { const result = await nightmare .countElement(selectors.ticketSales.firstSaleZoomedImage); expect(result).toEqual(0); }); - it(`should click on the thumbnail image of the 1st sale and see the zoomed image`, async () => { + it(`should click on the thumbnail image of the 1st sale and see the zoomed image`, async() => { const result = await nightmare .waitToClick(selectors.ticketSales.firstSaleThumbnailImage) .countElement(selectors.ticketSales.firstSaleZoomedImage); @@ -69,7 +69,7 @@ describe('Ticket Edit sale path', () => { expect(result).toEqual(1); }); - it(`should click on the zoomed image to close it`, async () => { + it(`should click on the zoomed image to close it`, async() => { const result = await nightmare .waitToClick(selectors.ticketSales.firstSaleZoomedImage) .countElement(selectors.ticketSales.firstSaleZoomedImage); @@ -77,14 +77,14 @@ describe('Ticket Edit sale path', () => { expect(result).toEqual(0); }); - it(`should confirm the item descriptor insnt visible yet`, async () => { + it(`should confirm the item descriptor insnt visible yet`, async() => { const visible = await nightmare .isVisible(selectors.ticketSales.saleDescriptorPopover); expect(visible).toBeFalsy(); }); - it(`should click on the first sale ID making the item descriptor visible`, async () => { + it(`should click on the first sale ID making the item descriptor visible`, async() => { const visible = await nightmare .waitToClick(selectors.ticketSales.firstSaleID) .wait(1000) @@ -93,7 +93,7 @@ describe('Ticket Edit sale path', () => { expect(visible).toBeTruthy(); }); - it(`should click on the descriptor image of the 1st sale and see the zoomed image`, async () => { + it(`should click on the descriptor image of the 1st sale and see the zoomed image`, async() => { const result = await nightmare .waitToClick('vn-item-descriptor img') .countElement(selectors.ticketSales.firstSaleZoomedImage); @@ -101,7 +101,7 @@ describe('Ticket Edit sale path', () => { expect(result).toEqual(1); }); - it(`should click on the zoomed image to close it`, async () => { + it(`should click on the zoomed image to close it`, async() => { const result = await nightmare .waitToClick(selectors.ticketSales.firstSaleZoomedImage) .countElement(selectors.ticketSales.firstSaleZoomedImage); @@ -109,7 +109,7 @@ describe('Ticket Edit sale path', () => { expect(result).toEqual(0); }); - it(`should click on the summary icon of the item-descriptor to access to the item summary`, async () => { + it(`should click on the summary icon of the item-descriptor to access to the item summary`, async() => { const url = await nightmare .waitToClick(selectors.ticketSales.saleDescriptorPopoverSummaryButton) .waitForURL('/summary') @@ -118,7 +118,7 @@ describe('Ticket Edit sale path', () => { expect(url.hash).toContain('/summary'); }); - it('should return to ticket sales section', async () => { + it('should return to ticket sales section', async() => { const url = await nightmare .waitToClick(selectors.globalItems.applicationsMenuButton) .wait(selectors.globalItems.applicationsMenuVisible) @@ -136,7 +136,7 @@ describe('Ticket Edit sale path', () => { expect(url.hash).toContain('/sale'); }); - it('should try to add a higher quantity value and then receive an error', async () => { + 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') @@ -145,7 +145,7 @@ describe('Ticket Edit sale path', () => { expect(result).toEqual('The new quantity should be smaller than the old one'); }); - it('should remove 1 from quantity', async () => { + it('should remove 1 from quantity', async() => { const result = await nightmare .waitToClick(selectors.ticketSales.firstSaleQuantityClearInput) .type(selectors.ticketSales.firstSaleQuantity, '4\u000d') @@ -154,7 +154,7 @@ describe('Ticket Edit sale path', () => { expect(result).toEqual('Data saved!'); }); - it('should update the price', async () => { + it('should update the price', async() => { const result = await nightmare .waitToClick(selectors.ticketSales.firstSalePrice) .wait(selectors.ticketSales.firstSalePriceInput) @@ -165,21 +165,21 @@ describe('Ticket Edit sale path', () => { expect(result).toEqual('Data saved!'); }); - it('should confirm the price have been updated', async () => { + it('should confirm the price have been updated', async() => { const result = await nightmare .waitToGetProperty(selectors.ticketSales.firstSalePrice, 'innerText'); expect(result).toContain('5.00'); }); - it('should confirm the total price for that item have been updated', async () => { + it('should confirm the total price for that item have been updated', async() => { const result = await nightmare .waitToGetProperty(selectors.ticketSales.firstSaleImport, 'innerText'); expect(result).toContain('20.00'); }); - it('should update the discount', async () => { + it('should update the discount', async() => { 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 @@ -190,7 +190,7 @@ describe('Ticket Edit sale path', () => { expect(result).toEqual('Data saved!'); }); - it('should confirm the discount have been updated', async () => { + it('should confirm the discount have been updated', async() => { const result = await nightmare .waitForTextInElement(selectors.ticketSales.firstSaleDiscount, '50 %') .waitToGetProperty(selectors.ticketSales.firstSaleDiscount, 'innerText'); @@ -198,7 +198,7 @@ describe('Ticket Edit sale path', () => { expect(result).toContain('50 %'); }); - it('should confirm the total import for that item have been updated', async () => { + it('should confirm the total import for that item have been updated', async() => { const result = await nightmare .waitForTextInElement(selectors.ticketSales.firstSaleImport, '10.00') .waitToGetProperty(selectors.ticketSales.firstSaleImport, 'innerText'); @@ -206,18 +206,18 @@ describe('Ticket Edit sale path', () => { expect(result).toContain('10.00'); }); - it('should select the third sale and create a claim of it', async () => { + it('should select the third sale and create a claim of it', async() => { const url = await nightmare .waitToClick(selectors.ticketSales.thirdSaleCheckbox) .waitToClick(selectors.ticketSales.moreMenuButton) .waitToClick(selectors.ticketSales.moreMenuCreateClaim) - .wait(selectors.claimBasicData.claimStateSelect) + .wait(selectors.claimBasicData.claimStateAutocomplete) .parsedUrl(); expect(url.hash).toEqual('#!/claim/4/basic-data'); }); - it('should click on the Claims button of the top bar menu', async () => { + it('should click on the Claims button of the top bar menu', async() => { const url = await nightmare .waitToClick(selectors.globalItems.applicationsMenuButton) .wait(selectors.globalItems.applicationsMenuVisible) @@ -228,7 +228,7 @@ describe('Ticket Edit sale path', () => { expect(url.hash).toEqual('#!/claim/index'); }); - it('should search for the claim with id 4', async () => { + it('should search for the claim with id 4', async() => { const result = await nightmare .wait(selectors.claimsIndex.searchResult) .type(selectors.claimsIndex.searchClaimInput, 4) @@ -239,7 +239,7 @@ describe('Ticket Edit sale path', () => { expect(result).toEqual(1); }); - it('should click the Tickets button of the top bar menu', async () => { + it('should click the Tickets button of the top bar menu', async() => { const url = await nightmare .waitToClick(selectors.globalItems.applicationsMenuButton) .wait(selectors.globalItems.applicationsMenuVisible) @@ -250,7 +250,7 @@ describe('Ticket Edit sale path', () => { expect(url.hash).toEqual('#!/ticket/index'); }); - it('should search the ticket', async () => { + it('should search the ticket', async() => { const result = await nightmare .wait(selectors.ticketsIndex.searchTicketInput) .type(selectors.ticketsIndex.searchTicketInput, 'id:16') @@ -261,7 +261,7 @@ describe('Ticket Edit sale path', () => { expect(result).toEqual(1); }); - it(`should click on the result to access to the ticket Sale`, async () => { + it(`should click on the result to access to the ticket Sale`, async() => { const url = await nightmare .waitForTextInElement(selectors.ticketsIndex.searchResult, 'address 21') .waitToClick(selectors.ticketsIndex.searchResult) @@ -272,7 +272,7 @@ describe('Ticket Edit sale path', () => { expect(url.hash).toContain('/sale'); }); - it('should select the third sale and delete it', async () => { + it('should select the third sale and delete it', async() => { const result = await nightmare .waitToClick(selectors.ticketSales.thirdSaleCheckbox) .waitToClick(selectors.ticketSales.deleteSaleButton) @@ -282,14 +282,14 @@ describe('Ticket Edit sale path', () => { expect(result).toEqual('Data saved!'); }); - it(`should confirm the third sale was deleted`, async () => { + it(`should confirm the third sale was deleted`, async() => { const result = await nightmare .countElement(selectors.ticketSales.saleLine); expect(result).toEqual(3); }); - it('should select the third sale and attempt to send it to a frozen client ticket', async () => { + it('should select the third sale and attempt to send it to a frozen client ticket', async() => { const result = await nightmare .waitToClick(selectors.ticketSales.thirdSaleCheckbox) .waitToClick(selectors.ticketSales.transferSaleButton) @@ -301,7 +301,7 @@ describe('Ticket Edit sale path', () => { expect(result).toEqual(`The sales of this ticket can't be modified`); }); - it('should transfer the sale to a valid ticket', async () => { + it('should transfer the sale to a valid ticket', async() => { const result = await nightmare .waitToClick(selectors.ticketSales.moveToTicketInputClearButton) .type(selectors.ticketSales.moveToTicketInput, 12) @@ -312,7 +312,7 @@ describe('Ticket Edit sale path', () => { expect(result.hash).toContain(`ticket/12/sale`); }); - it('should confirm the transfered line is the correct one', async () => { + it('should confirm the transfered line is the correct one', async() => { const result = await nightmare .wait(selectors.ticketSales.firstSaleText) .waitToGetProperty(selectors.ticketSales.firstSaleText, 'innerText'); @@ -320,7 +320,7 @@ describe('Ticket Edit sale path', () => { expect(result).toContain(`Mark I`); }); - it('should go back to the original ticket sales section', async () => { + it('should go back to the original ticket sales section', async() => { const url = await nightmare .waitToClick(selectors.itemsIndex.goBackToModuleIndexButton) .wait(selectors.ticketsIndex.searchTicketInput) @@ -336,7 +336,7 @@ describe('Ticket Edit sale path', () => { expect(url.hash).toContain('/sale'); }); - it(`should confirm the original ticket has only two lines now`, async () => { + it(`should confirm the original ticket has only two lines now`, async() => { const result = await nightmare .wait(selectors.ticketSales.saleLine) .countElement(selectors.ticketSales.saleLine); @@ -344,7 +344,7 @@ describe('Ticket Edit sale path', () => { expect(result).toEqual(2); }); - it('should go back to the receiver ticket sales section', async () => { + it('should go back to the receiver ticket sales section', async() => { const url = await nightmare .waitToClick(selectors.itemsIndex.goBackToModuleIndexButton) .wait(selectors.ticketsIndex.searchTicketInput) @@ -360,7 +360,7 @@ describe('Ticket Edit sale path', () => { expect(url.hash).toContain('/sale'); }); - it('should transfer the sale back to the original ticket', async () => { + it('should transfer the sale back to the original ticket', async() => { const result = await nightmare .waitToClick(selectors.ticketSales.firstSaleCheckbox) .waitToClick(selectors.ticketSales.transferSaleButton) @@ -373,7 +373,7 @@ describe('Ticket Edit sale path', () => { expect(result.hash).toContain(`ticket/16/sale`); }); - it('should confirm the original ticket received the line', async () => { + it('should confirm the original ticket received the line', async() => { const result = await nightmare .wait(selectors.ticketSales.saleLine) .countElement(selectors.ticketSales.saleLine); @@ -381,7 +381,7 @@ describe('Ticket Edit sale path', () => { expect(result).toEqual(3); }); - it('should go back to the original ticket sales section', async () => { + it('should go back to the original ticket sales section', async() => { const url = await nightmare .waitToClick(selectors.itemsIndex.goBackToModuleIndexButton) .wait(selectors.ticketsIndex.searchTicketInput) @@ -397,7 +397,7 @@ describe('Ticket Edit sale path', () => { expect(url.hash).toContain('/sale'); }); - it('should select the second and third sale and tranfer them to a new ticket then get to the ticket index', async () => { + it('should select the second and third sale and tranfer them to a new ticket then get to the ticket index', async() => { const url = await nightmare .waitToClick(selectors.ticketSales.firstSaleCheckbox) .waitToClick(selectors.ticketSales.transferSaleButton) @@ -412,7 +412,7 @@ describe('Ticket Edit sale path', () => { expect(url.hash).toEqual('#!/ticket/index'); }); - it('should search for a specific created ticket', async () => { + 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') @@ -423,7 +423,7 @@ describe('Ticket Edit sale path', () => { expect(result).toEqual(1); }); - it(`should click on the search result to access to the ticket Sale once more`, async () => { + it(`should click on the search result to access to the ticket Sale once more`, async() => { const url = await nightmare .waitForTextInElement(selectors.ticketsIndex.searchResult, 'address 24') .waitToClick(selectors.ticketsIndex.searchResult) @@ -434,21 +434,21 @@ describe('Ticket Edit sale path', () => { expect(url.hash).toContain('/sale'); }); - it('should confirm the new ticket received both lines', async () => { + it('should confirm the new ticket received both lines', async() => { const result = await nightmare .countElement(selectors.ticketSales.saleLine); expect(result).toEqual(1); }); - it('should check the first sale reserved icon isnt visible', async () => { + it('should check the first sale reserved icon isnt visible', async() => { const result = await nightmare .isVisible(selectors.ticketSales.firstSaleReservedIcon); expect(result).toBeFalsy(); }); - it('should mark the first sale as reserved', async () => { + it('should mark the first sale as reserved', async() => { const result = await nightmare .waitToClick(selectors.ticketSales.firstSaleCheckbox) .waitToClick(selectors.ticketSales.moreMenuButton) @@ -459,7 +459,7 @@ describe('Ticket Edit sale path', () => { expect(result).toBeTruthy(); }); - it('should unmark the first sale as reserved', async () => { + it('should unmark the first sale as reserved', async() => { const result = await nightmare .waitToClick(selectors.ticketSales.firstSaleCheckbox) .waitToClick(selectors.ticketSales.moreMenuButton) @@ -470,7 +470,7 @@ describe('Ticket Edit sale path', () => { expect(result).toBeFalsy(); }); - it('should update all sales discount', async () => { + it('should update all sales discount', async() => { const result = await nightmare .waitToClick(selectors.ticketSales.selectAllSalesCheckbox) .waitToClick(selectors.ticketSales.moreMenuButton) @@ -484,7 +484,7 @@ describe('Ticket Edit sale path', () => { expect(result).toContain('0.00'); }); - it('should log in as Production role and go to the ticket index', async () => { + it('should log in as Production role and go to the ticket index', async() => { const url = await nightmare .waitToClick(selectors.globalItems.logOutButton) .waitForLogin('production') @@ -497,7 +497,7 @@ describe('Ticket Edit sale path', () => { expect(url.hash).toEqual('#!/ticket/index'); }); - it('should now search for a specific ticket', async () => { + it('should now search for a specific ticket', async() => { const result = await nightmare .wait(selectors.ticketsIndex.searchTicketInput) .type(selectors.ticketsIndex.searchTicketInput, 'id:16') @@ -508,7 +508,7 @@ describe('Ticket Edit sale path', () => { expect(result).toEqual(1); }); - it(`should now click on the search result to access to the ticket Tracking`, async () => { + it(`should now click on the search result to access to the ticket Tracking`, async() => { const url = await nightmare .waitForTextInElement(selectors.ticketsIndex.searchResult, 'address 21') .waitToClick(selectors.ticketsIndex.searchResult) @@ -519,7 +519,7 @@ describe('Ticket Edit sale path', () => { expect(url.hash).toContain('/tracking/index'); }); - it(`should click on the edit ticket tracking state button`, async () => { + it(`should click on the edit ticket tracking state button`, async() => { const url = await nightmare .waitToClick(selectors.ticketTracking.createStateButton) .waitForURL('/tracking/edit') @@ -528,7 +528,7 @@ describe('Ticket Edit sale path', () => { expect(url.hash).toContain('/tracking/edit'); }); - it(`should set the state of the ticket to preparation`, async () => { + it(`should set the state of the ticket to preparation`, async() => { const url = await nightmare .waitToClick(selectors.ticketTracking.stateSelect) .wait(selectors.ticketTracking.stateSelectInput) @@ -542,7 +542,7 @@ describe('Ticket Edit sale path', () => { expect(url.hash).toContain('/tracking/index'); }); - it(`should click on the ticket Sale menu button`, async () => { + it(`should click on the ticket Sale menu button`, async() => { const url = await nightmare .waitToClick(selectors.ticketSales.saleButton) .waitForURL('/sale') @@ -552,7 +552,7 @@ describe('Ticket Edit sale path', () => { }); describe('when state is preparation and loged as Production', () => { - it(`should not be able to edit the sale price`, async () => { + it(`should not be able to edit the sale price`, async() => { const result = await nightmare .waitToClick(selectors.ticketSales.firstSalePrice) .exists(selectors.ticketSales.firstSalePriceInput); @@ -560,7 +560,7 @@ describe('Ticket Edit sale path', () => { expect(result).toBeFalsy(); }); - it(`should not be able to edit the sale discount`, async () => { + it(`should not be able to edit the sale discount`, async() => { const result = await nightmare .waitToClick(selectors.ticketSales.firstSaleDiscount) .exists(selectors.ticketSales.firstSaleDiscountInput); @@ -568,7 +568,7 @@ describe('Ticket Edit sale path', () => { expect(result).toBeFalsy(); }); - it(`should not be able to edit the sale state`, async () => { + it(`should not be able to edit the sale state`, async() => { const result = await nightmare .waitToClick(selectors.ticketSales.stateMenuButton) .exists(selectors.ticketSales.stateMenuOptions); @@ -576,7 +576,7 @@ describe('Ticket Edit sale path', () => { expect(result).toBeFalsy(); }); - it('should log in as salesPerson role and go to the ticket index', async () => { + it('should log in as salesPerson role and go to the ticket index', async() => { const url = await nightmare .waitToClick(selectors.globalItems.logOutButton) .waitForLogin('salesPerson') @@ -589,7 +589,7 @@ describe('Ticket Edit sale path', () => { expect(url.hash).toEqual('#!/ticket/index'); }); - it('should once again search for a specific ticket', async () => { + it('should once again search for a specific ticket', async() => { const result = await nightmare .wait(selectors.ticketsIndex.searchTicketInput) .type(selectors.ticketsIndex.searchTicketInput, 'id:16') @@ -600,7 +600,7 @@ describe('Ticket Edit sale path', () => { expect(result).toEqual(1); }); - it(`should click on the search result to access to the ticket Sale once again`, async () => { + it(`should click on the search result to access to the ticket Sale once again`, async() => { const url = await nightmare .waitForTextInElement(selectors.ticketsIndex.searchResult, 'address 21') .waitToClick(selectors.ticketsIndex.searchResult) @@ -613,7 +613,7 @@ describe('Ticket Edit sale path', () => { }); describe('when state is preparation and loged as salesPerson', () => { - it(`shouldnt be able to edit the sale price`, async () => { + it(`shouldnt be able to edit the sale price`, async() => { const result = await nightmare .waitToClick(selectors.ticketSales.firstSalePrice) .exists(selectors.ticketSales.firstSalePriceInput); @@ -621,7 +621,7 @@ describe('Ticket Edit sale path', () => { expect(result).toBeFalsy(); }); - it(`shouldnt be able to edit the sale discount`, async () => { + it(`shouldnt be able to edit the sale discount`, async() => { const result = await nightmare .waitToClick(selectors.ticketSales.firstSaleDiscount) .exists(selectors.ticketSales.firstSaleDiscountInput); @@ -629,7 +629,7 @@ describe('Ticket Edit sale path', () => { expect(result).toBeFalsy(); }); - it(`shouldnt be able to edit the sale state`, async () => { + it(`shouldnt be able to edit the sale state`, async() => { const result = await nightmare .waitToClick(selectors.ticketSales.stateMenuButton) .exists(selectors.ticketSales.stateMenuOptions); diff --git a/e2e/paths/ticket-module/11_ticket_diary.spec.js b/e2e/paths/ticket-module/11_ticket_diary.spec.js index 3f7edf1cc..10b05363d 100644 --- a/e2e/paths/ticket-module/11_ticket_diary.spec.js +++ b/e2e/paths/ticket-module/11_ticket_diary.spec.js @@ -10,7 +10,7 @@ describe('Ticket diary path', () => { .loginAndModule('employee', 'ticket'); }); - it('should search for a specific ticket', async () => { + it('should search for a specific ticket', async() => { const result = await nightmare .wait(selectors.ticketsIndex.searchTicketInput) .type(selectors.ticketsIndex.searchTicketInput, 'id:1') @@ -21,7 +21,7 @@ describe('Ticket diary path', () => { expect(result).toEqual(1); }); - it(`should click on the search result to access to the ticket summary`, async () => { + it(`should click on the search result to access to the ticket summary`, async() => { const url = await nightmare .waitForTextInElement(selectors.ticketsIndex.searchResult, 'address 21') .waitToClick(selectors.ticketsIndex.searchResult) @@ -31,7 +31,7 @@ describe('Ticket diary path', () => { expect(url.hash).toContain('/summary'); }); - it(`should navigate to the item diary from the 1st sale item id descriptor popover`, async () => { + it(`should navigate to the item diary from the 1st sale item id descriptor popover`, async() => { const url = await nightmare .waitToClick(selectors.ticketSummary.firstSaleItemId) .waitToClick(selectors.ticketSummary.popoverDiaryButton) @@ -42,24 +42,23 @@ describe('Ticket diary path', () => { expect(url.hash).toContain('/diary'); }); - it(`should check the seventh line id is marked as counter`, async () => { + it(`should check the seventh line id is marked as counter`, async() => { const result = await nightmare .waitToGetProperty(selectors.itemDiary.thirdTicketId, 'className'); expect(result).toContain('counter'); }); - it(`should check the fifth line balance is marked as counter`, async () => { + it(`should check the fifth line balance is marked as counter`, async() => { const result = await nightmare .waitToGetProperty(selectors.itemDiary.fifthBalance, 'className'); expect(result).toContain('counter'); }); - it(`should change to the warehouse two and check there are sales marked as negative balance`, async () => { + it(`should change to the warehouse two and check there are sales marked as negative balance`, async() => { const result = await nightmare - .waitToClick(selectors.itemDiary.warehouseSelect) - .waitToClick(selectors.itemDiary.warehouseSelectFourthOption) + .autocompleteSearch(selectors.itemDiary.warehouseAutocomplete, 'Warehouse Two') .waitToGetProperty(selectors.itemDiary.firstBalance, 'className'); expect(result).toContain('balance');