diff --git a/e2e/helpers/extensions.js b/e2e/helpers/extensions.js index dfe01bad0..69658135f 100644 --- a/e2e/helpers/extensions.js +++ b/e2e/helpers/extensions.js @@ -42,7 +42,7 @@ let actions = { doLogin: async function(userName, password = 'nightmare') { await this.wait(`vn-login [ng-model="$ctrl.user"]`); await this.clearInput(`vn-login [ng-model="$ctrl.user"]`); - await this.type(`vn-login [ng-model="$ctrl.user"]`, userName); + await this.write(`vn-login [ng-model="$ctrl.user"]`, userName); await this.clearInput(`vn-login [ng-model="$ctrl.password"]`); await this.write(`vn-login [ng-model="$ctrl.password"]`, password); await this.click('vn-login button[type=submit]'); @@ -127,9 +127,9 @@ let actions = { clearInput: async function(selector) { await this.wait(selector); let field = await this.evaluate(selector => { - return document.querySelector(selector).closest('.vn-field').$ctrl.field; + return document.querySelector(`${selector} input`).closest('.vn-field').$ctrl.field; }, selector); - if (field != null && field != '') { + if ((field != null && field != '') || field == '0') { let coords = await this.evaluate(selector => { let rect = document.querySelector(selector).getBoundingClientRect(); return {x: rect.x + (rect.width / 2), y: rect.y + (rect.height / 2)}; @@ -288,7 +288,7 @@ let actions = { waitForTextInInput: async function(selector, text) { await this.wait(selector); return await this.wait((selector, text) => { - return document.querySelector(selector).value.toLowerCase().includes(text.toLowerCase()); + return document.querySelector(`${selector} input`).value.toLowerCase().includes(text.toLowerCase()); }, {}, selector, text); }, @@ -372,7 +372,7 @@ let actions = { autocompleteSearch: async function(autocompleteSelector, searchValue) { await this.waitFor(100); // time in which the autocomplete data loads await this.waitToClick(`${autocompleteSelector} input`); - await this.write(`.vn-drop-down.shown input`, searchValue); + await this.write(`.vn-drop-down.shown`, searchValue); await this.waitFor(100); // ul to repaint await this.waitToClick(`.vn-drop-down.shown li.active`); await this.waitFor(100); // input to asign value diff --git a/e2e/helpers/selectors.js b/e2e/helpers/selectors.js index 9f0abc8a7..ed984348c 100644 --- a/e2e/helpers/selectors.js +++ b/e2e/helpers/selectors.js @@ -189,7 +189,7 @@ export default { searchResultPreviewButton: 'vn-item-index .buttons > [icon="desktop_windows"]', searchResultCloneButton: 'vn-item-index .buttons > [icon="icon-clone"]', acceptClonationAlertButton: '.vn-confirm.shown [response="accept"]', - searchItemInput: 'vn-searchbar [name="searchString"]', + searchItemInput: 'vn-searchbar', searchButton: 'vn-searchbar vn-icon[icon="search"]', closeItemSummaryPreview: '.vn-popup.shown', fieldsToShowButton: 'vn-item-index vn-table > div > div > vn-icon-button[icon="menu"]', @@ -211,7 +211,7 @@ export default { saveFieldsButton: '.vn-dialog.shown vn-horizontal:nth-child(16) > vn-button > button' }, itemCreateView: { - temporalName: 'vn-item-create [name="provisionalName"]', + temporalName: 'vn-item-create [ng-model="$ctrl.item.provisionalName"]', typeAutocomplete: 'vn-autocomplete[ng-model="$ctrl.item.typeFk"]', intrastatAutocomplete: 'vn-autocomplete[ng-model="$ctrl.item.intrastatFk"]', originAutocomplete: 'vn-autocomplete[ng-model="$ctrl.item.originFk"]', @@ -222,7 +222,7 @@ export default { goBackToModuleIndexButton: 'vn-item-descriptor a[href="#!/item/index"]', moreMenu: 'vn-item-descriptor vn-icon-menu[icon=more_vert]', moreMenuRegularizeButton: '.vn-drop-down.shown li[name="Regularize stock"]', - regularizeQuantityInput: '.vn-dialog.shown [name="quantity"]', + regularizeQuantityInput: '.vn-dialog.shown [ng-model="$ctrl.quantity"]', regularizeWarehouseAutocomplete: '.vn-dialog.shown vn-autocomplete[ng-model="$ctrl.warehouseFk"]', editButton: 'vn-item-descriptor vn-float-button[icon="edit"]', regularizeSaveButton: '.vn-dialog.shown tpl-buttons > button', @@ -234,11 +234,11 @@ export default { goToItemIndexButton: 'vn-item-descriptor [ui-sref="item.index"]', typeAutocomplete: 'vn-autocomplete[ng-model="$ctrl.item.typeFk"]', intrastatAutocomplete: 'vn-autocomplete[ng-model="$ctrl.item.intrastatFk"]', - nameInput: 'vn-item-basic-data [name="name"]', - relevancyInput: 'vn-item-basic-data [name="relevancy"]', + nameInput: 'vn-item-basic-data [ng-model="$ctrl.item.name"]', + relevancyInput: 'vn-item-basic-data [ng-model="$ctrl.item.relevancy"]', originAutocomplete: 'vn-autocomplete[ng-model="$ctrl.item.originFk"]', expenseAutocomplete: 'vn-autocomplete[ng-model="$ctrl.item.expenseFk"]', - longNameInput: 'vn-textfield[ng-model="$ctrl.item.longName"] input', + longNameInput: 'vn-textfield[ng-model="$ctrl.item.longName"]', isActiveCheckbox: 'vn-check[label="Active"]', priceInKgCheckbox: 'vn-check[label="Price in kg"]', submitBasicDataButton: `button[type=submit]` @@ -247,18 +247,18 @@ export default { goToItemIndexButton: 'vn-item-descriptor [ui-sref="item.index"]', tagsButton: 'vn-left-menu a[ui-sref="item.card.tags"]', fourthTagAutocomplete: 'vn-item-tags vn-horizontal:nth-child(4) > vn-autocomplete[ng-model="itemTag.tagFk"]', - fourthValueInput: 'vn-item-tags vn-horizontal:nth-child(4) [name="value"]', - fourthRelevancyInput: 'vn-item-tags vn-horizontal:nth-child(4) [name="priority"]', + fourthValueInput: 'vn-item-tags vn-horizontal:nth-child(4) [ng-model="itemTag.value"]', + fourthRelevancyInput: 'vn-item-tags vn-horizontal:nth-child(4) [ng-model="itemTag.priority"]', fourthRemoveTagButton: 'vn-item-tags vn-horizontal:nth-child(4) vn-icon-button[icon="delete"]', fifthTagAutocomplete: 'vn-item-tags vn-horizontal:nth-child(5) > vn-autocomplete[ng-model="itemTag.tagFk"]', - fifthValueInput: 'vn-item-tags vn-horizontal:nth-child(5) [name="value"]', - fifthRelevancyInput: 'vn-item-tags vn-horizontal:nth-child(5) [name="priority"]', + fifthValueInput: 'vn-item-tags vn-horizontal:nth-child(5) [ng-model="itemTag.value"]', + fifthRelevancyInput: 'vn-item-tags vn-horizontal:nth-child(5) [ng-model="itemTag.priority"]', sixthTagAutocomplete: 'vn-item-tags vn-horizontal:nth-child(6) > vn-autocomplete[ng-model="itemTag.tagFk"]', - sixthValueInput: 'vn-item-tags vn-horizontal:nth-child(6) [name="value"]', - sixthRelevancyInput: 'vn-item-tags vn-horizontal:nth-child(6) [name="priority"]', + sixthValueInput: 'vn-item-tags vn-horizontal:nth-child(6) [ng-model="itemTag.value"]', + sixthRelevancyInput: 'vn-item-tags vn-horizontal:nth-child(6) [ng-model="itemTag.priority"]', seventhTagAutocomplete: 'vn-item-tags vn-horizontal:nth-child(7) > vn-autocomplete[ng-model="itemTag.tagFk"]', - seventhValueInput: 'vn-item-tags vn-horizontal:nth-child(7) [name="value"]', - seventhRelevancyInput: 'vn-item-tags vn-horizontal:nth-child(7) [name="priority"]', + seventhValueInput: 'vn-item-tags vn-horizontal:nth-child(7) [ng-model="itemTag.value"]', + seventhRelevancyInput: 'vn-item-tags vn-horizontal:nth-child(7) [ng-model="itemTag.priority"]', addItemTagButton: 'vn-item-tags vn-icon-button[icon="add_circle"]', submitItemTagsButton: 'vn-item-tags button[type=submit]' }, @@ -271,23 +271,23 @@ export default { }, itemBarcodes: { addBarcodeButton: 'vn-item-barcode vn-icon[icon="add_circle"]', - thirdCodeInput: 'vn-item-barcode vn-horizontal:nth-child(3) [name="code"]', + thirdCodeInput: 'vn-item-barcode vn-horizontal:nth-child(3) [ng-model="barcode.code"]', submitBarcodesButton: 'vn-item-barcode button[type=submit]', firstCodeRemoveButton: 'vn-item-barcode vn-horizontal vn-none vn-icon[icon="delete"]' }, itemNiches: { addNicheButton: 'vn-item-niche vn-icon[icon="add_circle"]', firstWarehouseAutocomplete: 'vn-item-niche vn-autocomplete[ng-model="niche.warehouseFk"]', - firstCodeInput: 'vn-item-niche vn-horizontal:nth-child(1) [name="code"]', + firstCodeInput: 'vn-item-niche vn-horizontal:nth-child(1) [ng-model="niche.code"]', secondWarehouseAutocomplete: 'vn-item-niche vn-horizontal:nth-child(2) > vn-autocomplete[ng-model="niche.warehouseFk"]', - secondCodeInput: 'vn-item-niche vn-horizontal:nth-child(2) [name="code"]', + secondCodeInput: 'vn-item-niche vn-horizontal:nth-child(2) [ng-model="niche.code"]', secondNicheRemoveButton: 'vn-item-niche vn-horizontal:nth-child(2) > vn-none > vn-icon-button[icon="delete"]', thirdWarehouseAutocomplete: 'vn-item-niche vn-horizontal:nth-child(3) > vn-autocomplete[ng-model="niche.warehouseFk"]', - thirdCodeInput: 'vn-item-niche vn-horizontal:nth-child(3) [name="code"]', + thirdCodeInput: 'vn-item-niche vn-horizontal:nth-child(3) [ng-model="niche.code"]', submitNichesButton: 'vn-item-niche button[type=submit]' }, itemBotanical: { - botanicalInput: 'vn-item-botanical vn-horizontal:nth-child(1) [name="botanical"]', + botanicalInput: 'vn-item-botanical vn-horizontal:nth-child(1) [ng-model="$ctrl.botanical.botanical"]', genusAutocomplete: 'vn-item-botanical vn-autocomplete[ng-model="$ctrl.botanical.genusFk"]', speciesAutocomplete: 'vn-item-botanical vn-autocomplete[ng-model="$ctrl.botanical.specieFk"]', submitBotanicalButton: `vn-item-botanical button[type=submit]` @@ -328,12 +328,12 @@ export default { }, ticketsIndex: { openAdvancedSearchButton: 'vn-searchbar .append vn-icon[icon="arrow_drop_down"]', - advancedSearchInvoiceOut: 'vn-ticket-search-panel [name="refFk"]', + advancedSearchInvoiceOut: 'vn-ticket-search-panel [ng-model="filter.refFk"]', newTicketButton: 'vn-ticket-index > a', searchResult: 'vn-ticket-index vn-card > vn-table > div > vn-tbody > a.vn-tr', searchWeeklyResult: 'vn-ticket-weekly-index vn-table vn-tbody > vn-tr', searchResultDate: 'vn-ticket-index vn-table vn-tbody > a:nth-child(1) > vn-td:nth-child(5)', - searchTicketInput: 'vn-searchbar [name="searchString"]', + searchTicketInput: 'vn-searchbar', searchWeeklyClearInput: 'vn-searchbar vn-icon[icon=clear]', advancedSearchButton: 'vn-ticket-search-panel button[type=submit]', searchButton: 'vn-searchbar vn-icon[icon="search"]', @@ -380,7 +380,7 @@ export default { firstNoteRemoveButton: 'vn-icon[icon="delete"]', addNoteButton: 'vn-icon[icon="add_circle"]', firstNoteTypeAutocomplete: 'vn-autocomplete[ng-model="observation.observationTypeFk"]', - firstDescriptionInput: 'vn-ticket-observation [name="description"]', + firstDescriptionInput: 'vn-ticket-observation [ng-model="observation.description"]', submitNotesButton: `button[type=submit]` }, ticketExpedition: { @@ -392,7 +392,7 @@ export default { ticketPackages: { packagesButton: 'vn-left-menu a[ui-sref="ticket.card.package"]', firstPackageAutocomplete: 'vn-autocomplete[label="Package"]', - firstQuantityInput: 'vn-ticket-package vn-horizontal:nth-child(1) [name="quantity"]', + firstQuantityInput: 'vn-ticket-package vn-horizontal:nth-child(1) [ng-model="package.quantity"]', firstRemovePackageButton: 'vn-icon-button[vn-tooltip="Remove package"]', addPackageButton: 'vn-icon-button[vn-tooltip="Add package"]', clearPackageAutocompleteButton: 'vn-autocomplete[label="Package"] .icons > vn-icon[icon=clear]', @@ -411,7 +411,6 @@ export default { moreMenuReserve: '.vn-drop-down.shown li[name="Mark as reserved"]', moreMenuUnmarkReseved: '.vn-drop-down.shown li[name="Unmark as reserved"]', moreMenuUpdateDiscount: '.vn-drop-down.shown li[name="Update discount"]', - moreMenuUpdateDiscountInput: 'vn-ticket-sale-edit-discount [name="newDiscount"]', transferQuantityInput: '.vn-popover.shown vn-table > div > vn-tbody > vn-tr > vn-td-editable > span > text', transferQuantityCell: '.vn-popover.shown vn-table > div > vn-tbody > vn-tr > vn-td-editable', firstSaleClaimIcon: 'vn-ticket-sale vn-table vn-tbody > vn-tr:nth-child(1) vn-icon[icon="icon-claims"]', @@ -419,15 +418,15 @@ export default { firstSaleText: 'vn-table div > vn-tbody > vn-tr:nth-child(1)', firstSaleThumbnailImage: 'vn-ticket-sale:nth-child(1) vn-tr:nth-child(1) vn-td:nth-child(3) > img', firstSaleZoomedImage: 'body > div > div > img', - firstSaleQuantity: 'vn-ticket-sale [name="quantity"]', + firstSaleQuantity: 'vn-ticket-sale [ng-model="sale.quantity"]', firstSaleQuantityCell: 'vn-ticket-sale vn-tr:nth-child(1) > vn-td-editable:nth-child(5)', firstSaleQuantityClearInput: 'vn-textfield[ng-model="sale.quantity"] div.suffix > i', firstSaleIdAutocomplete: 'vn-ticket-sale vn-table vn-tbody > vn-tr:nth-child(1) > vn-td:nth-child(4) > vn-autocomplete', idAutocompleteFirstResult: '.vn-drop-down.shown li', firstSalePrice: 'vn-ticket-sale vn-table vn-tr:nth-child(1) > vn-td:nth-child(7) > span', - firstSalePriceInput: '.vn-popover.shown [name="editedPrice"]', + firstSalePriceInput: '.vn-popover.shown [ng-model="$ctrl.editedPrice"]', firstSaleDiscount: 'vn-ticket-sale vn-table vn-tr:nth-child(1) > vn-td:nth-child(8) > span', - firstSaleDiscountInput: '.vn-popover.shown [name="newDiscount"]', + firstSaleDiscountInput: '.vn-popover.shown [ng-model="$ctrl.newDiscount"]', firstSaleImport: 'vn-ticket-sale:nth-child(1) vn-td:nth-child(9)', firstSaleReservedIcon: 'vn-ticket-sale vn-tr:nth-child(1) > vn-td:nth-child(2) > vn-icon:nth-child(3)', firstSaleColour: 'vn-ticket-sale vn-tr:nth-child(1) vn-fetched-tags section', @@ -440,18 +439,18 @@ export default { secondSaleText: 'vn-table div > vn-tbody > vn-tr:nth-child(2)', secondSaleId: 'vn-ticket-sale:nth-child(2) vn-td-editable:nth-child(4) text > span', secondSaleIdCell: 'vn-ticket-sale vn-tr:nth-child(2) > vn-td-editable:nth-child(4)', - secondSaleIdInput: 'vn-ticket-sale vn-table vn-tbody > vn-tr:nth-child(2) > vn-td:nth-child(4) > vn-autocomplete input', + secondSaleIdInput: 'vn-ticket-sale vn-table vn-tbody > vn-tr:nth-child(2) > vn-td:nth-child(4) > vn-autocomplete', secondSaleIdAutocomplete: 'vn-ticket-sale vn-table vn-tbody > vn-tr:nth-child(2) > vn-td:nth-child(4) > vn-autocomplete', - secondSaleQuantity: 'vn-ticket-sale vn-table vn-tr:nth-child(2) vn-input-number input', + secondSaleQuantity: 'vn-ticket-sale vn-table vn-tr:nth-child(2) vn-input-number', secondSaleConceptCell: 'vn-ticket-sale vn-table vn-tbody > vn-tr:nth-child(2) > vn-td-editable:nth-child(6) > div', - secondSaleConceptInput: 'vn-ticket-sale vn-table vn-tr:nth-child(2) > vn-td-editable.ng-isolate-scope.selected vn-textfield input', + secondSaleConceptInput: 'vn-ticket-sale vn-table vn-tr:nth-child(2) > vn-td-editable.ng-isolate-scope.selected vn-textfield', totalImport: 'vn-ticket-sale > vn-vertical > vn-card > vn-vertical > vn-horizontal > vn-one > p:nth-child(3) > strong', selectAllSalesCheckbox: 'vn-ticket-sale vn-thead vn-check', secondSaleCheckbox: 'vn-ticket-sale vn-tr:nth-child(2) vn-check[ng-model="sale.checked"]', thirdSaleCheckbox: 'vn-ticket-sale vn-tr:nth-child(3) vn-check[ng-model="sale.checked"]', deleteSaleButton: 'vn-ticket-sale vn-tool-bar > vn-button[icon="delete"]', transferSaleButton: 'vn-ticket-sale vn-tool-bar > vn-button[icon="call_split"]', - moveToTicketInput: '.vn-popover.shown vn-textfield[ng-model="$ctrl.transfer.ticketId"] input', + moveToTicketInput: '.vn-popover.shown vn-textfield[ng-model="$ctrl.transfer.ticketId"]', moveToTicketInputClearButton: '.vn-popover.shown i[title="Clear"]', moveToTicketButton: '.vn-popover.shown vn-icon[icon="arrow_forward_ios"]', moveToNewTicketButton: '.vn-popover.shown vn-button[label="New ticket"]', @@ -483,10 +482,10 @@ export default { ticketRequests: { addRequestButton: 'vn-ticket-request-index > a > vn-float-button > button', request: 'vn-ticket-request-index vn-table vn-tr', - descriptionInput: 'vn-ticket-request-create [name="description"]', + descriptionInput: 'vn-ticket-request-create [ng-model="$ctrl.ticketRequest.description"]', atenderAutocomplete: 'vn-ticket-request-create vn-autocomplete[ng-model="$ctrl.ticketRequest.attenderFk"]', - quantityInput: 'vn-ticket-request-create [name=quantity]', - priceInput: 'vn-ticket-request-create [name=price]', + quantityInput: 'vn-ticket-request-create [ng-model="$ctrl.ticketRequest.quantity"]', + priceInput: 'vn-ticket-request-create [ng-model="$ctrl.ticketRequest.price"]', firstRemoveRequestButton: 'vn-ticket-request-index vn-icon[icon="delete"]:nth-child(1)', saveButton: 'vn-ticket-request-create button[type=submit]', firstDescription: 'vn-ticket-request-index vn-table vn-tr:nth-child(1) > vn-td:nth-child(2)', @@ -502,11 +501,11 @@ export default { addServiceButton: 'vn-ticket-service vn-icon-button[vn-tooltip="Add service"] > button', firstAddServiceTypeButton: 'vn-ticket-service vn-icon-button[vn-tooltip="New service type"]', firstServiceTypeAutocomplete: 'vn-ticket-service vn-autocomplete[ng-model="service.ticketServiceTypeFk"]', - firstQuantityInput: 'vn-ticket-service [name="quantity"]', - firstPriceInput: 'vn-ticket-service [name="price"]', + firstQuantityInput: 'vn-ticket-service [ng-model="service.quantity"]', + firstPriceInput: 'vn-ticket-service [ng-model="service.price"]', firstVatTypeAutocomplete: 'vn-ticket-service vn-autocomplete[label="Tax class"]', fistDeleteServiceButton: 'vn-ticket-service form vn-horizontal:nth-child(1) vn-icon-button[icon="delete"]', - newServiceTypeNameInput: '.vn-dialog.shown vn-textfield[ng-model="$ctrl.newServiceType.name"] input', + newServiceTypeNameInput: '.vn-dialog.shown vn-textfield[ng-model="$ctrl.newServiceType.name"]', newServiceTypeExpenseAutocomplete: '.vn-dialog.shown vn-autocomplete[ng-model="$ctrl.newServiceType.expenseFk"]', serviceLine: 'vn-ticket-service > form > vn-card > vn-one:nth-child(2) > vn-horizontal', saveServiceButton: `button[type=submit]`, @@ -519,7 +518,7 @@ export default { saveStateButton: `button[type=submit]` }, claimsIndex: { - searchClaimInput: 'vn-searchbar [name="searchString"]', + searchClaimInput: 'vn-searchbar', searchResult: 'vn-claim-index vn-card > vn-table > div > vn-tbody > a', searchButton: 'vn-searchbar vn-icon[icon="search"]' }, @@ -549,12 +548,11 @@ export default { }, claimDetail: { secondItemDiscount: 'vn-claim-detail > vn-vertical > vn-card > vn-vertical > vn-table > div > vn-tbody > vn-tr:nth-child(2) > vn-td:nth-child(6) > span', - discountInput: '.vn-popover.shown [name="newDiscount"]', + discountInput: '.vn-popover.shown [ng-model="$ctrl.newDiscount"]', discoutPopoverMana: '.vn-popover.shown .content > div > vn-horizontal > h5', addItemButton: 'vn-claim-detail a vn-float-button', firstClaimableSaleFromTicket: '.vn-dialog.shown vn-tbody > vn-tr', claimDetailLine: 'vn-claim-detail > vn-vertical > vn-card > vn-vertical > vn-table > div > vn-tbody > vn-tr', - firstItemQuantityInput: 'vn-claim-detail vn-tr:nth-child(1) [name="quantity"]', totalClaimed: 'vn-claim-detail > vn-vertical > vn-card > vn-vertical > vn-horizontal > div > vn-label-value:nth-child(2) > section > span', secondItemDeleteButton: 'vn-claim-detail > vn-vertical > vn-card > vn-vertical > vn-table > div > vn-tbody > vn-tr:nth-child(2) > vn-td:nth-child(8) > vn-icon-button > button > vn-icon > i' }, @@ -605,11 +603,11 @@ export default { orderByAutocomplete: 'vn-autocomplete[label="Order by"]', plantRealmButton: 'vn-order-catalog > vn-side-menu vn-icon[icon="icon-plant"]', typeAutocomplete: 'vn-autocomplete[data="$ctrl.itemTypes"]', - itemIdInput: 'vn-catalog-filter [name="itemFk"]', - itemTagValueInput: 'vn-catalog-filter [name="value"]', + itemIdInput: 'vn-catalog-filter [ng-model="$ctrl.itemFk"]', + itemTagValueInput: 'vn-catalog-filter [ng-model="$ctrl.value"]', openTagSearch: 'vn-catalog-filter > div > vn-vertical > vn-textfield[ng-model="$ctrl.value"] .append i', tagAutocomplete: 'vn-order-catalog-search-panel vn-autocomplete[ng-model="filter.tagFk"]', - tagValueInput: 'vn-order-catalog-search-panel [name="value"]', + tagValueInput: 'vn-order-catalog-search-panel [ng-model="filter.value"]', searchTagButton: 'vn-order-catalog-search-panel button[type=submit]', thirdFilterRemoveButton: 'vn-catalog-filter .chips > vn-chip:nth-child(3) vn-icon[icon=cancel]', fourthFilterRemoveButton: 'vn-catalog-filter .chips > vn-chip:nth-child(4) vn-icon[icon=cancel]', @@ -636,7 +634,7 @@ export default { createdDatePicker: 'vn-route-create vn-date-picker[ng-model="$ctrl.route.created"]', vehicleAutoComplete: 'vn-route-create vn-autocomplete[ng-model="$ctrl.route.vehicleFk"]', agencyAutoComplete: 'vn-route-create vn-autocomplete[ng-model="$ctrl.route.agencyModeFk"]', - descriptionInput: 'vn-route-create [name="description"', + descriptionInput: 'vn-route-create [ng-model="$ctrl.route.description"]', submitButton: 'vn-route-create button[type=submit]' }, routeDescriptor: { @@ -649,26 +647,26 @@ export default { workerAutoComplete: 'vn-route-basic-data vn-autocomplete[ng-model="$ctrl.route.workerFk"]', vehicleAutoComplete: 'vn-route-basic-data vn-autocomplete[ng-model="$ctrl.route.vehicleFk"]', agencyAutoComplete: 'vn-route-basic-data vn-autocomplete[ng-model="$ctrl.route.agencyModeFk"]', - kmStartInput: 'vn-route-basic-data [name="kmStart"]', - kmEndInput: 'vn-route-basic-data [name="kmEnd"]', + kmStartInput: 'vn-route-basic-data [ng-model="$ctrl.route.kmStart"]', + kmEndInput: 'vn-route-basic-data [ng-model="$ctrl.route.kmEnd"]', createdDateInput: 'vn-route-basic-data vn-date-picker[ng-model="$ctrl.route.created"]', - startedHourInput: 'vn-route-basic-data [name="started"]', - finishedHourInput: 'vn-route-basic-data [name="finished"]', + startedHourInput: 'vn-route-basic-data [ng-model="$ctrl.route.started"]', + finishedHourInput: 'vn-route-basic-data [ng-model="$ctrl.route.finished"]', saveButton: 'vn-route-basic-data button[type=submit]' }, routeTickets: { - firstTicketPriority: 'vn-route-tickets vn-tr:nth-child(1) vn-textfield[ng-model="ticket.priority"] input', - secondTicketPriority: 'vn-route-tickets vn-tr:nth-child(2) vn-textfield[ng-model="ticket.priority"] input', - thirdTicketPriority: 'vn-route-tickets vn-tr:nth-child(3) vn-textfield[ng-model="ticket.priority"] input', - fourthTicketPriority: 'vn-route-tickets vn-tr:nth-child(4) vn-textfield[ng-model="ticket.priority"] input', - eleventhTicketPriority: 'vn-route-tickets vn-tr:nth-child(11) vn-textfield[ng-model="ticket.priority"] input', + firstTicketPriority: 'vn-route-tickets vn-tr:nth-child(1) vn-textfield[ng-model="ticket.priority"]', + secondTicketPriority: 'vn-route-tickets vn-tr:nth-child(2) vn-textfield[ng-model="ticket.priority"]', + thirdTicketPriority: 'vn-route-tickets vn-tr:nth-child(3) vn-textfield[ng-model="ticket.priority"]', + fourthTicketPriority: 'vn-route-tickets vn-tr:nth-child(4) vn-textfield[ng-model="ticket.priority"]', + eleventhTicketPriority: 'vn-route-tickets vn-tr:nth-child(11) vn-textfield[ng-model="ticket.priority"]', firstTicketCheckbox: 'vn-route-tickets vn-tr:nth-child(1) vn-check', buscamanButton: 'vn-route-tickets vn-button[icon="icon-buscaman"]', firstTicketDeleteButton: 'vn-route-tickets vn-tr:nth-child(1) vn-icon[icon="delete"]', confirmButton: '.vn-confirm.shown button[response="accept"]' }, workerPbx: { - extensionInput: 'vn-worker-pbx [name="extension"]', + extensionInput: 'vn-worker-pbx [ng-model="$ctrl.worker.sip.extension"]', saveButton: 'vn-worker-pbx button[type=submit]' }, workerTimeControl: { @@ -724,7 +722,7 @@ export default { acceptDeleteDialog: '.vn-confirm.shown button[response="accept"]' }, invoiceOutIndex: { - searchInvoiceOutInput: 'vn-searchbar [name="searchString"]', + searchInvoiceOutInput: 'vn-searchbar', searchButton: 'vn-searchbar vn-icon[icon="search"]', searchResult: 'vn-invoice-out-index vn-card > vn-table > div > vn-tbody > a.vn-tr', }, diff --git a/e2e/paths/02-client-module/01_create_client.spec.js b/e2e/paths/02-client-module/01_create_client.spec.js index 4645d1410..739f45d77 100644 --- a/e2e/paths/02-client-module/01_create_client.spec.js +++ b/e2e/paths/02-client-module/01_create_client.spec.js @@ -76,7 +76,7 @@ describe('Client create path', async() => { it(`should check for autocompleted city, province and country`, async() => { const clientCity = await page - .waitToGetProperty(`${selectors.createClientView.city}`, 'value'); + .waitToGetProperty(`${selectors.createClientView.city} input`, 'value'); const clientProvince = await page .waitToGetProperty(`${selectors.createClientView.province} input`, 'value'); diff --git a/e2e/paths/02-client-module/02_edit_basic_data.spec.js b/e2e/paths/02-client-module/02_edit_basic_data.spec.js index 252c6a039..cc86c2773 100644 --- a/e2e/paths/02-client-module/02_edit_basic_data.spec.js +++ b/e2e/paths/02-client-module/02_edit_basic_data.spec.js @@ -29,10 +29,6 @@ describe('Client Edit basicData path', () => { await page.write(selectors.clientBasicData.nameInput, 'Ptonomy Wallace'); await page.clearInput(selectors.clientBasicData.contactInput); await page.write(selectors.clientBasicData.contactInput, 'David Haller'); - await page.clearInput(selectors.clientBasicData.phoneInput); - await page.write(selectors.clientBasicData.phoneInput, '987654321'); - await page.clearInput(selectors.clientBasicData.mobileInput); - await page.write(selectors.clientBasicData.mobileInput, '123456789'); await page.clearInput(selectors.clientBasicData.emailInput); await page.write(selectors.clientBasicData.emailInput, 'PWallace@verdnatura.es'); await page.autocompleteSearch(selectors.clientBasicData.channelAutocomplete, 'Rumors on the streets'); @@ -44,35 +40,21 @@ describe('Client Edit basicData path', () => { it('should confirm the name have been edited', async() => { await page.reloadSection('client.card.basicData'); - const result = await page.waitToGetProperty(selectors.clientBasicData.nameInput, 'value'); + const result = await page.waitToGetProperty(`${selectors.clientBasicData.nameInput} input`, 'value'); expect(result).toEqual('Ptonomy Wallace'); }); it('should confirm the contact name have been edited', async() => { const result = await page - .waitToGetProperty(selectors.clientBasicData.contactInput, 'value'); + .waitToGetProperty(`${selectors.clientBasicData.contactInput} input`, 'value'); expect(result).toEqual('David Haller'); }); - it('should confirm the landline phone number have been added', async() => { - const result = await page - .waitToGetProperty(selectors.clientBasicData.phoneInput, 'value'); - - expect(result).toEqual('987654321'); - }); - - it('should confirm the mobile phone number have been added', async() => { - const result = await page - .waitToGetProperty(selectors.clientBasicData.mobileInput, 'value'); - - expect(result).toEqual('123456789'); - }); - it('should confirm the email have been edited', async() => { const result = await page - .waitToGetProperty(selectors.clientBasicData.emailInput, 'value'); + .waitToGetProperty(`${selectors.clientBasicData.emailInput} input`, 'value'); expect(result).toEqual('PWallace@verdnatura.es'); }); @@ -106,10 +88,6 @@ describe('Client Edit basicData path', () => { await page.write(selectors.clientBasicData.nameInput, 'Ororo Munroe'); await page.clearInput(selectors.clientBasicData.contactInput); await page.write(selectors.clientBasicData.contactInput, 'Black Panther'); - await page.clearInput(selectors.clientBasicData.phoneInput); - await page.write(selectors.clientBasicData.phoneInput, '123456789'); - await page.clearInput(selectors.clientBasicData.mobileInput); - await page.write(selectors.clientBasicData.mobileInput, '987654321'); await page.clearInput(selectors.clientBasicData.emailInput); await page.write(selectors.clientBasicData.emailInput, 'Storm@verdnatura.es'); await page.autocompleteSearch(selectors.clientBasicData.salesPersonAutocomplete, 'replenisherNick'); @@ -122,35 +100,21 @@ describe('Client Edit basicData path', () => { it('should now confirm the name have been edited', async() => { await page.reloadSection('client.card.basicData'); - const result = await page.waitToGetProperty(selectors.clientBasicData.nameInput, 'value'); + const result = await page.waitToGetProperty(`${selectors.clientBasicData.nameInput} input`, 'value'); expect(result).toEqual('Ororo Munroe'); }); it('should now confirm the contact name have been edited', async() => { const result = await page - .waitToGetProperty(selectors.clientBasicData.contactInput, 'value'); + .waitToGetProperty(`${selectors.clientBasicData.contactInput} input`, 'value'); expect(result).toEqual('Black Panther'); }); - it('should now confirm the landline phone number have been added', async() => { - const result = await page - .waitToGetProperty(selectors.clientBasicData.phoneInput, 'value'); - - expect(result).toEqual('123456789'); - }); - - it('should now confirm the mobile phone number have been added', async() => { - const result = await page - .waitToGetProperty(selectors.clientBasicData.mobileInput, 'value'); - - expect(result).toEqual('987654321'); - }); - it('should now confirm the email have been edited', async() => { const result = await page - .waitToGetProperty(selectors.clientBasicData.emailInput, 'value'); + .waitToGetProperty(`${selectors.clientBasicData.emailInput} input`, 'value'); expect(result).toEqual('Storm@verdnatura.es'); }); diff --git a/e2e/paths/02-client-module/03_edit_fiscal_data.spec.js b/e2e/paths/02-client-module/03_edit_fiscal_data.spec.js index ae119a9f1..4cfc64809 100644 --- a/e2e/paths/02-client-module/03_edit_fiscal_data.spec.js +++ b/e2e/paths/02-client-module/03_edit_fiscal_data.spec.js @@ -165,31 +165,31 @@ describe('Client Edit fiscalData path', () => { it('should confirm its name have been edited', async() => { await page.waitToClick(selectors.clientFiscalData.fiscalDataButton); - const result = await page.waitToGetProperty(selectors.clientFiscalData.socialNameInput, 'value'); + const result = await page.waitToGetProperty(`${selectors.clientFiscalData.socialNameInput} input`, 'value'); expect(result).toEqual('SMASH'); }); it('should confirm the fiscal id have been edited', async() => { - const result = await page.waitToGetProperty(selectors.clientFiscalData.fiscalIdInput, 'value'); + const result = await page.waitToGetProperty(`${selectors.clientFiscalData.fiscalIdInput} input`, 'value'); expect(result).toEqual('94980061C'); }); it('should confirm the address have been edited', async() => { - const result = await page.waitToGetProperty(selectors.clientFiscalData.addressInput, 'value'); + const result = await page.waitToGetProperty(`${selectors.clientFiscalData.addressInput} input`, 'value'); expect(result).toEqual('Somewhere edited'); }); it('should confirm the postcode have been edited', async() => { - const result = await page.waitToGetProperty(`${selectors.clientFiscalData.postcodeInput}`, 'value'); + const result = await page.waitToGetProperty(`${selectors.clientFiscalData.postcodeInput} input`, 'value'); expect(result).toContain('46000'); }); it('should confirm the city have been autocompleted', async() => { - const result = await page.waitToGetProperty(`${selectors.clientFiscalData.cityInput}`, 'value'); + const result = await page.waitToGetProperty(`${selectors.clientFiscalData.cityInput} input`, 'value'); expect(result).toEqual('Valencia'); }); diff --git a/e2e/paths/02-client-module/04_edit_billing_data.spec.js b/e2e/paths/02-client-module/04_edit_billing_data.spec.js index 2450c1126..eac256db6 100644 --- a/e2e/paths/02-client-module/04_edit_billing_data.spec.js +++ b/e2e/paths/02-client-module/04_edit_billing_data.spec.js @@ -35,7 +35,7 @@ describe('Client Edit billing data path', () => { await page.write(selectors.clientBillingData.newBankEntityCode, '9999'); await page.write(selectors.clientBillingData.newBankEntityBIC, 'GTHMCT'); await page.waitToClick(selectors.clientBillingData.acceptBankEntityButton); - await page.waitForTextInInput(`${selectors.clientBillingData.swiftBicAutocomplete} input`, 'Gotham City Bank'); + await page.waitForTextInInput(selectors.clientBillingData.swiftBicAutocomplete, 'Gotham City Bank'); let newcode = await page.waitToGetProperty(`${selectors.clientBillingData.swiftBicAutocomplete} input`, 'value'); expect(newcode).toEqual('GTHMCT Gotham City Bank'); @@ -51,7 +51,7 @@ describe('Client Edit billing data path', () => { await page.write(selectors.clientBillingData.IBANInput, 'ES9121000418450200051332'); await page.keyboard.press('Tab'); await page.keyboard.press('Tab'); - await page.waitForTextInInput(`${selectors.clientBillingData.swiftBicAutocomplete} input`, 'caixesbb'); + await page.waitForTextInInput(selectors.clientBillingData.swiftBicAutocomplete, 'caixesbb'); let automaticCode = await page.waitToGetProperty(`${selectors.clientBillingData.swiftBicAutocomplete} input`, 'value'); expect(automaticCode).toEqual('CAIXESBB Caixa Bank'); @@ -66,13 +66,13 @@ describe('Client Edit billing data path', () => { }); it('should confirm the due day have been edited', async() => { - let dueDate = await page.waitToGetProperty(selectors.clientBillingData.dueDayInput, 'value'); + let dueDate = await page.waitToGetProperty(`${selectors.clientBillingData.dueDayInput} input`, 'value'); expect(dueDate).toEqual('60'); }); it('should confirm the IBAN was saved', async() => { - let IBAN = await page.waitToGetProperty(selectors.clientBillingData.IBANInput, 'value'); + let IBAN = await page.waitToGetProperty(`${selectors.clientBillingData.IBANInput} input`, 'value'); expect(IBAN).toEqual('ES9121000418450200051332'); }); diff --git a/e2e/paths/02-client-module/05_add_address.spec.js b/e2e/paths/02-client-module/05_add_address.spec.js index 4b015a0b9..fb7e8815d 100644 --- a/e2e/paths/02-client-module/05_add_address.spec.js +++ b/e2e/paths/02-client-module/05_add_address.spec.js @@ -40,13 +40,13 @@ describe('Client Add address path', () => { }); it('should confirm the postcode have been edited', async() => { - const result = await page.waitToGetProperty(`${selectors.clientAddresses.postcodeInput}`, 'value'); + const result = await page.waitToGetProperty(`${selectors.clientAddresses.postcodeInput} input`, 'value'); expect(result).toContain('46000'); }); it('should confirm the city have been autocompleted', async() => { - const result = await page.waitToGetProperty(`${selectors.clientAddresses.cityInput}`, 'value'); + const result = await page.waitToGetProperty(`${selectors.clientAddresses.cityInput} input`, 'value'); expect(result).toEqual('Valencia'); }); diff --git a/e2e/paths/02-client-module/07_edit_web_access.spec.js b/e2e/paths/02-client-module/07_edit_web_access.spec.js index 930cac226..066eb3330 100644 --- a/e2e/paths/02-client-module/07_edit_web_access.spec.js +++ b/e2e/paths/02-client-module/07_edit_web_access.spec.js @@ -35,7 +35,7 @@ describe('Client Edit web access path', () => { }); it('should confirm web access name have been updated', async() => { - const result = await page.waitToGetProperty(selectors.clientWebAccess.userNameInput, 'value'); + const result = await page.waitToGetProperty(`${selectors.clientWebAccess.userNameInput} input`, 'value'); expect(result).toEqual('Hulk'); }); diff --git a/e2e/paths/02-client-module/08_add_notes.spec.js b/e2e/paths/02-client-module/08_add_notes.spec.js index fc421df7e..b80cc0668 100644 --- a/e2e/paths/02-client-module/08_add_notes.spec.js +++ b/e2e/paths/02-client-module/08_add_notes.spec.js @@ -23,7 +23,8 @@ describe('Client Add notes path', () => { }); it(`should create a note`, async() => { - await page.write(selectors.clientNotes.noteInput, 'Meeting with Black Widow 21st 9am'); + await page.waitFor(selectors.clientNotes.noteInput); + await page.type(`${selectors.clientNotes.noteInput} textarea`, 'Meeting with Black Widow 21st 9am'); await page.waitToClick(selectors.clientNotes.saveButton); const result = await page.waitForLastSnackbar(); diff --git a/e2e/paths/02-client-module/12_lock_of_verified_data.spec.js b/e2e/paths/02-client-module/12_lock_of_verified_data.spec.js index c1b12cc0c..7d5176076 100644 --- a/e2e/paths/02-client-module/12_lock_of_verified_data.spec.js +++ b/e2e/paths/02-client-module/12_lock_of_verified_data.spec.js @@ -35,7 +35,7 @@ describe('Client lock verified data path', () => { it('should confirm the social name have been edited', async() => { await page.reloadSection('client.card.fiscalData'); - const result = await page.waitToGetProperty(selectors.clientFiscalData.socialNameInput, 'value'); + const result = await page.waitToGetProperty(`${selectors.clientFiscalData.socialNameInput} input`, 'value'); expect(result).toEqual('Captain America Civil War'); }); @@ -81,7 +81,7 @@ describe('Client lock verified data path', () => { it('should again confirm the social name have been edited', async() => { await page.reloadSection('client.card.fiscalData'); - const result = await page.waitToGetProperty(selectors.clientFiscalData.socialNameInput, 'value'); + const result = await page.waitToGetProperty(`${selectors.clientFiscalData.socialNameInput} input`, 'value'); expect(result).toEqual('Ant man and the Wasp'); }); @@ -126,6 +126,7 @@ describe('Client lock verified data path', () => { it('should now edit the social name', async() => { await page.clearInput(selectors.clientFiscalData.socialNameInput); + await page.waitFor(100); await page.write(selectors.clientFiscalData.socialNameInput, 'new social name edition'); await page.waitToClick(selectors.clientFiscalData.saveButton); const result = await page.waitForLastSnackbar(); @@ -135,7 +136,7 @@ describe('Client lock verified data path', () => { it('should now confirm the social name have been edited once and for all', async() => { await page.reloadSection('client.card.fiscalData'); - const result = await page.waitToGetProperty(selectors.clientFiscalData.socialNameInput, 'value'); + const result = await page.waitToGetProperty(`${selectors.clientFiscalData.socialNameInput} input`, 'value'); expect(result).toEqual('new social name edition'); }); diff --git a/e2e/paths/02-client-module/14_balance.spec.js b/e2e/paths/02-client-module/14_balance.spec.js index c6dd0473d..019840e67 100644 --- a/e2e/paths/02-client-module/14_balance.spec.js +++ b/e2e/paths/02-client-module/14_balance.spec.js @@ -1,7 +1,7 @@ import selectors from '../../helpers/selectors.js'; import openPage from '../../helpers/puppeteer'; -fdescribe('Client balance path', () => { +describe('Client balance path', () => { let page; beforeAll(async() => { page = await openPage(); @@ -39,6 +39,7 @@ fdescribe('Client balance path', () => { it('should click the new payment button', async() => { await page.keyboard.press('Escape'); await page.reloadSection('client.card.balance.index'); + await page.waitFor(1000); await page.waitToClick(selectors.clientBalance.newPaymentButton); await page.waitForURL('/balance'); let url = await page.parsedUrl(); @@ -77,6 +78,7 @@ fdescribe('Client balance path', () => { }); it('should create a new payment that sets the balance to positive value', async() => { + await page.waitFor(1000); await page.clearInput(selectors.clientBalance.newPaymentAmountInput); await page.write(selectors.clientBalance.newPaymentAmountInput, '100'); await page.waitToClick(selectors.clientBalance.saveButton); @@ -94,7 +96,7 @@ fdescribe('Client balance path', () => { it('should create a new payment that sets the balance back to the original negative value', async() => { await page.waitToClick(selectors.clientBalance.newPaymentButton); - await page.waitFor(4000); + await page.waitFor(1000); await page.clearInput(selectors.clientBalance.newPaymentAmountInput); await page.write(selectors.clientBalance.newPaymentAmountInput, '-150'); await page.waitToClick(selectors.clientBalance.saveButton); diff --git a/gulpfile.js b/gulpfile.js index e8daac5b1..72dc514df 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -208,8 +208,8 @@ function e2eSingleRun() { const specFiles = [ `${__dirname}/e2e/paths/01*/*[sS]pec.js`, `${__dirname}/e2e/paths/02*/*[sS]pec.js`, - // `${__dirname}/e2e/paths/03*/*[sS]pec.js`, - // `${__dirname}/e2e/paths/04*/*[sS]pec.js`, + `${__dirname}/e2e/paths/03*/*[sS]pec.js`, + `${__dirname}/e2e/paths/04*/*[sS]pec.js`, // `${__dirname}/e2e/paths/05*/*[sS]pec.js`, // `${__dirname}/e2e/paths/06*/*[sS]pec.js`, // `${__dirname}/e2e/paths/07*/*[sS]pec.js`,