diff --git a/e2e/helpers/extensions.js b/e2e/helpers/extensions.js index abdb637e3..9562ec641 100644 --- a/e2e/helpers/extensions.js +++ b/e2e/helpers/extensions.js @@ -75,7 +75,7 @@ let actions = { }, changeLanguageToEnglish: function(done) { - let langSelector = 'vn-user-configuration-popover vn-autocomplete[field="$ctrl.lang"]'; + let langSelector = '.user-configuration vn-autocomplete[field="$ctrl.lang"]'; this.waitToClick('#user') .wait(langSelector) @@ -180,6 +180,7 @@ let actions = { .evaluate_now(elementSelector => { const selectorMatches = document.querySelectorAll(elementSelector); const element = selectorMatches[0]; + if (selectorMatches.length > 1) throw new Error(`multiple matches of ${elementSelector} found`); @@ -190,17 +191,18 @@ let actions = { isVisible = true; }; element.addEventListener('mouseover', eventHandler); - const elementBoundaries = element.getBoundingClientRect(); - const x = elementBoundaries.left + element.offsetWidth / 2; - const y = elementBoundaries.top + element.offsetHeight / 2; + const rect = element.getBoundingClientRect(); + const x = rect.left + rect.width / 2; + const y = rect.top + rect.height / 2; const elementInCenter = document.elementFromPoint(x, y); - const elementInTopLeft = document.elementFromPoint(elementBoundaries.left, elementBoundaries.top); - const elementInBottomRight = document.elementFromPoint(elementBoundaries.right, elementBoundaries.bottom); + const elementInTopLeft = document.elementFromPoint(rect.left, rect.top); + const elementInBottomRight = document.elementFromPoint(rect.right, rect.bottom); const e = new MouseEvent('mouseover', { view: window, bubbles: true, cancelable: true, }); + if (elementInCenter) elementInCenter.dispatchEvent(e); @@ -401,10 +403,12 @@ let actions = { autocompleteSearch: function(autocompleteSelector, searchValue, done) { this.wait(`${autocompleteSelector} input`) .waitToClick(`${autocompleteSelector} input`) - .write(`${autocompleteSelector} vn-drop-down input`, searchValue) - .waitToClick(`${autocompleteSelector} li.active`) + .write(`.vn-popover.shown .vn-drop-down input`, searchValue) + .waitToClick(`.vn-popover.shown .vn-drop-down li.active`) .wait((autocompleteSelector, searchValue) => { - return document.querySelector(`${autocompleteSelector} input`).value.toLowerCase().includes(searchValue.toLowerCase()); + return document.querySelector(`${autocompleteSelector} input`).value + .toLowerCase() + .includes(searchValue.toLowerCase()); }, autocompleteSelector, searchValue) .then(done) .catch(() => { @@ -412,6 +416,17 @@ let actions = { }); }, + pickTime: function(selector, time, done) { + this.wait(selector) + .evaluate((selector, time) => { + let input = document.querySelector(selector); + input.value = time; + input.dispatchEvent(new Event('change')); + }, selector, time) + .then(done) + .catch(done); + }, + datePicker: function(datePickerSelector, changeMonth, day, done) { this.wait(datePickerSelector) .mousedown(datePickerSelector) diff --git a/e2e/helpers/selectors.js b/e2e/helpers/selectors.js index 9be6bc0dd..2b364d681 100644 --- a/e2e/helpers/selectors.js +++ b/e2e/helpers/selectors.js @@ -3,19 +3,19 @@ import components from './components_selectors.js'; export default { globalItems: { applicationsMenuButton: '#apps', - applicationsMenuVisible: 'vn-main-menu [vn-id="apps-menu"] ul', - clientsButton: 'vn-main-menu [vn-id="apps-menu"] ul > li[ui-sref="client.index"]', - itemsButton: 'vn-main-menu [vn-id="apps-menu"] ul > li[ui-sref="item.index"]', - ticketsButton: 'vn-main-menu [vn-id="apps-menu"] ul > li[ui-sref="ticket.index"]', - invoiceOutButton: 'vn-main-menu [vn-id="apps-menu"] ul > li[ui-sref="invoiceOut.index"]', - claimsButton: 'vn-main-menu [vn-id="apps-menu"] ul > li[ui-sref="claim.index"]', + applicationsMenuVisible: '.modules-menu', + clientsButton: '.modules-menu > li[ui-sref="client.index"]', + itemsButton: '.modules-menu > li[ui-sref="item.index"]', + ticketsButton: '.modules-menu > li[ui-sref="ticket.index"]', + invoiceOutButton: '.modules-menu > li[ui-sref="invoiceOut.index"]', + claimsButton: '.modules-menu > li[ui-sref="claim.index"]', returnToModuleIndexButton: 'a[ui-sref="order.index"]', userMenuButton: 'vn-topbar #user', - userLocalWarehouse: 'vn-topbar vn-popover vn-autocomplete[field="$ctrl.localWarehouseFk"]', - userLocalBank: 'vn-topbar vn-popover vn-autocomplete[field="$ctrl.localBankFk"]', - userLocalCompany: 'vn-topbar vn-popover vn-autocomplete[field="$ctrl.localCompanyFk"]', - userWarehouse: 'vn-topbar vn-popover vn-autocomplete[field="$ctrl.warehouseFk"]', - userCompany: 'vn-topbar vn-popover vn-autocomplete[field="$ctrl.companyFk"]', + userLocalWarehouse: '.user-configuration vn-autocomplete[field="$ctrl.localWarehouseFk"]', + userLocalBank: '.user-configuration vn-autocomplete[field="$ctrl.localBankFk"]', + userLocalCompany: '.user-configuration vn-autocomplete[field="$ctrl.localCompanyFk"]', + userWarehouse: '.user-configuration vn-autocomplete[field="$ctrl.warehouseFk"]', + userCompany: '.user-configuration vn-autocomplete[field="$ctrl.companyFk"]', userConfigFirstAutocompleteClear: '#localWarehouse > div > div > div > vn-icon.clear', userConfigSecondAutocompleteClear: '#localBank > div > div > div > vn-icon.clear', userConfigThirdAutocompleteClear: '#localCompany > div > div > div > vn-icon.clear', @@ -45,7 +45,7 @@ export default { }, clientDescriptor: { moreMenu: 'vn-client-descriptor vn-icon-menu > div > vn-icon', - simpleTicketButton: 'vn-client-descriptor vn-popover > div > div.content > div > div.list > ul > li' + simpleTicketButton: '.vn-popover.shown .vn-drop-down li' }, clientBasicData: { basicDataButton: 'vn-left-menu a[ui-sref="client.card.basicData"]', @@ -177,7 +177,7 @@ export default { dms: { deleteFileButton: 'vn-client-dms-index vn-table vn-tr:nth-child(1) vn-icon-button[icon="delete"]', firstDocWorker: 'vn-client-dms-index vn-table > div > vn-tbody > vn-tr > vn-td:nth-child(8) > span', - firstDocWorkerDescriptor: 'vn-client-dms-index > vn-worker-descriptor-popover > vn-popover', + firstDocWorkerDescriptor: '.vn-popover.shown vn-worker-descriptor', acceptDeleteButton: 'vn-client-dms-index > vn-confirm button[response="ACCEPT"]' }, itemsIndex: { @@ -218,7 +218,7 @@ export default { itemDescriptor: { goBackToModuleIndexButton: 'vn-item-descriptor a[href="#!/item/index"]', moreMenu: 'vn-item-descriptor vn-icon-menu > div > vn-icon', - moreMenuRegularizeButton: 'vn-item-descriptor vn-drop-down > vn-popover ul > li[name="Regularize stock"]', + moreMenuRegularizeButton: '.vn-popover.shown .vn-drop-down li[name="Regularize stock"]', regularizeQuantityInput: 'vn-item-descriptor > vn-dialog > div > form > div.body > tpl-body > div > vn-textfield > div > div > div.infix > input', regularizeWarehouseAutocomplete: 'vn-item-descriptor vn-dialog vn-autocomplete[field="$ctrl.warehouseFk"]', editButton: 'vn-item-card vn-item-descriptor vn-float-button[icon="edit"]', @@ -313,10 +313,10 @@ export default { total: 'vn-ticket-summary vn-one.taxes > p:nth-child(3) > strong', sale: 'vn-ticket-summary [name="sales"] vn-table > div > vn-tbody > vn-tr', firstSaleItemId: 'vn-ticket-summary [name="sales"] vn-table > div > vn-tbody > vn-tr > vn-td:nth-child(2) > span', - firstSaleDescriptorImage: 'vn-ticket-summary vn-item-descriptor-popover > vn-popover vn-item-descriptor img', - itemDescriptorPopover: 'vn-ticket-summary vn-item-descriptor-popover > vn-popover', - itemDescriptorPopoverItemDiaryButton: 'vn-ticket-summary > vn-item-descriptor-popover a[href="#!/item/2/diary?warehouseFk=5&ticketFk=20"]', - popoverDiaryButton: 'vn-ticket-summary vn-item-descriptor-popover vn-item-descriptor vn-icon[icon="icon-transaction"]', + firstSaleDescriptorImage: '.vn-popover.shown vn-item-descriptor img', + itemDescriptorPopover: '.vn-popover.shown vn-item-descriptor', + itemDescriptorPopoverItemDiaryButton: 'vn-item-descriptor a[href="#!/item/2/diary?warehouseFk=5&ticketFk=20"]', + popoverDiaryButton: '.vn-popover.shown vn-item-descriptor vn-icon[icon="icon-transaction"]', firstSaleQuantity: 'vn-ticket-summary [name="sales"] vn-table > div > vn-tbody > vn-tr > vn-td:nth-child(3)', firstSaleDiscount: 'vn-ticket-summary [name="sales"] vn-table > div > vn-tbody > vn-tr > vn-td:nth-child(6)', invoiceOutRef: 'vn-ticket-summary > vn-card > div > vn-horizontal > vn-one:nth-child(1) > vn-label-value:nth-child(6) > section > span', @@ -324,7 +324,7 @@ export default { }, ticketsIndex: { openAdvancedSearchButton: 'vn-ticket-index vn-searchbar t-right-icons > vn-icon[icon="keyboard_arrow_down"]', - advancedSearchInvoiceOut: 'vn-ticket-index vn-searchbar vn-ticket-search-panel vn-textfield[model="filter.refFk"] input', + advancedSearchInvoiceOut: 'vn-ticket-search-panel vn-textfield[model="filter.refFk"] input', newTicketButton: 'vn-ticket-index > a', searchResult: 'vn-ticket-index vn-card > div > vn-table > div > vn-tbody > a.vn-tr', searchWeeklyResult: 'vn-ticket-weekly-index vn-table vn-tbody > vn-tr', @@ -332,11 +332,11 @@ export default { searchTicketInput: `vn-ticket-index ${components.vnTextfield}`, searchWeeklyTicketInput: `vn-ticket-weekly-index ${components.vnTextfield}`, searchWeeklyClearInput: 'vn-ticket-weekly-index vn-searchbar i[class="material-icons clear"]', - advancedSearchButton: 'vn-ticket-index vn-searchbar > vn-popover vn-ticket-search-panel vn-submit[label="Search"] input', + advancedSearchButton: 'vn-ticket-search-panel vn-submit[label="Search"] input', searchButton: 'vn-ticket-index vn-searchbar vn-icon[icon="search"]', searchWeeklyButton: 'vn-ticket-weekly-index vn-searchbar vn-icon[icon="search"]', moreMenu: 'vn-ticket-index vn-icon-menu[vn-id="more-button"] > div > vn-icon', - moreMenuWeeklyTickets: 'vn-ticket-index vn-icon-menu vn-drop-down > vn-popover li:nth-child(2)', + moreMenuWeeklyTickets: '.vn-popover.shown .vn-drop-down li:nth-child(2)', sixthWeeklyTicket: 'vn-ticket-weekly-index vn-table vn-tr:nth-child(6) vn-autocomplete[field="weekly.weekDay"] input', weeklyTicket: 'vn-ticket-weekly-index vn-table > div > vn-tbody > vn-tr', firstWeeklyTicketDeleteIcon: 'vn-ticket-weekly-index vn-tr:nth-child(1) vn-icon-button[icon="delete"]', @@ -355,13 +355,13 @@ export default { stateLabelValue: 'vn-ticket-descriptor vn-label-value[label="State"]', goBackToModuleIndexButton: 'vn-ticket-descriptor a[ui-sref="ticket.index"]', moreMenu: 'vn-ticket-descriptor vn-icon-menu > div > vn-icon', - moreMenuAddStowaway: 'vn-ticket-descriptor vn-drop-down > vn-popover ul > li[name="Add stowaway"]', - moreMenuDeleteStowawayButton: 'vn-ticket-descriptor vn-drop-down > vn-popover ul > li[name="Remove stowaway"]', - moreMenuAddToTurn: 'vn-ticket-descriptor vn-drop-down > vn-popover ul > li[name="Add turn"]', - moreMenuDeleteTicket: 'vn-ticket-descriptor vn-drop-down > vn-popover ul > li[name="Delete ticket"]', - moreMenuMakeInvoice: 'vn-ticket-descriptor vn-drop-down > vn-popover ul > li[name="Make invoice"]', - moreMenuChangeShippedHour: 'vn-ticket-descriptor vn-drop-down > vn-popover ul > li[name="Change shipped hour"]', - changeShippedHourInput: 'vn-ticket-descriptor > vn-dialog.ng-isolate-scope.vn-dialog.shown vn-input-time input', + moreMenuAddStowaway: '.vn-popover.shown .vn-drop-down li[name="Add stowaway"]', + moreMenuDeleteStowawayButton: '.vn-popover.shown .vn-drop-down li[name="Remove stowaway"]', + moreMenuAddToTurn: '.vn-popover.shown .vn-drop-down li[name="Add turn"]', + moreMenuDeleteTicket: '.vn-popover.shown .vn-drop-down li[name="Delete ticket"]', + moreMenuMakeInvoice: '.vn-popover.shown .vn-drop-down li[name="Make invoice"]', + moreMenuChangeShippedHour: '.vn-popover.shown .vn-drop-down li[name="Change shipped hour"]', + changeShippedHourInput: 'vn-ticket-descriptor .vn-dialog.shown vn-input-time input', addStowawayDialogFirstTicket: 'vn-ticket-descriptor > vn-add-stowaway > vn-dialog vn-table vn-tbody vn-tr', shipButton: 'vn-ticket-descriptor > div > div.body > div.quicklinks vn-icon[icon="icon-stowaway"]', thursdayButton: 'vn-ticket-descriptor > vn-dialog > div > form > div.body > tpl-body > div > vn-tool-bar > vn-button:nth-child(4)', @@ -398,21 +398,21 @@ export default { ticketSales: { saleButton: 'vn-left-menu a[ui-sref="ticket.card.sale"]', saleLine: 'vn-table div > vn-tbody > vn-tr', - saleDescriptorPopover: 'vn-ticket-sale vn-item-descriptor-popover > vn-popover', - saleDescriptorPopoverSummaryButton: 'vn-item-descriptor-popover a[ui-sref="item.card.summary({id: $ctrl.item.id})"]', + saleDescriptorPopover: '.vn-popover.shown vn-item-descriptor', + saleDescriptorPopoverSummaryButton: '.vn-popover.shown vn-item-descriptor a[ui-sref="item.card.summary({id: $ctrl.item.id})"]', descriptorItemDiaryButton: 'vn-item-descriptor .quicklinks.ng-scope > vn-horizontal > a > vn-icon > i', newItemFromCatalogButton: 'vn-ticket-sale vn-float-button[icon="add"]', newItemButton: 'vn-ticket-sale > vn-vertical > vn-card > div > vn-vertical > vn-one > vn-icon-button > button > vn-icon > i', moreMenu: 'vn-ticket-sale vn-tool-bar > vn-button-menu[vn-id="more-button"] > div > button', - moreMenuCreateClaim: 'vn-ticket-sale vn-tool-bar > vn-button-menu[vn-id="more-button"] vn-drop-down > vn-popover ul > li[name="Add claim"]', - moreMenuReserve: 'vn-ticket-sale vn-tool-bar > vn-button-menu[vn-id="more-button"] vn-drop-down > vn-popover ul > li[name="Mark as reserved"]', - moreMenuUnmarkReseved: 'vn-ticket-sale vn-tool-bar > vn-button-menu[vn-id="more-button"] vn-drop-down > vn-popover ul > li[name="Unmark as reserved"]', - moreMenuUpdateDiscount: 'vn-ticket-sale vn-tool-bar > vn-button-menu[vn-id="more-button"] vn-drop-down > vn-popover ul > li[name="Update discount"]', + moreMenuCreateClaim: '.vn-popover.shown .vn-drop-down li[name="Add claim"]', + moreMenuReserve: '.vn-popover.shown .vn-drop-down li[name="Mark as reserved"]', + moreMenuUnmarkReseved: '.vn-popover.shown .vn-drop-down li[name="Unmark as reserved"]', + moreMenuUpdateDiscount: '.vn-popover.shown .vn-drop-down li[name="Update discount"]', moreMenuUpdateDiscountInput: 'vn-ticket-sale vn-dialog form vn-ticket-sale-edit-discount vn-input-number[model="$ctrl.newDiscount"] input', - transferQuantityInput: 'vn-ticket-sale vn-popover.transfer.ng-isolate-scope.vn-popover.shown vn-table > div > vn-tbody > vn-tr > vn-td-editable > span > text', - transferQuantityCell: 'vn-ticket-sale vn-popover.transfer.ng-isolate-scope.vn-popover.shown vn-table > div > vn-tbody > vn-tr > vn-td-editable', + 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"]', - firstSaleDescriptorImage: 'vn-ticket-sale vn-item-descriptor-popover > vn-popover vn-item-descriptor img', + firstSaleDescriptorImage: '.vn-popover.shown vn-item-descriptor img', 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', @@ -421,9 +421,9 @@ export default { firstSaleQuantityClearInput: 'vn-textfield[model="sale.quantity"] div.suffix > i', firstSaleIdInput: 'body > vn-app > div > ui-view > vn-ticket-card > vn-main-block > div > vn-ticket-sale > vn-vertical > vn-card > div > vn-vertical > vn-table > div > vn-tbody > vn-tr:nth-child(1) > vn-td:nth-child(4) > vn-autocomplete > div > div > input', firstSaleIdAutocomplete: 'vn-ticket-sale > vn-vertical > vn-card > div > vn-vertical > vn-table > div > vn-tbody > vn-tr:nth-child(1) > vn-td:nth-child(4) > vn-autocomplete', - idAutocompleteFirstResult: 'vn-ticket-sale > vn-vertical > vn-card > div > vn-vertical > vn-table > div > vn-tbody > vn-tr:nth-child(2) > vn-td:nth-child(4) > vn-autocomplete > vn-drop-down > vn-popover > div > div.content > div > div.list > ul > li', + idAutocompleteFirstResult: '.vn-popover.shown .vn-drop-down li', firstSalePrice: 'vn-ticket-sale vn-table vn-tr:nth-child(1) > vn-td:nth-child(7) > span', - firstSalePriceInput: 'vn-ticket-sale:nth-child(1) vn-popover.edit.dialog-summary.ng-isolate-scope.vn-popover.shown vn-input-number input', + firstSalePriceInput: '.vn-popover.shown vn-input-number input', firstSaleDiscount: 'vn-ticket-sale vn-table vn-tr:nth-child(1) > vn-td:nth-child(8) > span', firstSaleDiscountInput: 'vn-ticket-sale:nth-child(1) vn-ticket-sale-edit-discount vn-input-number input', firstSaleImport: 'vn-ticket-sale:nth-child(1) vn-td:nth-child(9)', @@ -449,10 +449,10 @@ export default { thirdSaleCheckbox: 'vn-ticket-sale vn-tr:nth-child(3) vn-check[field="sale.checked"] md-checkbox', 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-ticket-sale vn-popover.transfer vn-textfield[model="$ctrl.transfer.ticketId"] input', - moveToTicketInputClearButton: 'vn-popover.shown i[title="Clear"]', - moveToTicketButton: 'vn-ticket-sale vn-popover.transfer vn-icon[icon="arrow_forward_ios"]', - moveToNewTicketButton: 'vn-ticket-sale vn-popover.transfer vn-button[label="New ticket"]', + moveToTicketInput: '.vn-popover.shown vn-textfield[model="$ctrl.transfer.ticketId"] input', + 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"]', acceptDeleteLineButton: 'vn-ticket-sale > vn-confirm[vn-id="delete-lines"] button[response=ACCEPT]', acceptDeleteTicketButton: 'vn-ticket-sale > vn-confirm[vn-id="delete-ticket"] button[response=ACCEPT]', stateMenuButton: 'vn-ticket-sale vn-tool-bar > vn-button-menu[label="State"]' @@ -524,7 +524,7 @@ export default { }, claimDescriptor: { moreMenu: 'vn-claim-descriptor vn-icon-menu[vn-id="more-button"]', - moreMenuDeleteClaim: 'vn-claim-descriptor vn-icon-menu vn-drop-down li[name="Delete claim"]', + moreMenuDeleteClaim: '.vn-popover.shown .vn-drop-down li[name="Delete claim"]', acceptDeleteClaim: 'vn-claim-descriptor > vn-confirm[vn-id="confirm-delete-claim"] button[response="ACCEPT"]' }, claimSummary: { @@ -532,13 +532,13 @@ export default { state: 'vn-claim-summary vn-label-value[label="State"] > section > span', observation: 'vn-claim-summary vn-textarea[model="$ctrl.summary.claim.observation"] > div > textarea', firstSaleItemId: 'vn-claim-summary vn-horizontal > vn-auto:nth-child(4) > vn-table > div > vn-tbody > vn-tr:nth-child(1) > vn-td:nth-child(1) > span', - firstSaleDescriptorImage: 'vn-claim-summary vn-item-descriptor-popover > vn-popover vn-item-descriptor img', - itemDescriptorPopover: 'vn-claim-summary vn-item-descriptor-popover > vn-popover', - itemDescriptorPopoverItemDiaryButton: 'vn-claim-summary > vn-item-descriptor-popover a[href="#!/item/2/diary"]', + firstSaleDescriptorImage: '.vn-popover.shown vn-item-descriptor img', + itemDescriptorPopover: '.vn-popover.shown vn-item-descriptor', + itemDescriptorPopoverItemDiaryButton: '.vn-popover.shown vn-item-descriptor a[href="#!/item/2/diary"]', firstDevelopmentWorker: 'vn-claim-summary vn-horizontal > vn-auto:nth-child(5) > vn-table > div > vn-tbody > vn-tr:nth-child(1) > vn-td:nth-child(4) > span', - firstDevelopmentWorkerGoToClientButton: 'vn-claim-summary > vn-worker-descriptor-popover > vn-popover vn-worker-descriptor div.quicklinks > a[href="#!/client/21/summary"]', + firstDevelopmentWorkerGoToClientButton: '.vn-popover.shown vn-worker-descriptor div.quicklinks > a[href="#!/client/21/summary"]', firstActionTicketId: 'vn-claim-summary > vn-card > div > vn-horizontal > vn-auto:nth-child(6) > vn-table > div > vn-tbody > vn-tr > vn-td:nth-child(2) > span', - firstActionTicketDescriptor: 'vn-claim-summary > vn-ticket-descriptor-popover > vn-popover > div > div.content > vn-ticket-descriptor' + firstActionTicketDescriptor: '.vn-popover.shown vn-ticket-descriptor' }, claimBasicData: { claimStateAutocomplete: 'vn-claim-basic-data vn-autocomplete[field="$ctrl.claim.claimStateFk"]', @@ -548,8 +548,8 @@ export default { }, claimDetail: { secondItemDiscount: 'vn-claim-detail > vn-vertical > vn-card > div > vn-vertical > vn-table > div > vn-tbody > vn-tr:nth-child(2) > vn-td:nth-child(6) > span', - discountInput: 'vn-claim-detail vn-popover vn-input-number[model="$ctrl.newDiscount"] > div > div > div.infix > input', - discoutPopoverMana: 'vn-claim-detail > vn-popover > div > div.content > div > vn-horizontal > h5', + discountInput: '.vn-popover.shown vn-input-number[model="$ctrl.newDiscount"] > div > div > div.infix > input', + discoutPopoverMana: '.vn-popover.shown .content > div > vn-horizontal > h5', addItemButton: 'vn-claim-detail a vn-float-button', firstClaimableSaleFromTicket: 'vn-claim-detail > vn-dialog vn-tbody > vn-tr', claimDetailLine: 'vn-claim-detail > vn-vertical > vn-card > div > vn-vertical > vn-table > div > vn-tbody > vn-tr', @@ -575,7 +575,7 @@ export default { claimAction: { importClaimButton: 'vn-claim-action vn-button[label="Import claim"]', importTicketButton: 'vn-claim-action vn-button[label="Import ticket"]', - secondImportableTicket: 'vn-claim-action > vn-vertical > vn-popover > div > div.content > div > vn-table > div > vn-tbody > vn-tr:nth-child(2)', + secondImportableTicket: '.vn-popover.shown .content > div > vn-table > div > vn-tbody > vn-tr:nth-child(2)', firstLineDestination: 'vn-claim-action vn-tr:nth-child(1) vn-autocomplete[field="saleClaimed.claimDestinationFk"]', secondLineDestination: 'vn-claim-action vn-tr:nth-child(2) vn-autocomplete[field="saleClaimed.claimDestinationFk"]', firstDeleteLine: 'vn-claim-action vn-tr:nth-child(1) vn-icon-button[icon="delete"]', @@ -608,9 +608,9 @@ export default { itemIdInput: 'vn-order-catalog > vn-side-menu vn-catalog-filter vn-textfield[model="$ctrl.itemFk"] input', itemTagValueInput: 'vn-order-catalog > vn-side-menu vn-catalog-filter vn-textfield[model="$ctrl.value"] input', openTagSearch: 'vn-order-catalog > vn-side-menu > div > vn-catalog-filter > div > vn-vertical > vn-textfield[model="$ctrl.value"] > div > div > div.rightIcons > t-right-icons > i', - tagAutocomplete: 'vn-order-catalog > vn-side-menu vn-catalog-filter vn-popover vn-order-catalog-search-panel vn-autocomplete[field="filter.tagFk"]', - tagValueInput: 'vn-order-catalog > vn-side-menu vn-catalog-filter vn-popover vn-order-catalog-search-panel vn-textfield[model="filter.value"] input', - searchTagButton: 'vn-order-catalog > vn-side-menu vn-catalog-filter vn-popover vn-order-catalog-search-panel > div > form > vn-horizontal:nth-child(3) > vn-submit > input', + tagAutocomplete: 'vn-order-catalog-search-panel vn-autocomplete[field="filter.tagFk"]', + tagValueInput: 'vn-order-catalog-search-panel vn-textfield[model="filter.value"] input', + searchTagButton: 'vn-order-catalog-search-panel > div > form > vn-horizontal:nth-child(3) > vn-submit > input', thirdFilterRemoveButton: 'vn-order-catalog > vn-side-menu vn-catalog-filter > div > vn-horizontal.chips > vn-chip:nth-child(3) button', fourthFilterRemoveButton: 'vn-order-catalog > vn-side-menu vn-catalog-filter > div > vn-horizontal.chips > vn-chip:nth-child(4) button', }, @@ -727,9 +727,9 @@ export default { }, invoiceOutDescriptor: { moreMenu: 'vn-invoice-out-descriptor vn-icon-menu[vn-id="more-button"]', - moreMenuDeleteInvoiceOut: 'vn-invoice-out-descriptor vn-popover li[name="Delete Invoice"]', - moreMenuBookInvoiceOut: 'vn-invoice-out-descriptor vn-popover li[name="Book invoice"]', - moreMenuShowInvoiceOutPdf: 'vn-invoice-out-descriptor vn-popover li[name="Show invoice PDF"]', + moreMenuDeleteInvoiceOut: '.vn-popover.shown .vn-drop-down li[name="Delete Invoice"]', + moreMenuBookInvoiceOut: '.vn-popover.shown .vn-drop-down li[name="Book invoice"]', + moreMenuShowInvoiceOutPdf: '.vn-popover.shown .vn-drop-down li[name="Show invoice PDF"]', acceptDeleteButton: 'vn-invoice-out-descriptor > vn-confirm[vn-id="deleteConfirmation"] button[response="ACCEPT"]', acceptBookingButton: 'vn-invoice-out-descriptor > vn-confirm[vn-id="bookConfirmation"] button[response="ACCEPT"]' }, diff --git a/e2e/paths/02-client-module/17_dms.spec.js b/e2e/paths/02-client-module/17_dms.spec.js index 16a061f85..236401cf4 100644 --- a/e2e/paths/02-client-module/17_dms.spec.js +++ b/e2e/paths/02-client-module/17_dms.spec.js @@ -24,7 +24,7 @@ describe('Client DMS', () => { it(`should click on the first document line worker name making the descriptor visible`, async() => { const visible = await nightmare .waitToClick(selectors.dms.firstDocWorker) - .waitForClassPresent(selectors.dms.firstDocWorkerDescriptor, 'shown') + .wait(selectors.dms.firstDocWorkerDescriptor) .isVisible(selectors.dms.firstDocWorkerDescriptor); expect(visible).toBeTruthy(); diff --git a/e2e/paths/03-worker-module/02_time_control.spec.js b/e2e/paths/03-worker-module/02_time_control.spec.js index b6d6d1754..42be3e9e0 100644 --- a/e2e/paths/03-worker-module/02_time_control.spec.js +++ b/e2e/paths/03-worker-module/02_time_control.spec.js @@ -17,8 +17,7 @@ describe('Worker time control path', () => { const scanTime = '07:00'; const result = await nightmare .waitToClick(selectors.workerTimeControl.mondayAddTimeButton) - .clearInput(selectors.workerTimeControl.timeDialogInput) - .write(selectors.workerTimeControl.timeDialogInput, scanTime) + .pickTime(selectors.workerTimeControl.timeDialogInput, scanTime) .waitToClick(selectors.workerTimeControl.confirmButton) .waitToGetProperty(selectors.workerTimeControl.firstEntryOfMonday, 'innerText'); @@ -29,8 +28,7 @@ describe('Worker time control path', () => { const scanTime = '10:00'; const result = await nightmare .waitToClick(selectors.workerTimeControl.mondayAddTimeButton) - .clearInput(selectors.workerTimeControl.timeDialogInput) - .write(selectors.workerTimeControl.timeDialogInput, scanTime) + .pickTime(selectors.workerTimeControl.timeDialogInput, scanTime) .waitToClick(selectors.workerTimeControl.confirmButton) .waitToGetProperty(selectors.workerTimeControl.secondEntryOfMonday, 'innerText'); @@ -41,8 +39,7 @@ describe('Worker time control path', () => { const scanTime = '15:00'; const result = await nightmare .waitToClick(selectors.workerTimeControl.mondayAddTimeButton) - .clearInput(selectors.workerTimeControl.timeDialogInput) - .write(selectors.workerTimeControl.timeDialogInput, scanTime) + .pickTime(selectors.workerTimeControl.timeDialogInput, scanTime) .waitToClick(selectors.workerTimeControl.confirmButton) .waitToGetProperty(selectors.workerTimeControl.thirdEntryOfMonday, 'innerText'); @@ -53,8 +50,7 @@ describe('Worker time control path', () => { const scanTime = '10:20'; const result = await nightmare .waitToClick(selectors.workerTimeControl.mondayAddTimeButton) - .clearInput(selectors.workerTimeControl.timeDialogInput) - .write(selectors.workerTimeControl.timeDialogInput, scanTime) + .pickTime(selectors.workerTimeControl.timeDialogInput, scanTime) .waitToClick(selectors.workerTimeControl.confirmButton) .waitToGetProperty(selectors.workerTimeControl.fourthEntryOfMonday, 'innerText'); @@ -82,8 +78,7 @@ describe('Worker time control path', () => { const scanTime = '08:00'; const result = await nightmare .waitToClick(selectors.workerTimeControl.tuesdayAddTimeButton) - .clearInput(selectors.workerTimeControl.timeDialogInput) - .write(selectors.workerTimeControl.timeDialogInput, scanTime) + .pickTime(selectors.workerTimeControl.timeDialogInput, scanTime) .waitToClick(selectors.workerTimeControl.confirmButton) .waitToGetProperty(selectors.workerTimeControl.firstEntryOfTuesday, 'innerText'); @@ -94,8 +89,7 @@ describe('Worker time control path', () => { const scanTime = '10:00'; const result = await nightmare .waitToClick(selectors.workerTimeControl.tuesdayAddTimeButton) - .clearInput(selectors.workerTimeControl.timeDialogInput) - .write(selectors.workerTimeControl.timeDialogInput, scanTime) + .pickTime(selectors.workerTimeControl.timeDialogInput, scanTime) .waitToClick(selectors.workerTimeControl.confirmButton) .waitToGetProperty(selectors.workerTimeControl.secondEntryOfTuesday, 'innerText'); @@ -106,8 +100,7 @@ describe('Worker time control path', () => { const scanTime = '10:20'; const result = await nightmare .waitToClick(selectors.workerTimeControl.tuesdayAddTimeButton) - .clearInput(selectors.workerTimeControl.timeDialogInput) - .write(selectors.workerTimeControl.timeDialogInput, scanTime) + .pickTime(selectors.workerTimeControl.timeDialogInput, scanTime) .waitToClick(selectors.workerTimeControl.confirmButton) .waitToGetProperty(selectors.workerTimeControl.thirdEntryOfTuesday, 'innerText'); @@ -118,8 +111,7 @@ describe('Worker time control path', () => { const scanTime = '16:00'; const result = await nightmare .waitToClick(selectors.workerTimeControl.tuesdayAddTimeButton) - .clearInput(selectors.workerTimeControl.timeDialogInput) - .write(selectors.workerTimeControl.timeDialogInput, scanTime) + .pickTime(selectors.workerTimeControl.timeDialogInput, scanTime) .waitToClick(selectors.workerTimeControl.confirmButton) .waitToGetProperty(selectors.workerTimeControl.fourthEntryOfTuesday, 'innerText'); @@ -139,8 +131,7 @@ describe('Worker time control path', () => { const scanTime = '09:00'; const result = await nightmare .waitToClick(selectors.workerTimeControl.wednesdayAddTimeButton) - .clearInput(selectors.workerTimeControl.timeDialogInput) - .write(selectors.workerTimeControl.timeDialogInput, scanTime) + .pickTime(selectors.workerTimeControl.timeDialogInput, scanTime) .waitToClick(selectors.workerTimeControl.confirmButton) .waitToGetProperty(selectors.workerTimeControl.firstEntryOfWednesday, 'innerText'); @@ -151,8 +142,7 @@ describe('Worker time control path', () => { const scanTime = '10:00'; const result = await nightmare .waitToClick(selectors.workerTimeControl.wednesdayAddTimeButton) - .clearInput(selectors.workerTimeControl.timeDialogInput) - .write(selectors.workerTimeControl.timeDialogInput, scanTime) + .pickTime(selectors.workerTimeControl.timeDialogInput, scanTime) .waitToClick(selectors.workerTimeControl.confirmButton) .waitToGetProperty(selectors.workerTimeControl.secondEntryOfWednesday, 'innerText'); @@ -163,8 +153,7 @@ describe('Worker time control path', () => { const scanTime = '10:20'; const result = await nightmare .waitToClick(selectors.workerTimeControl.wednesdayAddTimeButton) - .clearInput(selectors.workerTimeControl.timeDialogInput) - .write(selectors.workerTimeControl.timeDialogInput, scanTime) + .pickTime(selectors.workerTimeControl.timeDialogInput, scanTime) .waitToClick(selectors.workerTimeControl.confirmButton) .waitToGetProperty(selectors.workerTimeControl.thirdEntryOfWednesday, 'innerText'); @@ -175,8 +164,7 @@ describe('Worker time control path', () => { const scanTime = '17:00'; const result = await nightmare .waitToClick(selectors.workerTimeControl.wednesdayAddTimeButton) - .clearInput(selectors.workerTimeControl.timeDialogInput) - .write(selectors.workerTimeControl.timeDialogInput, scanTime) + .pickTime(selectors.workerTimeControl.timeDialogInput, scanTime) .waitToClick(selectors.workerTimeControl.confirmButton) .waitToGetProperty(selectors.workerTimeControl.fourthEntryOfWednesday, 'innerText'); @@ -196,8 +184,7 @@ describe('Worker time control path', () => { const scanTime = '09:59'; const result = await nightmare .waitToClick(selectors.workerTimeControl.thursdayAddTimeButton) - .clearInput(selectors.workerTimeControl.timeDialogInput) - .write(selectors.workerTimeControl.timeDialogInput, scanTime) + .pickTime(selectors.workerTimeControl.timeDialogInput, scanTime) .waitToClick(selectors.workerTimeControl.confirmButton) .waitToGetProperty(selectors.workerTimeControl.firstEntryOfThursday, 'innerText'); @@ -208,8 +195,7 @@ describe('Worker time control path', () => { const scanTime = '10:00'; const result = await nightmare .waitToClick(selectors.workerTimeControl.thursdayAddTimeButton) - .clearInput(selectors.workerTimeControl.timeDialogInput) - .write(selectors.workerTimeControl.timeDialogInput, scanTime) + .pickTime(selectors.workerTimeControl.timeDialogInput, scanTime) .waitToClick(selectors.workerTimeControl.confirmButton) .waitToGetProperty(selectors.workerTimeControl.secondEntryOfThursday, 'innerText'); @@ -220,8 +206,7 @@ describe('Worker time control path', () => { const scanTime = '10:20'; const result = await nightmare .waitToClick(selectors.workerTimeControl.thursdayAddTimeButton) - .clearInput(selectors.workerTimeControl.timeDialogInput) - .write(selectors.workerTimeControl.timeDialogInput, scanTime) + .pickTime(selectors.workerTimeControl.timeDialogInput, scanTime) .waitToClick(selectors.workerTimeControl.confirmButton) .waitToGetProperty(selectors.workerTimeControl.thirdEntryOfThursday, 'innerText'); @@ -232,8 +217,7 @@ describe('Worker time control path', () => { const scanTime = '17:59'; const result = await nightmare .waitToClick(selectors.workerTimeControl.thursdayAddTimeButton) - .clearInput(selectors.workerTimeControl.timeDialogInput) - .write(selectors.workerTimeControl.timeDialogInput, scanTime) + .pickTime(selectors.workerTimeControl.timeDialogInput, scanTime) .waitToClick(selectors.workerTimeControl.confirmButton) .waitToGetProperty(selectors.workerTimeControl.fourthEntryOfThursday, 'innerText'); @@ -253,8 +237,7 @@ describe('Worker time control path', () => { const scanTime = '07:30'; const result = await nightmare .waitToClick(selectors.workerTimeControl.fridayAddTimeButton) - .clearInput(selectors.workerTimeControl.timeDialogInput) - .write(selectors.workerTimeControl.timeDialogInput, scanTime) + .pickTime(selectors.workerTimeControl.timeDialogInput, scanTime) .waitToClick(selectors.workerTimeControl.confirmButton) .waitToGetProperty(selectors.workerTimeControl.firstEntryOfFriday, 'innerText'); @@ -265,8 +248,7 @@ describe('Worker time control path', () => { const scanTime = '10:00'; const result = await nightmare .waitToClick(selectors.workerTimeControl.fridayAddTimeButton) - .clearInput(selectors.workerTimeControl.timeDialogInput) - .write(selectors.workerTimeControl.timeDialogInput, scanTime) + .pickTime(selectors.workerTimeControl.timeDialogInput, scanTime) .waitToClick(selectors.workerTimeControl.confirmButton) .waitToGetProperty(selectors.workerTimeControl.secondEntryOfFriday, 'innerText'); @@ -277,8 +259,7 @@ describe('Worker time control path', () => { const scanTime = '10:20'; const result = await nightmare .waitToClick(selectors.workerTimeControl.fridayAddTimeButton) - .clearInput(selectors.workerTimeControl.timeDialogInput) - .write(selectors.workerTimeControl.timeDialogInput, scanTime) + .pickTime(selectors.workerTimeControl.timeDialogInput, scanTime) .waitToClick(selectors.workerTimeControl.confirmButton) .waitToGetProperty(selectors.workerTimeControl.thirdEntryOfFriday, 'innerText'); @@ -289,8 +270,7 @@ describe('Worker time control path', () => { const scanTime = '15:30'; const result = await nightmare .waitToClick(selectors.workerTimeControl.fridayAddTimeButton) - .clearInput(selectors.workerTimeControl.timeDialogInput) - .write(selectors.workerTimeControl.timeDialogInput, scanTime) + .pickTime(selectors.workerTimeControl.timeDialogInput, scanTime) .waitToClick(selectors.workerTimeControl.confirmButton) .waitToGetProperty(selectors.workerTimeControl.fourthEntryOfFriday, 'innerText'); @@ -319,8 +299,7 @@ describe('Worker time control path', () => { const scanTime = '06:00'; const result = await nightmare .waitToClick(selectors.workerTimeControl.saturdayAddTimeButton) - .clearInput(selectors.workerTimeControl.timeDialogInput) - .write(selectors.workerTimeControl.timeDialogInput, scanTime) + .pickTime(selectors.workerTimeControl.timeDialogInput, scanTime) .waitToClick(selectors.workerTimeControl.confirmButton) .waitToGetProperty(selectors.workerTimeControl.firstEntryOfSaturday, 'innerText'); @@ -331,8 +310,7 @@ describe('Worker time control path', () => { const scanTime = '13:40'; const result = await nightmare .waitToClick(selectors.workerTimeControl.saturdayAddTimeButton) - .clearInput(selectors.workerTimeControl.timeDialogInput) - .write(selectors.workerTimeControl.timeDialogInput, scanTime) + .pickTime(selectors.workerTimeControl.timeDialogInput, scanTime) .waitToClick(selectors.workerTimeControl.confirmButton) .waitToGetProperty(selectors.workerTimeControl.secondEntryOfSaturday, 'innerText'); @@ -352,8 +330,7 @@ describe('Worker time control path', () => { const scanTime = '05:00'; const result = await nightmare .waitToClick(selectors.workerTimeControl.sundayAddTimeButton) - .clearInput(selectors.workerTimeControl.timeDialogInput) - .write(selectors.workerTimeControl.timeDialogInput, scanTime) + .pickTime(selectors.workerTimeControl.timeDialogInput, scanTime) .waitToClick(selectors.workerTimeControl.confirmButton) .waitToGetProperty(selectors.workerTimeControl.firstEntryOfSunday, 'innerText'); @@ -364,8 +341,7 @@ describe('Worker time control path', () => { const scanTime = '12:40'; const result = await nightmare .waitToClick(selectors.workerTimeControl.sundayAddTimeButton) - .clearInput(selectors.workerTimeControl.timeDialogInput) - .write(selectors.workerTimeControl.timeDialogInput, scanTime) + .pickTime(selectors.workerTimeControl.timeDialogInput, scanTime) .waitToClick(selectors.workerTimeControl.confirmButton) .waitToGetProperty(selectors.workerTimeControl.secondEntryOfSunday, 'innerText'); diff --git a/e2e/paths/05-ticket-module/12_descriptor.spec.js b/e2e/paths/05-ticket-module/12_descriptor.spec.js index cbae66d93..0424f1f94 100644 --- a/e2e/paths/05-ticket-module/12_descriptor.spec.js +++ b/e2e/paths/05-ticket-module/12_descriptor.spec.js @@ -1,7 +1,7 @@ import selectors from '../../helpers/selectors.js'; import createNightmare from '../../helpers/nightmare'; -describe('Ticket descriptor path', () => { +fdescribe('Ticket descriptor path', () => { const nightmare = createNightmare(); beforeAll(() => { @@ -43,7 +43,7 @@ describe('Ticket descriptor path', () => { it(`should update the shipped hour`, async() => { const result = await nightmare - .write(selectors.ticketDescriptor.changeShippedHourInput, '0815') + .pickTime(selectors.ticketDescriptor.changeShippedHourInput, '08:15') .waitToClick(selectors.ticketDescriptor.acceptChangeHourButton) .waitForLastSnackbar(); @@ -116,7 +116,6 @@ describe('Ticket descriptor path', () => { .wait(selectors.ticketDescriptor.addStowawayDialogFirstTicket) .isVisible(selectors.ticketDescriptor.addStowawayDialogFirstTicket); - expect(isVisible).toBeTruthy(); }); diff --git a/e2e/paths/06-claim-module/05_summary.spec.js b/e2e/paths/06-claim-module/05_summary.spec.js index 07e4c9080..dde444ea3 100644 --- a/e2e/paths/06-claim-module/05_summary.spec.js +++ b/e2e/paths/06-claim-module/05_summary.spec.js @@ -59,6 +59,7 @@ describe('claim Summary path', () => { .exists(selectors.claimSummary.itemDescriptorPopoverItemDiaryButton); expect(exists).toBeTruthy(); + await nightmare.mousedown('.vn-popover.shown'); }); it('should display the claim development details', async() => { @@ -82,6 +83,7 @@ describe('claim Summary path', () => { .exists(selectors.claimSummary.firstDevelopmentWorkerGoToClientButton); expect(exists).toBeTruthy(); + await nightmare.mousedown('.vn-popover.shown'); }); it(`should click on the first action ticket ID making the ticket descriptor visible`, async() => { diff --git a/e2e/paths/06-claim-module/06_descriptor.spec.js b/e2e/paths/06-claim-module/06_descriptor.spec.js index f43440129..67faaa224 100644 --- a/e2e/paths/06-claim-module/06_descriptor.spec.js +++ b/e2e/paths/06-claim-module/06_descriptor.spec.js @@ -36,6 +36,7 @@ describe('claim Descriptor path', () => { it(`should be able to see the delete claim button of the descriptor more menu`, async() => { let exists = await nightmare .waitToClick(selectors.claimDescriptor.moreMenu) + .wait(selectors.claimDescriptor.moreMenuDeleteClaim) .exists(selectors.claimDescriptor.moreMenuDeleteClaim); expect(exists).toBeTruthy(); diff --git a/front/core/components/card/card.js b/front/core/components/card/card.js index 405a67694..b812ccf61 100644 --- a/front/core/components/card/card.js +++ b/front/core/components/card/card.js @@ -1,8 +1,7 @@ import ngModule from '../../module'; require('./style.scss'); -directive.$inject = ['vnTemplate']; -export default function directive(vnTemplate) { +export default function directive() { return { restrict: 'E', transclude: true, diff --git a/front/core/components/drop-down/drop-down.html b/front/core/components/drop-down/drop-down.html index 5fef1dd5e..d4dec9dd5 100755 --- a/front/core/components/drop-down/drop-down.html +++ b/front/core/components/drop-down/drop-down.html @@ -2,17 +2,19 @@ vn-id="popover" on-open="$ctrl.onOpen()" on-close="$ctrl.onClose()"> -