diff --git a/e2e/helpers/extensions.js b/e2e/helpers/extensions.js index e46ad79ba..773625621 100644 --- a/e2e/helpers/extensions.js +++ b/e2e/helpers/extensions.js @@ -7,8 +7,6 @@ import config from './config.js'; let currentUser; let actions = { - // Generic extensions - clickIfExists: async function(selector) { let exists = await this.exists(selector); if (exists) await this.click(selector); @@ -25,8 +23,6 @@ let actions = { }, selector); }, - // Salix specific extensions - changeLanguageToEnglish: async function() { let langSelector = '.user-popover vn-autocomplete[ng-model="$ctrl.lang"]'; @@ -72,7 +68,7 @@ let actions = { currentUser = userName; } else - await this.waitToClick('vn-topbar a[ui-sref="home"]'); + await this.waitToClick('a[ui-sref=home]'); }, waitForLogin: async function(userName) { @@ -367,7 +363,7 @@ let actions = { if (!nested) return this.waitToClick(`vn-left-menu li > a[ui-sref="${sectionRoute}"]`); - return this.waitToClick('vn-left-menu .collapsed') + return this.waitToClick('vn-left-menu vn-item-section > vn-icon[icon=keyboard_arrow_down]') .wait('vn-left-menu .expanded') .waitToClick(`vn-left-menu li > a[ui-sref="${sectionRoute}"]`); }); @@ -421,7 +417,7 @@ let actions = { }, waitForSpinnerLoad: function() { - return this.waitForClassNotPresent('vn-spinner > div', 'is-active'); + return this.waitUntilNotPresent('vn-topbar vn-spinner'); }, }; diff --git a/e2e/helpers/selectors.js b/e2e/helpers/selectors.js index 52e6e256b..f26574214 100644 --- a/e2e/helpers/selectors.js +++ b/e2e/helpers/selectors.js @@ -9,7 +9,7 @@ export default { 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', + userMenuButton: '#user', userLocalWarehouse: '.user-popover vn-autocomplete[ng-model="$ctrl.localWarehouseFk"]', userLocalBank: '.user-popover vn-autocomplete[ng-model="$ctrl.localBankFk"]', userLocalCompany: '.user-popover vn-autocomplete[ng-model="$ctrl.localCompanyFk"]', @@ -23,7 +23,7 @@ export default { clientsIndex: { searchClientInput: `vn-textfield input`, searchButton: 'vn-searchbar vn-icon[icon="search"]', - search-result: 'vn-client-index .vn-item', + searchResult: 'vn-client-index .vn-item', createClientButton: `vn-float-button`, othersButton: 'vn-left-menu li[name="Others"] > a' }, @@ -180,11 +180,11 @@ export default { acceptDeleteButton: '.vn-confirm.shown button[response="accept"]' }, itemsIndex: { - searchIcon: 'vn-item-index vn-searchbar vn-icon[icon="search"]', + searchIcon: 'vn-searchbar vn-icon[icon="search"]', createItemButton: `vn-float-button`, - search-result: 'vn-item-index a.vn-tr', - search-resultPreviewButton: 'vn-item-index .buttons > [icon="desktop_windows"]', - search-resultCloneButton: 'vn-item-index .buttons > [icon="icon-clone"]', + searchResult: 'vn-item-index a.vn-tr', + 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 vn-textfield input', searchButton: 'vn-searchbar vn-icon[icon="search"]', @@ -323,18 +323,18 @@ export default { setOk: 'vn-ticket-summary vn-button[label="SET OK"] > button' }, ticketsIndex: { - openAdvancedSearchButton: 'vn-ticket-index vn-searchbar .append vn-icon[icon="arrow_drop_down"]', + openAdvancedSearchButton: 'vn-searchbar .append vn-icon[icon="arrow_drop_down"]', advancedSearchInvoiceOut: 'vn-ticket-search-panel vn-textfield[ng-model="filter.refFk"] input', newTicketButton: 'vn-ticket-index > a', - search-result: 'vn-ticket-index vn-card > vn-table > div > vn-tbody > a.vn-tr', + 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', - search-resultDate: 'vn-ticket-index vn-table vn-tbody > a:nth-child(1) > vn-td:nth-child(5)', - searchTicketInput: `vn-ticket-index vn-textfield input`, - searchWeeklyTicketInput: `vn-ticket-weekly-index vn-textfield input`, - searchWeeklyClearInput: 'vn-ticket-weekly-index vn-searchbar vn-icon[icon=clear]', + searchResultDate: 'vn-ticket-index vn-table vn-tbody > a:nth-child(1) > vn-td:nth-child(5)', + searchTicketInput: `vn-searchbar input`, + searchWeeklyTicketInput: `vn-searchbar input`, + searchWeeklyClearInput: 'vn-searchbar vn-icon[icon=clear]', advancedSearchButton: 'vn-ticket-search-panel button[type=submit]', - searchButton: 'vn-ticket-index vn-searchbar vn-icon[icon="search"]', - searchWeeklyButton: 'vn-ticket-weekly-index vn-searchbar vn-icon[icon="search"]', + searchButton: 'vn-searchbar vn-icon[icon="search"]', + searchWeeklyButton: 'vn-searchbar vn-icon[icon="search"]', moreMenu: 'vn-ticket-index vn-icon-menu[icon=more_vert]', moreMenuWeeklyTickets: '.vn-drop-down.shown li:nth-child(2)', sixthWeeklyTicket: 'vn-ticket-weekly-index vn-table vn-tr:nth-child(6) vn-autocomplete[ng-model="weekly.weekDay"] input', @@ -516,9 +516,9 @@ export default { saveStateButton: `button[type=submit]` }, claimsIndex: { - searchClaimInput: `vn-claim-index vn-textfield input`, - search-result: 'vn-claim-index vn-card > vn-table > div > vn-tbody > a', - searchButton: 'vn-claim-index vn-searchbar vn-icon[icon="search"]' + searchClaimInput: `vn-searchbar input`, + searchResult: 'vn-claim-index vn-card > vn-table > div > vn-tbody > a', + searchButton: 'vn-searchbar vn-icon[icon="search"]' }, claimDescriptor: { moreMenu: 'vn-claim-descriptor vn-icon-menu[icon=more_vert]', @@ -580,11 +580,11 @@ export default { isPaidWithManaCheckbox: 'vn-check[ng-model="$ctrl.claim.isChargedToMana"]' }, ordersIndex: { - search-result: 'vn-order-index vn-card > vn-table > div > vn-tbody > a.vn-tr', - search-resultDate: 'vn-order-index vn-table vn-tbody > a:nth-child(1) > vn-td:nth-child(4)', - search-resultAddress: 'vn-order-index vn-table vn-tbody > a:nth-child(1) > vn-td:nth-child(6)', + searchResult: 'vn-order-index vn-card > vn-table > div > vn-tbody > a.vn-tr', + searchResultDate: 'vn-order-index vn-table vn-tbody > a:nth-child(1) > vn-td:nth-child(4)', + searchResultAddress: 'vn-order-index vn-table vn-tbody > a:nth-child(1) > vn-td:nth-child(6)', searchOrderInput: `vn-order-index vn-textfield input`, - searchButton: 'vn-order-index vn-searchbar vn-icon[icon="search"]', + searchButton: 'vn-searchbar vn-icon[icon="search"]', createOrderButton: `vn-float-button`, }, orderDescriptor: { @@ -720,9 +720,9 @@ export default { navigateBackToIndex: 'vn-worker-descriptor vn-icon[icon="chevron_left"]' }, invoiceOutIndex: { - searchInvoiceOutInput: `vn-invoice-out-index vn-textfield input`, - searchButton: 'vn-invoice-out-index vn-searchbar vn-icon[icon="search"]', - search-result: 'vn-invoice-out-index vn-card > vn-table > div > vn-tbody > a.vn-tr', + searchInvoiceOutInput: `vn-searchbar input`, + searchButton: 'vn-searchbar vn-icon[icon="search"]', + searchResult: 'vn-invoice-out-index vn-card > vn-table > div > vn-tbody > a.vn-tr', }, invoiceOutDescriptor: { moreMenu: 'vn-invoice-out-descriptor vn-icon-menu[icon=more_vert]', 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 abac46535..f2fe30464 100644 --- a/e2e/paths/02-client-module/01_create_client.spec.js +++ b/e2e/paths/02-client-module/01_create_client.spec.js @@ -13,8 +13,8 @@ describe('Client create path', () => { const result = await nightmare .write(selectors.clientsIndex.searchClientInput, 'Carol Danvers') .waitToClick(selectors.clientsIndex.searchButton) - .waitForNumberOfElements(selectors.clientsIndex.search-result, 0) - .countElement(selectors.clientsIndex.search-result); + .waitForNumberOfElements(selectors.clientsIndex.searchResult, 0) + .countElement(selectors.clientsIndex.searchResult); expect(result).toEqual(0); }); @@ -117,8 +117,8 @@ describe('Client create path', () => { const result = await nightmare .write(selectors.clientsIndex.searchClientInput, 'Carol Danvers') .waitToClick(selectors.clientsIndex.searchButton) - .waitForNumberOfElements(selectors.clientsIndex.search-result, 1) - .countElement(selectors.clientsIndex.search-result); + .waitForNumberOfElements(selectors.clientsIndex.searchResult, 1) + .countElement(selectors.clientsIndex.searchResult); expect(result).toEqual(1); }); diff --git a/e2e/paths/02-client-module/14_balance.spec.js b/e2e/paths/02-client-module/14_balance.spec.js index e056b5eea..b661d998b 100644 --- a/e2e/paths/02-client-module/14_balance.spec.js +++ b/e2e/paths/02-client-module/14_balance.spec.js @@ -135,16 +135,16 @@ describe('Client balance path', () => { let resultCount = await nightmare .write(selectors.clientsIndex.searchClientInput, 'Petter Parker') .waitToClick(selectors.clientsIndex.searchButton) - .waitForNumberOfElements(selectors.clientsIndex.search-result, 1) - .countElement(selectors.clientsIndex.search-result); + .waitForNumberOfElements(selectors.clientsIndex.searchResult, 1) + .countElement(selectors.clientsIndex.searchResult); expect(resultCount).toEqual(1); }); it(`should click on the search result to access to the client's balance`, async() => { let url = await nightmare - .waitForTextInElement(selectors.clientsIndex.search-result, 'Petter Parker') - .waitToClick(selectors.clientsIndex.search-result) + .waitForTextInElement(selectors.clientsIndex.searchResult, 'Petter Parker') + .waitToClick(selectors.clientsIndex.searchResult) .waitToClick(selectors.clientBalance.balanceButton) .waitForURL('/balance') .parsedUrl(); diff --git a/e2e/paths/04-item-module/01_summary.spec.js b/e2e/paths/04-item-module/01_summary.spec.js index 41737a7e6..8f493bfac 100644 --- a/e2e/paths/04-item-module/01_summary.spec.js +++ b/e2e/paths/04-item-module/01_summary.spec.js @@ -14,16 +14,16 @@ describe('Item summary path', () => { .clearInput(selectors.itemsIndex.searchItemInput) .write(selectors.itemsIndex.searchItemInput, 'Ranged weapon longbow 2m') .waitToClick(selectors.itemsIndex.searchButton) - .waitForNumberOfElements(selectors.itemsIndex.search-result, 1) - .countElement(selectors.itemsIndex.search-result); + .waitForNumberOfElements(selectors.itemsIndex.searchResult, 1) + .countElement(selectors.itemsIndex.searchResult); expect(result).toEqual(1); }); it(`should click on the search result summary button to open the item summary popup`, async() => { const isVisible = await nightmare - .waitForTextInElement(selectors.itemsIndex.search-result, 'Ranged weapon longbow 2m') - .waitToClick(selectors.itemsIndex.search-resultPreviewButton) + .waitForTextInElement(selectors.itemsIndex.searchResult, 'Ranged weapon longbow 2m') + .waitToClick(selectors.itemsIndex.searchResultPreviewButton) .isVisible(selectors.itemSummary.basicData); expect(isVisible).toBeTruthy(); @@ -80,20 +80,20 @@ describe('Item summary path', () => { it('should search for other item', async() => { const result = await nightmare - .clearInput('vn-item-index vn-searchbar input') + .clearInput('vn-searchbar input') .waitToClick(selectors.itemsIndex.searchButton) .write(selectors.itemsIndex.searchItemInput, 'Melee weapon combat fist 15cm') .waitToClick(selectors.itemsIndex.searchButton) - .waitForNumberOfElements(selectors.itemsIndex.search-result, 1) - .countElement(selectors.itemsIndex.search-result); + .waitForNumberOfElements(selectors.itemsIndex.searchResult, 1) + .countElement(selectors.itemsIndex.searchResult); expect(result).toEqual(1); }); it(`should now click on the search result summary button to open the item summary popup`, async() => { const isVisible = await nightmare - .waitForTextInElement(selectors.itemsIndex.search-result, 'Melee weapon combat fist 15cm') - .waitToClick(selectors.itemsIndex.search-resultPreviewButton) + .waitForTextInElement(selectors.itemsIndex.searchResult, 'Melee weapon combat fist 15cm') + .waitToClick(selectors.itemsIndex.searchResultPreviewButton) .isVisible(selectors.itemSummary.basicData); @@ -151,7 +151,7 @@ describe('Item summary path', () => { it(`should navigate to the one of the items detailed section`, async() => { const url = await nightmare - .waitToClick(selectors.itemsIndex.search-result) + .waitToClick(selectors.itemsIndex.searchResult) .waitForURL('summary') .parsedUrl(); diff --git a/e2e/paths/04-item-module/08_create_and_clone.spec.js b/e2e/paths/04-item-module/08_create_and_clone.spec.js index 0fe8596c3..8f4952fb1 100644 --- a/e2e/paths/04-item-module/08_create_and_clone.spec.js +++ b/e2e/paths/04-item-module/08_create_and_clone.spec.js @@ -14,8 +14,8 @@ describe('Item Create/Clone path', () => { .clearInput(selectors.itemsIndex.searchItemInput) .write(selectors.itemsIndex.searchItemInput, 'Infinity Gauntlet') .waitToClick(selectors.itemsIndex.searchButton) - .waitForNumberOfElements(selectors.itemsIndex.search-result, 0) - .countElement(selectors.itemsIndex.search-result); + .waitForNumberOfElements(selectors.itemsIndex.searchResult, 0) + .countElement(selectors.itemsIndex.searchResult); expect(result).toEqual(0); }); @@ -99,16 +99,16 @@ describe('Item Create/Clone path', () => { .clearInput(selectors.itemsIndex.searchItemInput) .write(selectors.itemsIndex.searchItemInput, 'Infinity Gauntlet') .waitToClick(selectors.itemsIndex.searchButton) - .waitForNumberOfElements(selectors.itemsIndex.search-result, 1) - .countElement(selectors.itemsIndex.search-result); + .waitForNumberOfElements(selectors.itemsIndex.searchResult, 1) + .countElement(selectors.itemsIndex.searchResult); expect(result).toEqual(1); }); it(`should clone the Infinity Gauntlet`, async() => { const url = await nightmare - .waitForTextInElement(selectors.itemsIndex.search-result, 'Infinity Gauntlet') - .waitToClick(selectors.itemsIndex.search-resultCloneButton) + .waitForTextInElement(selectors.itemsIndex.searchResult, 'Infinity Gauntlet') + .waitToClick(selectors.itemsIndex.searchResultCloneButton) .waitToClick(selectors.itemsIndex.acceptClonationAlertButton) .waitForURL('tags') .parsedUrl(); @@ -122,8 +122,8 @@ describe('Item Create/Clone path', () => { .clearInput(selectors.itemsIndex.searchItemInput) .write(selectors.itemsIndex.searchItemInput, 'Infinity Gauntlet') .waitToClick(selectors.itemsIndex.searchButton) - .waitForNumberOfElements(selectors.itemsIndex.search-result, 2) - .countElement(selectors.itemsIndex.search-result); + .waitForNumberOfElements(selectors.itemsIndex.searchResult, 2) + .countElement(selectors.itemsIndex.searchResult); expect(result).toEqual(2); }); diff --git a/e2e/paths/04-item-module/09_regularize.spec.js b/e2e/paths/04-item-module/09_regularize.spec.js index 82da8b01a..242414372 100644 --- a/e2e/paths/04-item-module/09_regularize.spec.js +++ b/e2e/paths/04-item-module/09_regularize.spec.js @@ -32,16 +32,16 @@ describe('Item regularize path', () => { .clearInput(selectors.itemsIndex.searchItemInput) .write(selectors.itemsIndex.searchItemInput, 'Ranged weapon pistol 9mm') .waitToClick(selectors.itemsIndex.searchButton) - .waitForNumberOfElements(selectors.itemsIndex.search-result, 1) - .countElement(selectors.itemsIndex.search-result); + .waitForNumberOfElements(selectors.itemsIndex.searchResult, 1) + .countElement(selectors.itemsIndex.searchResult); expect(resultCount).toEqual(1); }); it(`should click on the search result to access to the item tax`, async() => { const url = await nightmare - .waitForTextInElement(selectors.itemsIndex.search-result, 'Ranged weapon pistol 9mm') - .waitToClick(selectors.itemsIndex.search-result) + .waitForTextInElement(selectors.itemsIndex.searchResult, 'Ranged weapon pistol 9mm') + .waitToClick(selectors.itemsIndex.searchResult) .waitForURL('/summary') .parsedUrl(); @@ -91,16 +91,16 @@ describe('Item regularize path', () => { const result = await nightmare .write(selectors.ticketsIndex.searchTicketInput, 'missing') .waitToClick(selectors.ticketsIndex.searchButton) - .waitForNumberOfElements(selectors.ticketsIndex.search-result, 1) - .countElement(selectors.ticketsIndex.search-result); + .waitForNumberOfElements(selectors.ticketsIndex.searchResult, 1) + .countElement(selectors.ticketsIndex.searchResult); expect(result).toEqual(1); }); it(`should click on the search result to access to the ticket summary`, async() => { const url = await nightmare - .waitForTextInElement(selectors.ticketsIndex.search-result, 'Missing') - .waitToClick(selectors.ticketsIndex.search-result) + .waitForTextInElement(selectors.ticketsIndex.searchResult, 'Missing') + .waitToClick(selectors.ticketsIndex.searchResult) .waitForURL('/summary') .parsedUrl(); @@ -138,16 +138,16 @@ describe('Item regularize path', () => { .clearInput(selectors.itemsIndex.searchItemInput) .write(selectors.itemsIndex.searchItemInput, 'Ranged weapon pistol 9mm') .waitToClick(selectors.itemsIndex.searchButton) - .waitForNumberOfElements(selectors.itemsIndex.search-result, 1) - .countElement(selectors.itemsIndex.search-result); + .waitForNumberOfElements(selectors.itemsIndex.searchResult, 1) + .countElement(selectors.itemsIndex.searchResult); expect(resultCount).toEqual(1); }); it(`should click on the search result to access to the item tax`, async() => { const url = await nightmare - .waitForTextInElement(selectors.itemsIndex.search-result, 'Ranged weapon pistol 9mm') - .waitToClick(selectors.itemsIndex.search-result) + .waitForTextInElement(selectors.itemsIndex.searchResult, 'Ranged weapon pistol 9mm') + .waitToClick(selectors.itemsIndex.searchResult) .waitForURL('/summary') .parsedUrl(); @@ -181,16 +181,16 @@ describe('Item regularize path', () => { const result = await nightmare .write(selectors.ticketsIndex.searchTicketInput, 25) .waitToClick(selectors.ticketsIndex.searchButton) - .waitForNumberOfElements(selectors.ticketsIndex.search-result, 1) - .countElement(selectors.ticketsIndex.search-result); + .waitForNumberOfElements(selectors.ticketsIndex.searchResult, 1) + .countElement(selectors.ticketsIndex.searchResult); expect(result).toEqual(1); }); it(`should now click on the search result to access to the ticket summary`, async() => { const url = await nightmare - .waitForTextInElement(selectors.ticketsIndex.search-result, '25') - .waitToClick(selectors.ticketsIndex.search-result) + .waitForTextInElement(selectors.ticketsIndex.searchResult, '25') + .waitToClick(selectors.ticketsIndex.searchResult) .waitForURL('/summary') .parsedUrl(); diff --git a/e2e/paths/04-item-module/10_item_index.spec.js b/e2e/paths/04-item-module/10_item_index.spec.js index 13604063b..b83b37c59 100644 --- a/e2e/paths/04-item-module/10_item_index.spec.js +++ b/e2e/paths/04-item-module/10_item_index.spec.js @@ -38,10 +38,10 @@ describe('Item index path', () => { it('should navigate forth and back to see the images column is still visible', async() => { const imageVisible = await nightmare - .waitToClick(selectors.itemsIndex.search-result) + .waitToClick(selectors.itemsIndex.searchResult) .waitToClick(selectors.itemDescriptor.goBackToModuleIndexButton) .waitToClick(selectors.itemsIndex.searchIcon) - .wait(selectors.itemsIndex.search-result) + .wait(selectors.itemsIndex.searchResult) .isVisible(selectors.itemsIndex.firstItemImage); expect(imageVisible).toBeTruthy(); @@ -75,10 +75,10 @@ describe('Item index path', () => { it('should now navigate forth and back to see the ids column is now visible', async() => { const idVisible = await nightmare - .waitToClick(selectors.itemsIndex.search-result) + .waitToClick(selectors.itemsIndex.searchResult) .waitToClick(selectors.itemDescriptor.goBackToModuleIndexButton) .waitToClick(selectors.itemsIndex.searchIcon) - .wait(selectors.itemsIndex.search-result) + .wait(selectors.itemsIndex.searchResult) .isVisible(selectors.itemsIndex.firstItemId); expect(idVisible).toBeTruthy(); diff --git a/e2e/paths/04-item-module/11_item_log.spec.js b/e2e/paths/04-item-module/11_item_log.spec.js index d1cdfedea..cf3beb528 100644 --- a/e2e/paths/04-item-module/11_item_log.spec.js +++ b/e2e/paths/04-item-module/11_item_log.spec.js @@ -12,8 +12,8 @@ describe('Item log path', () => { const result = await nightmare .write(selectors.itemsIndex.searchItemInput, 'Knowledge artifact') .waitToClick(selectors.itemsIndex.searchButton) - .waitForNumberOfElements(selectors.itemsIndex.search-result, 0) - .countElement(selectors.itemsIndex.search-result); + .waitForNumberOfElements(selectors.itemsIndex.searchResult, 0) + .countElement(selectors.itemsIndex.searchResult); expect(result).toEqual(0); }); diff --git a/e2e/paths/05-ticket-module/01-sale/02_edit_sale.spec.js b/e2e/paths/05-ticket-module/01-sale/02_edit_sale.spec.js index c1b9996c6..5a6d6cd62 100644 --- a/e2e/paths/05-ticket-module/01-sale/02_edit_sale.spec.js +++ b/e2e/paths/05-ticket-module/01-sale/02_edit_sale.spec.js @@ -213,8 +213,8 @@ xdescribe('Ticket Edit sale path', () => { const result = await nightmare .write(selectors.claimsIndex.searchClaimInput, 4) .waitToClick(selectors.claimsIndex.searchButton) - .waitForNumberOfElements(selectors.claimsIndex.search-result, 1) - .countElement(selectors.claimsIndex.search-result); + .waitForNumberOfElements(selectors.claimsIndex.searchResult, 1) + .countElement(selectors.claimsIndex.searchResult); expect(result).toEqual(1); }); diff --git a/e2e/paths/05-ticket-module/02_expeditions_and_log.spec.js b/e2e/paths/05-ticket-module/02_expeditions_and_log.spec.js index 8e4645051..ec9b16fa4 100644 --- a/e2e/paths/05-ticket-module/02_expeditions_and_log.spec.js +++ b/e2e/paths/05-ticket-module/02_expeditions_and_log.spec.js @@ -7,7 +7,7 @@ describe('Ticket expeditions and log path', () => { beforeAll(() => { return nightmare .loginAndModule('production', 'ticket') - .accessToSearchResult('id:1') + .accessToSearchResult('1') .accessToSection('ticket.card.expedition'); }); diff --git a/e2e/paths/05-ticket-module/04_packages.spec.js b/e2e/paths/05-ticket-module/04_packages.spec.js index 30324aec2..b51bb8b95 100644 --- a/e2e/paths/05-ticket-module/04_packages.spec.js +++ b/e2e/paths/05-ticket-module/04_packages.spec.js @@ -7,7 +7,7 @@ describe('Ticket Create packages path', () => { beforeAll(() => { return nightmare .loginAndModule('employee', 'ticket') - .accessToSearchResult('id:1') + .accessToSearchResult('1') .accessToSection('ticket.card.package'); }); diff --git a/e2e/paths/05-ticket-module/05_tracking_state.spec.js b/e2e/paths/05-ticket-module/05_tracking_state.spec.js index 5797b6798..7c319f1c9 100644 --- a/e2e/paths/05-ticket-module/05_tracking_state.spec.js +++ b/e2e/paths/05-ticket-module/05_tracking_state.spec.js @@ -8,7 +8,7 @@ describe('Ticket Create new tracking state path', () => { beforeAll(() => { return nightmare .loginAndModule('production', 'ticket') - .accessToSearchResult('id:1') + .accessToSearchResult('1') .accessToSection('ticket.card.tracking.index'); }); @@ -44,7 +44,7 @@ describe('Ticket Create new tracking state path', () => { beforeAll(() => { return nightmare .loginAndModule('salesPerson', 'ticket') - .accessToSearchResult('id:1') + .accessToSearchResult('1') .accessToSection('ticket.card.tracking.index'); }); diff --git a/e2e/paths/05-ticket-module/08_components.spec.js b/e2e/paths/05-ticket-module/08_components.spec.js index 4603650ac..501c2eaad 100644 --- a/e2e/paths/05-ticket-module/08_components.spec.js +++ b/e2e/paths/05-ticket-module/08_components.spec.js @@ -7,7 +7,7 @@ describe('Ticket List components path', () => { beforeAll(() => { return nightmare .loginAndModule('employee', 'ticket') - .accessToSearchResult('id:1') + .accessToSearchResult('1') .accessToSection('ticket.card.components'); }); diff --git a/e2e/paths/05-ticket-module/09_weekly.spec.js b/e2e/paths/05-ticket-module/09_weekly.spec.js index f9f6a6380..76faaa207 100644 --- a/e2e/paths/05-ticket-module/09_weekly.spec.js +++ b/e2e/paths/05-ticket-module/09_weekly.spec.js @@ -34,15 +34,15 @@ describe('Ticket descriptor path', () => { const result = await nightmare .write(selectors.ticketsIndex.searchTicketInput, 11) .waitToClick(selectors.ticketsIndex.searchButton) - .waitForNumberOfElements(selectors.ticketsIndex.search-result, 1) - .countElement(selectors.ticketsIndex.search-result); + .waitForNumberOfElements(selectors.ticketsIndex.searchResult, 1) + .countElement(selectors.ticketsIndex.searchResult); expect(result).toEqual(1); }); it(`should click on the search result to access to the ticket`, async() => { const url = await nightmare - .waitToClick(selectors.ticketsIndex.search-result) + .waitToClick(selectors.ticketsIndex.searchResult) .waitForURL('/summary') .parsedUrl(); @@ -94,15 +94,15 @@ describe('Ticket descriptor path', () => { const result = await nightmare .write(selectors.ticketsIndex.searchTicketInput, 11) .waitToClick(selectors.ticketsIndex.searchButton) - .waitForNumberOfElements(selectors.ticketsIndex.search-result, 1) - .countElement(selectors.ticketsIndex.search-result); + .waitForNumberOfElements(selectors.ticketsIndex.searchResult, 1) + .countElement(selectors.ticketsIndex.searchResult); expect(result).toEqual(1); }); it(`should click on the search result to access to the ticket`, async() => { const url = await nightmare - .waitToClick(selectors.ticketsIndex.search-result) + .waitToClick(selectors.ticketsIndex.searchResult) .waitForURL('/summary') .parsedUrl(); @@ -160,7 +160,7 @@ describe('Ticket descriptor path', () => { it('should confirm the sixth weekly ticket was deleted', async() => { const result = await nightmare - .waitToClick('vn-ticket-weekly-index vn-searchbar vn-icon[icon=clear]') + .waitToClick('vn-searchbar vn-icon[icon=clear]') .waitToClick(selectors.ticketsIndex.searchWeeklyButton) .waitForNumberOfElements(selectors.ticketsIndex.searchWeeklyResult, 5) .countElement(selectors.ticketsIndex.searchWeeklyResult); diff --git a/e2e/paths/05-ticket-module/10_request.spec.js b/e2e/paths/05-ticket-module/10_request.spec.js index 0a31cb75a..44dc3e1af 100644 --- a/e2e/paths/05-ticket-module/10_request.spec.js +++ b/e2e/paths/05-ticket-module/10_request.spec.js @@ -7,7 +7,7 @@ describe('Ticket purchase request path', () => { beforeAll(() => { nightmare .loginAndModule('salesPerson', 'ticket') - .accessToSearchResult('id:16') + .accessToSearchResult('16') .accessToSection('ticket.card.request.index'); }); diff --git a/e2e/paths/05-ticket-module/11_diary.spec.js b/e2e/paths/05-ticket-module/11_diary.spec.js index bd086c527..aeec780e7 100644 --- a/e2e/paths/05-ticket-module/11_diary.spec.js +++ b/e2e/paths/05-ticket-module/11_diary.spec.js @@ -14,16 +14,16 @@ describe('Ticket diary path', () => { const result = await nightmare .write(selectors.ticketsIndex.searchTicketInput, 1) .waitToClick(selectors.ticketsIndex.searchButton) - .waitForNumberOfElements(selectors.ticketsIndex.search-result, 1) - .countElement(selectors.ticketsIndex.search-result); + .waitForNumberOfElements(selectors.ticketsIndex.searchResult, 1) + .countElement(selectors.ticketsIndex.searchResult); expect(result).toEqual(1); }); it(`should click on the search result to access to the ticket summary`, async() => { const url = await nightmare - .waitForTextInElement(selectors.ticketsIndex.search-result, 'Bat cave') - .waitToClick(selectors.ticketsIndex.search-result) + .waitForTextInElement(selectors.ticketsIndex.searchResult, 'Bat cave') + .waitToClick(selectors.ticketsIndex.searchResult) .waitForURL('/summary') .parsedUrl(); diff --git a/e2e/paths/05-ticket-module/12_descriptor.spec.js b/e2e/paths/05-ticket-module/12_descriptor.spec.js index 4f405dd37..b9c6c7c87 100644 --- a/e2e/paths/05-ticket-module/12_descriptor.spec.js +++ b/e2e/paths/05-ticket-module/12_descriptor.spec.js @@ -14,16 +14,16 @@ describe('Ticket descriptor path', () => { const result = await nightmare .write(selectors.ticketsIndex.searchTicketInput, 18) .waitToClick(selectors.ticketsIndex.searchButton) - .waitForNumberOfElements(selectors.ticketsIndex.search-result, 1) - .countElement(selectors.ticketsIndex.search-result); + .waitForNumberOfElements(selectors.ticketsIndex.searchResult, 1) + .countElement(selectors.ticketsIndex.searchResult); expect(result).toEqual(1); }); it(`should click on the search result to access to the ticket summary`, async() => { const url = await nightmare - .waitForTextInElement(selectors.ticketsIndex.search-result, 'Cerebro') - .waitToClick(selectors.ticketsIndex.search-result) + .waitForTextInElement(selectors.ticketsIndex.searchResult, 'Cerebro') + .waitToClick(selectors.ticketsIndex.searchResult) .waitForURL('/summary') .parsedUrl(); @@ -69,9 +69,9 @@ describe('Ticket descriptor path', () => { const result = await nightmare .write(selectors.ticketsIndex.searchTicketInput, 18) .waitToClick(selectors.ticketsIndex.searchButton) - .waitForNumberOfElements(selectors.ticketsIndex.search-result, 1) - .wait(selectors.ticketsIndex.search-resultDate) - .waitToGetProperty(selectors.ticketsIndex.search-resultDate, 'innerText'); + .waitForNumberOfElements(selectors.ticketsIndex.searchResult, 1) + .wait(selectors.ticketsIndex.searchResultDate) + .waitToGetProperty(selectors.ticketsIndex.searchResultDate, 'innerText'); expect(result).toContain(2000); }); @@ -83,16 +83,16 @@ describe('Ticket descriptor path', () => { .clearInput(selectors.ticketsIndex.searchTicketInput) .write(selectors.ticketsIndex.searchTicketInput, 16) .waitToClick(selectors.ticketsIndex.searchButton) - .waitForNumberOfElements(selectors.ticketsIndex.search-result, 1) - .countElement(selectors.ticketsIndex.search-result); + .waitForNumberOfElements(selectors.ticketsIndex.searchResult, 1) + .countElement(selectors.ticketsIndex.searchResult); expect(result).toEqual(1); }); it(`should now click on the search result to access to the ticket summary`, async() => { const url = await nightmare - .waitForTextInElement(selectors.ticketsIndex.search-result, 'Many Places') - .waitToClick(selectors.ticketsIndex.search-result) + .waitForTextInElement(selectors.ticketsIndex.searchResult, 'Many Places') + .waitToClick(selectors.ticketsIndex.searchResult) .waitForURL('/summary') .parsedUrl(); diff --git a/e2e/paths/06-claim-module/06_descriptor.spec.js b/e2e/paths/06-claim-module/06_descriptor.spec.js index 75db0888c..67faaa224 100644 --- a/e2e/paths/06-claim-module/06_descriptor.spec.js +++ b/e2e/paths/06-claim-module/06_descriptor.spec.js @@ -63,8 +63,8 @@ describe('claim Descriptor path', () => { const result = await nightmare .write(selectors.claimsIndex.searchClaimInput, claimId) .waitToClick(selectors.claimsIndex.searchButton) - .waitForNumberOfElements(selectors.claimsIndex.search-result, 0) - .countElement(selectors.claimsIndex.search-result); + .waitForNumberOfElements(selectors.claimsIndex.searchResult, 0) + .countElement(selectors.claimsIndex.searchResult); expect(result).toEqual(0); }); diff --git a/e2e/paths/09-invoice-out-module/01_descriptor.spec.js b/e2e/paths/09-invoice-out-module/01_descriptor.spec.js index 34365b7ec..f170b87b0 100644 --- a/e2e/paths/09-invoice-out-module/01_descriptor.spec.js +++ b/e2e/paths/09-invoice-out-module/01_descriptor.spec.js @@ -15,8 +15,8 @@ describe('InvoiceOut descriptor path', () => { .waitToClick(selectors.ticketsIndex.openAdvancedSearchButton) .write(selectors.ticketsIndex.advancedSearchInvoiceOut, 'T2222222') .waitToClick(selectors.ticketsIndex.advancedSearchButton) - .waitForNumberOfElements(selectors.ticketsIndex.search-result, 1) - .countElement(selectors.ticketsIndex.search-result); + .waitForNumberOfElements(selectors.ticketsIndex.searchResult, 1) + .countElement(selectors.ticketsIndex.searchResult); expect(result).toEqual(1); }); @@ -36,8 +36,8 @@ describe('InvoiceOut descriptor path', () => { const result = await nightmare .write(selectors.invoiceOutIndex.searchInvoiceOutInput, 'T2222222') .waitToClick(selectors.invoiceOutIndex.searchButton) - .waitForNumberOfElements(selectors.invoiceOutIndex.search-result, 1) - .countElement(selectors.invoiceOutIndex.search-result); + .waitForNumberOfElements(selectors.invoiceOutIndex.searchResult, 1) + .countElement(selectors.invoiceOutIndex.searchResult); expect(result).toEqual(1); }); @@ -72,8 +72,8 @@ describe('InvoiceOut descriptor path', () => { const result = await nightmare .write(selectors.invoiceOutIndex.searchInvoiceOutInput, 'T2222222') .waitToClick(selectors.invoiceOutIndex.searchButton) - .waitForNumberOfElements(selectors.invoiceOutIndex.search-result, 0) - .countElement(selectors.invoiceOutIndex.search-result); + .waitForNumberOfElements(selectors.invoiceOutIndex.searchResult, 0) + .countElement(selectors.invoiceOutIndex.searchResult); expect(result).toEqual(0); }); @@ -94,8 +94,8 @@ describe('InvoiceOut descriptor path', () => { .waitToClick(selectors.ticketsIndex.openAdvancedSearchButton) .write(selectors.ticketsIndex.advancedSearchInvoiceOut, 'T2222222') .waitToClick(selectors.ticketsIndex.advancedSearchButton) - .waitForNumberOfElements(selectors.ticketsIndex.search-result, 0) - .countElement(selectors.ticketsIndex.search-result); + .waitForNumberOfElements(selectors.ticketsIndex.searchResult, 0) + .countElement(selectors.ticketsIndex.searchResult); expect(result).toEqual(0); }); diff --git a/front/core/components/popup/index.js b/front/core/components/popup/index.js index b6902428c..e2cd7092f 100644 --- a/front/core/components/popup/index.js +++ b/front/core/components/popup/index.js @@ -99,13 +99,10 @@ export default class Popup extends Component { onClose() { this.closeTimeout = null; - this.document.body.removeChild(this.popup); - - this.$contentScope.$destroy(); this.popup.remove(); this.popup = null; + this.$contentScope.$destroy(); this.windowEl = null; - this.emit('close'); } diff --git a/modules/agency/back/methods/agency/landsThatDay.js b/modules/agency/back/methods/agency/landsThatDay.js index 6d9b1eeae..8955c39b5 100644 --- a/modules/agency/back/methods/agency/landsThatDay.js +++ b/modules/agency/back/methods/agency/landsThatDay.js @@ -18,7 +18,11 @@ module.exports = Self => { }); Self.landsThatDay = async filter => { - let query = `CALL vn.zone_getAvailable(?, ?);`; + let query = ` + CALL vn.zoneGetAgency(?, ?); + SELECT * FROM tmp.zoneGetAgency; + DROP TEMPORARY TABLE tmp.zoneGetAgency; + `; let result = await Self.rawSql(query, [filter.addressFk, filter.landed]); return result[1]; diff --git a/modules/ticket/front/weekly/index/index.html b/modules/ticket/front/weekly/index/index.html index 94621cc35..8a30226d2 100644 --- a/modules/ticket/front/weekly/index/index.html +++ b/modules/ticket/front/weekly/index/index.html @@ -10,13 +10,12 @@ + info="Search weekly ticket by id or client id"> + +