diff --git a/e2e/helpers/selectors.js b/e2e/helpers/selectors.js index 64fef6690..a729c613f 100644 --- a/e2e/helpers/selectors.js +++ b/e2e/helpers/selectors.js @@ -22,13 +22,10 @@ export default { userConfigThirdAutocomplete: '#localCompany', acceptButton: '.vn-confirm.shown button[response=accept]', searchButton: 'vn-searchbar vn-icon[icon="search"]', + globalItems: `button[type=submit]` }, clientsIndex: { - topbarSearch: 'vn-topbar', - searchButton: 'vn-searchbar vn-icon[icon="search"]', - searchResult: 'vn-client-index .vn-item', - createClientButton: `vn-float-button`, - othersButton: 'vn-left-menu li[name="Others"] > a' + createClientButton: `vn-float-button` }, clientSummary: { header: 'vn-client-summary > vn-card > h5', @@ -76,7 +73,6 @@ export default { socialName: 'vn-client-fiscal-data vn-textfield[ng-model="$ctrl.client.socialName"]', fiscalId: 'vn-client-fiscal-data vn-textfield[ng-model="$ctrl.client.fi"]', equalizationTaxCheckbox: 'vn-client-fiscal-data vn-check[ng-model="$ctrl.client.isEqualizated"]', - acceptPropagationButton: '.vn-confirm.shown button[response=accept]', address: 'vn-client-fiscal-data vn-textfield[ng-model="$ctrl.client.street"]', postcode: 'vn-client-fiscal-data vn-datalist[ng-model="$ctrl.client.postcode"]', city: 'vn-client-fiscal-data vn-datalist[ng-model="$ctrl.client.city"]', @@ -90,7 +86,6 @@ export default { notifyByMailCheckbox: 'vn-client-fiscal-data vn-check[label="Notify by email"]', viesCheckbox: 'vn-client-fiscal-data vn-check[label="Vies"]', saveButton: 'button[type=submit]', - acceptDuplicationButton: '.vn-confirm.shown button[response=accept]', watcher: 'vn-client-fiscal-data vn-watcher' }, clientBillingData: { @@ -211,15 +206,12 @@ export default { saveButton: 'button[type=submit]' }, itemsIndex: { - searchIcon: 'vn-searchbar vn-icon[icon="search"]', createItemButton: `vn-float-button`, firstSearchResult: 'vn-item-index a:nth-child(1)', searchResult: 'vn-item-index a.vn-tr', firstResultPreviewButton: 'vn-item-index vn-tbody > :nth-child(1) .buttons > [icon="desktop_windows"]', searchResultCloneButton: 'vn-item-index .buttons > [icon="icon-clone"]', acceptClonationAlertButton: '.vn-confirm.shown [response="accept"]', - topbarSearch: 'vn-topbar', - searchButton: 'vn-searchbar vn-icon[icon="search"]', closeItemSummaryPreview: '.vn-popup.shown', fieldsToShowButton: 'vn-item-index vn-table > div > div > vn-icon-button[icon="more_vert"]', fieldsToShowForm: '.vn-popover.shown .content', @@ -388,7 +380,6 @@ export default { searchWeeklyResult: 'vn-ticket-weekly-index vn-table vn-tbody > vn-tr', searchResultDate: 'vn-ticket-summary [label=Landed] span', topbarSearch: 'vn-searchbar', - searchButton: 'vn-searchbar vn-icon[icon="search"]', moreMenu: 'vn-ticket-index vn-icon-button[icon=more_vert]', sixthWeeklyTicket: 'vn-ticket-weekly-index vn-table vn-tr:nth-child(6)', weeklyTicket: 'vn-ticket-weekly-index vn-table > div > vn-tbody > vn-tr', @@ -438,7 +429,6 @@ export default { ticketExpedition: { expeditionButton: 'vn-left-menu a[ui-sref="ticket.card.expedition"]', secondExpeditionRemoveButton: 'vn-ticket-expedition vn-table div > vn-tbody > vn-tr:nth-child(2) > vn-td:nth-child(1) > vn-icon-button[icon="delete"]', - acceptDeleteRowButton: '.vn-confirm.shown button[response=accept]', expeditionRow: 'vn-ticket-expedition vn-table vn-tbody > vn-tr' }, ticketPackages: { @@ -506,8 +496,6 @@ export default { moveToTicketInput: 'form vn-input-number[ng-model="$ctrl.transfer.ticketId"] input', moveToTicketButton: '.vn-popover.shown vn-icon[icon="arrow_forward_ios"]', moveToNewTicketButton: '.vn-popover.shown vn-button[label="New ticket"]', - acceptDeleteLineButton: '.vn-confirm.shown button[response=accept]', - acceptDeleteTicketButton: '.vn-confirm.shown button[response=accept]', stateMenuButton: 'vn-ticket-sale vn-tool-bar > vn-button-menu[label="State"]', stateMenuFixOption: '' }, @@ -571,9 +559,7 @@ export default { saveStateButton: `button[type=submit]` }, claimsIndex: { - searchClaimInput: 'vn-searchbar', - searchResult: 'vn-claim-index vn-card > vn-table > div > vn-tbody > a', - searchButton: 'vn-searchbar vn-icon[icon="search"]' + searchResult: 'vn-claim-index vn-card > vn-table > div > vn-tbody > a' }, claimDescriptor: { moreMenu: 'vn-claim-descriptor vn-icon-button[icon=more_vert]', @@ -639,15 +625,13 @@ export default { secondSearchResultTotal: 'vn-order-index vn-card > vn-table > div > vn-tbody vn-tr:nth-child(2) vn-td:nth-child(9)', 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)', - searchButton: 'vn-searchbar vn-icon[icon="search"]', advancedSearchButton: 'vn-order-search-panel vn-submit[label="Search"]', openAdvancedSearch: 'vn-searchbar vn-icon[icon="arrow_drop_down"]', advancedSearchShowEmptyCheckbox: 'vn-order-search-panel vn-check[label="Show empty"]', createOrderButton: 'vn-float-button', }, orderDescriptor: { - returnToModuleIndexButton: 'vn-order-descriptor a[ui-sref="order.index"]', - acceptNavigationButton: '.vn-confirm.shown button[response=accept]' + returnToModuleIndexButton: 'vn-order-descriptor a[ui-sref="order.index"]' }, createOrderView: { client: 'vn-autocomplete[label="Client"]', @@ -832,7 +816,6 @@ export default { }, invoiceOutIndex: { topbarSearch: 'vn-searchbar', - searchButton: 'vn-searchbar vn-icon[icon="search"]', searchResult: 'vn-invoice-out-index vn-card > vn-table > div > vn-tbody > a.vn-tr', }, invoiceOutDescriptor: { diff --git a/e2e/paths/02-client/01_create_client.spec.js b/e2e/paths/02-client/01_create_client.spec.js index 2fdc4b091..f7a996f48 100644 --- a/e2e/paths/02-client/01_create_client.spec.js +++ b/e2e/paths/02-client/01_create_client.spec.js @@ -17,7 +17,7 @@ describe('Client create path', () => { it(`should search for the user Carol Danvers to confirm it isn't created yet`, async() => { await page.doSearch('Carol Danvers'); - const result = await page.countElement(selectors.clientsIndex.searchResult); + const result = await page.countElement(selectors.globalItems.searchResult); expect(result).toEqual(0); }); diff --git a/e2e/paths/02-client/03_edit_fiscal_data.spec.js b/e2e/paths/02-client/03_edit_fiscal_data.spec.js index 66eeb8b56..b2279062a 100644 --- a/e2e/paths/02-client/03_edit_fiscal_data.spec.js +++ b/e2e/paths/02-client/03_edit_fiscal_data.spec.js @@ -77,7 +77,7 @@ describe('Client Edit fiscalData path', () => { await page.waitToClick(selectors.clientFiscalData.equalizationTaxCheckbox); await page.waitToClick(selectors.clientFiscalData.verifiedDataCheckbox); await page.waitToClick(selectors.clientFiscalData.saveButton); - await page.waitToClick(selectors.clientFiscalData.acceptDuplicationButton); + await page.waitToClick(selectors.globalItems.acceptButton); const message = await page.waitForSnackbar(); expect(message.text).toBe('Invalid Tax number'); @@ -87,14 +87,14 @@ describe('Client Edit fiscalData path', () => { await page.clearInput(selectors.clientFiscalData.fiscalId); await page.write(selectors.clientFiscalData.fiscalId, '94980061C'); await page.waitToClick(selectors.clientFiscalData.saveButton); - await page.waitToClick(selectors.clientFiscalData.acceptDuplicationButton); + await page.waitToClick(selectors.globalItems.acceptButton); const message = await page.waitForSnackbar(); expect(message.type).toBe('success'); }); it('should propagate the Equalization tax', async() => { - await page.waitToClick(selectors.clientFiscalData.acceptPropagationButton); + await page.waitToClick(selectors.globalItems.acceptButton); const message = await page.waitForSnackbar(); expect(message.text).toBe('Equivalent tax spreaded'); @@ -157,7 +157,7 @@ describe('Client Edit fiscalData path', () => { it('should propagate the Equalization tax changes', async() => { await page.waitFor(1000); - await page.waitToClick(selectors.clientFiscalData.acceptPropagationButton); + await page.waitToClick(selectors.globalItems.acceptButton); const message = await page.waitForSnackbar(); expect(message.text).toBe('Equivalent tax spreaded'); diff --git a/e2e/paths/02-client/12_lock_of_verified_data.spec.js b/e2e/paths/02-client/12_lock_of_verified_data.spec.js index 79a9e17ac..b90ab7dfc 100644 --- a/e2e/paths/02-client/12_lock_of_verified_data.spec.js +++ b/e2e/paths/02-client/12_lock_of_verified_data.spec.js @@ -59,7 +59,7 @@ describe('Client lock verified data path', () => { it('should check the Verified data checkbox', async() => { await page.waitToClick(selectors.clientFiscalData.verifiedDataCheckbox); await page.waitToClick(selectors.clientFiscalData.saveButton); - await page.waitToClick(selectors.clientFiscalData.acceptDuplicationButton); + await page.waitToClick(selectors.globalItems.acceptButton); const message = await page.waitForSnackbar(); expect(message.type).toBe('success'); diff --git a/e2e/paths/04-item/10_index.spec.js b/e2e/paths/04-item/10_index.spec.js index a6c0d4919..655b72b2a 100644 --- a/e2e/paths/04-item/10_index.spec.js +++ b/e2e/paths/04-item/10_index.spec.js @@ -8,7 +8,7 @@ describe('Item index path', () => { browser = await getBrowser(); page = browser.page; await page.loginAndModule('salesPerson', 'item'); - await page.waitToClick(selectors.itemsIndex.searchIcon); + await page.waitToClick(selectors.globalItems.searchButton); }); afterAll(async() => { @@ -42,7 +42,7 @@ describe('Item index path', () => { it('should navigate forth and back to see the images column is still visible', async() => { await page.waitToClick(selectors.itemsIndex.firstSearchResult); await page.waitToClick(selectors.itemDescriptor.goBackToModuleIndexButton); - await page.waitToClick(selectors.itemsIndex.searchIcon); + await page.waitToClick(selectors.globalItems.searchButton); await page.wait(selectors.itemsIndex.searchResult); await page.waitImgLoad(selectors.itemsIndex.firstItemImage); const imageVisible = await page.isVisible(selectors.itemsIndex.firstItemImageTd); @@ -76,7 +76,7 @@ describe('Item index path', () => { it('should now navigate forth and back to see the ids column is now visible', async() => { await page.waitToClick(selectors.itemsIndex.firstSearchResult); await page.waitToClick(selectors.itemDescriptor.goBackToModuleIndexButton); - await page.waitToClick(selectors.itemsIndex.searchIcon); + await page.waitToClick(selectors.globalItems.searchButton); await page.wait(selectors.itemsIndex.searchResult); const idVisible = await page.isVisible(selectors.itemsIndex.firstItemId); diff --git a/e2e/paths/05-ticket/01-sale/01_list_sales.spec.js b/e2e/paths/05-ticket/01-sale/01_list_sales.spec.js index f883d08dc..4f5f9b76c 100644 --- a/e2e/paths/05-ticket/01-sale/01_list_sales.spec.js +++ b/e2e/paths/05-ticket/01-sale/01_list_sales.spec.js @@ -101,7 +101,7 @@ describe('Ticket List sale path', () => { await page.waitToClick(selectors.ticketSales.secondSaleCheckbox); await page.waitToClick(selectors.ticketSales.thirdSaleCheckbox); await page.waitToClick(selectors.ticketSales.deleteSaleButton); - await page.waitToClick(selectors.ticketSales.acceptDeleteLineButton); + await page.waitToClick(selectors.globalItems.acceptButton); const message = await page.waitForSnackbar(); expect(message.type).toBe('success'); diff --git a/e2e/paths/05-ticket/01-sale/02_edit_sale.spec.js b/e2e/paths/05-ticket/01-sale/02_edit_sale.spec.js index 08ff97b96..e530f1cb5 100644 --- a/e2e/paths/05-ticket/01-sale/02_edit_sale.spec.js +++ b/e2e/paths/05-ticket/01-sale/02_edit_sale.spec.js @@ -219,7 +219,7 @@ describe('Ticket Edit sale path', () => { await page.wait(2000); await page.waitToClick(selectors.ticketSales.deleteSaleButton); await page.wait(2000); - await page.waitToClick(selectors.ticketSales.acceptDeleteLineButton); + await page.waitToClick(selectors.globalItems.acceptButton); await page.wait(2000); await page.waitForSpinnerLoad(); const message = await page.waitForSnackbar(); diff --git a/e2e/paths/05-ticket/02_expeditions_and_log.spec.js b/e2e/paths/05-ticket/02_expeditions_and_log.spec.js index 2d046e3a9..e4f8a7754 100644 --- a/e2e/paths/05-ticket/02_expeditions_and_log.spec.js +++ b/e2e/paths/05-ticket/02_expeditions_and_log.spec.js @@ -19,7 +19,7 @@ describe('Ticket expeditions and log path', () => { it(`should delete a former expedition and confirm the remaining expedition are the expected ones`, async() => { await page.waitToClick(selectors.ticketExpedition.secondExpeditionRemoveButton); - await page.waitToClick(selectors.ticketExpedition.acceptDeleteRowButton); + await page.waitToClick(selectors.globalItems.acceptButton); await page.reloadSection('ticket.card.expedition'); await page.waitForSelector(selectors.ticketExpedition.expeditionRow, {}); diff --git a/e2e/paths/05-ticket/12_descriptor.spec.js b/e2e/paths/05-ticket/12_descriptor.spec.js index faeae0c3f..9d67365a8 100644 --- a/e2e/paths/05-ticket/12_descriptor.spec.js +++ b/e2e/paths/05-ticket/12_descriptor.spec.js @@ -53,7 +53,7 @@ describe('Ticket descriptor path', () => { it(`should search for the deleted ticket and check it's date`, async() => { await page.write(selectors.ticketsIndex.topbarSearch, '18'); - await page.waitToClick(selectors.ticketsIndex.searchButton); + await page.waitToClick(selectors.globalItems.searchButton); await page.waitForState('ticket.card.summary'); const result = await page.waitToGetProperty(selectors.ticketsIndex.searchResultDate, 'innerText'); diff --git a/e2e/paths/07-order/02_basic_data.spec.js b/e2e/paths/07-order/02_basic_data.spec.js index 38d6619e0..a76f7dbcc 100644 --- a/e2e/paths/07-order/02_basic_data.spec.js +++ b/e2e/paths/07-order/02_basic_data.spec.js @@ -34,7 +34,7 @@ describe('Order edit basic data path', () => { const orderId = '16'; await page.waitToClick(selectors.orderDescriptor.returnToModuleIndexButton); - await page.waitToClick(selectors.orderDescriptor.acceptNavigationButton); + await page.waitToClick(selectors.globalItems.acceptButton); await page.waitForContentLoaded(); await page.accessToSearchResult(orderId); await page.accessToSection('order.card.basicData'); diff --git a/e2e/paths/07-order/05_index.spec.js b/e2e/paths/07-order/05_index.spec.js index c07a9c6f7..23769766c 100644 --- a/e2e/paths/07-order/05_index.spec.js +++ b/e2e/paths/07-order/05_index.spec.js @@ -16,7 +16,7 @@ describe('Order Index', () => { }); it(`should check the second search result doesn't contain a total of 0€`, async() => { - await page.waitToClick(selectors.ordersIndex.searchButton); + await page.waitToClick(selectors.globalItems.searchButton); const result = await page.waitToGetProperty(selectors.ordersIndex.secondSearchResultTotal, 'innerText'); expect(result).not.toContain('0.00');