diff --git a/e2e/dms/ecc/3.jpeg b/e2e/dms/ecc/3.jpeg new file mode 100644 index 000000000..fb2483f69 Binary files /dev/null and b/e2e/dms/ecc/3.jpeg differ diff --git a/e2e/helpers/extensions.js b/e2e/helpers/extensions.js index 452dd3a4d..ea8f50626 100644 --- a/e2e/helpers/extensions.js +++ b/e2e/helpers/extensions.js @@ -21,6 +21,7 @@ let actions = { } catch (error) { throw new Error(`failed to reach URL containing: ${expectedHash}`); } + await this.waitForContentLoaded(); return true; }, @@ -167,7 +168,7 @@ let actions = { waitToGetProperty: async function(selector, property) { let builtSelector = selector; - if (property != 'innerText') + if (selector.includes('vn-input-file') || property != 'innerText') builtSelector = await this.selectorFormater(selector); try { @@ -311,6 +312,9 @@ let actions = { if (selector.includes('vn-textfield')) return builtSelector = `${selector} input`; + if (selector.includes('vn-input-file')) + return builtSelector = `${selector} section`; + return builtSelector; }, @@ -365,14 +369,15 @@ let actions = { await this.write('vn-searchbar', searchValue); await this.waitToClick('vn-searchbar vn-icon[icon="search"]'); await this.waitForNumberOfElements('.search-result', 1); - await this.waitFor(1000); + await this.waitForContentLoaded(); await this.evaluate(() => { return document.querySelector('.search-result').click(); }); + await this.waitForContentLoaded(); }, accessToSection: async function(sectionRoute) { - await this.waitForSelector(`vn-left-menu`, {visible: true}); + await this.waitForSelector('vn-left-menu'); let nested = await this.evaluate(sectionRoute => { return document.querySelector(`vn-left-menu li li > a[ui-sref="${sectionRoute}"]`) != null; }, sectionRoute); @@ -394,6 +399,7 @@ let actions = { autocompleteSearch: async function(selector, searchValue) { let builtSelector = await this.selectorFormater(selector); + await this.waitForContentLoaded(); await this.waitToClick(selector); await this.waitForSelector(selector => { document @@ -424,10 +430,11 @@ let actions = { }, {}, builtSelector, searchValue); await this.waitForMutation(`.vn-drop-down`, 'childList'); + await this.waitForContentLoaded(); }, reloadSection: async function(sectionRoute) { - await this.waitFor(1000); + await this.waitForContentLoaded(); await Promise.all([ this.waitForNavigation({waitUntil: 'networkidle0'}), this.click('vn-icon[icon="desktop_windows"]', {}), @@ -437,6 +444,7 @@ let actions = { this.waitForNavigation({waitUntil: 'networkidle0'}), this.click(`vn-left-menu li > a[ui-sref="${sectionRoute}"]`, {}), ]); + await this.waitForContentLoaded(); }, forceReloadSection: async function(sectionRoute) { diff --git a/e2e/helpers/selectors.js b/e2e/helpers/selectors.js index 99c78eea2..ed232ef3b 100644 --- a/e2e/helpers/selectors.js +++ b/e2e/helpers/selectors.js @@ -748,5 +748,12 @@ export default { taxTwo: 'vn-invoice-out-summary > vn-card > vn-horizontal > vn-two > vn-table > div > vn-tbody > vn-tr:nth-child(2)', ticketOne: 'vn-invoice-out-summary > vn-card > vn-horizontal > vn-auto > vn-table > div > vn-tbody > vn-tr:nth-child(1)', ticketTwo: 'vn-invoice-out-summary > vn-card > vn-horizontal > vn-auto > vn-table > div > vn-tbody > vn-tr:nth-child(2)' + }, + travelThermograph: { + add: 'vn-travel-thermograph-index vn-float-button[icon="add"]', + thermographID: 'vn-travel-thermograph-create vn-autocomplete[ng-model="$ctrl.dms.thermographId"]', + uploadIcon: 'vn-travel-thermograph-create vn-icon[icon="cloud_upload"]', + createdThermograph: 'vn-travel-thermograph-index vn-tbody > vn-tr', + upload: 'vn-travel-thermograph-create button[type=submit]' } }; diff --git a/e2e/paths/02-client-module/01_create_client.spec.js b/e2e/paths/02-client/01_create_client.spec.js similarity index 98% rename from e2e/paths/02-client-module/01_create_client.spec.js rename to e2e/paths/02-client/01_create_client.spec.js index 29525df49..8f1a116ee 100644 --- a/e2e/paths/02-client-module/01_create_client.spec.js +++ b/e2e/paths/02-client/01_create_client.spec.js @@ -53,7 +53,6 @@ describe('Client create path', async() => { await page.write(selectors.createClientView.name, 'Carol Danvers'); await page.write(selectors.createClientView.socialName, 'AVG tax'); await page.write(selectors.createClientView.street, 'Many places'); - await page.waitForContentLoaded(); await page.autocompleteSearch(selectors.createClientView.country, 'EspaƱa'); await page.autocompleteSearch(selectors.createClientView.province, 'Province one'); await page.write(selectors.createClientView.city, 'Valencia'); @@ -113,7 +112,6 @@ describe('Client create path', async() => { }); it(`should search for the user Carol Danvers to confirm it exists`, async() => { - await page.waitForContentLoaded(); await page.accessToSearchResult('Carol Danvers'); let url = await page.expectURL('#!/client/114/summary'); diff --git a/e2e/paths/02-client-module/02_edit_basic_data.spec.js b/e2e/paths/02-client/02_edit_basic_data.spec.js similarity index 97% rename from e2e/paths/02-client-module/02_edit_basic_data.spec.js rename to e2e/paths/02-client/02_edit_basic_data.spec.js index 8b665bd96..9373dfe86 100644 --- a/e2e/paths/02-client-module/02_edit_basic_data.spec.js +++ b/e2e/paths/02-client/02_edit_basic_data.spec.js @@ -70,14 +70,14 @@ describe('Client Edit basicData path', () => { }); describe('as salesAssistant', () => { - beforeAll(async() => { + it('should navigate to a client basic data', async() => { await page.loginAndModule('salesASsistant', 'client'); await page.accessToSearchResult('Ptonomy Wallace'); await page.accessToSection('client.card.basicData'); - }); + }, 30000); it('should be able to change the salesPerson', async() => { - await page.wait(selectors.clientBasicData.name); + await page.waitForSelector(selectors.clientBasicData.name); const result = await page.evaluate(selector => { return document.querySelector(selector).disabled; }, `${selectors.clientBasicData.salesPerson} input`); diff --git a/e2e/paths/02-client-module/03_edit_fiscal_data.spec.js b/e2e/paths/02-client/03_edit_fiscal_data.spec.js similarity index 99% rename from e2e/paths/02-client-module/03_edit_fiscal_data.spec.js rename to e2e/paths/02-client/03_edit_fiscal_data.spec.js index d39f196cb..ac08b100d 100644 --- a/e2e/paths/02-client-module/03_edit_fiscal_data.spec.js +++ b/e2e/paths/02-client/03_edit_fiscal_data.spec.js @@ -83,7 +83,7 @@ describe('Client Edit fiscalData path', () => { const result = await page.waitForLastSnackbar(); expect(result).toEqual('Invalid Tax number'); - }, 15000); + }); it(`should edit the fiscal this time with a valid fiscal id`, async() => { await page.clearInput(selectors.clientFiscalData.fiscalId); diff --git a/e2e/paths/02-client-module/04_edit_billing_data.spec.js b/e2e/paths/02-client/04_edit_billing_data.spec.js similarity index 100% rename from e2e/paths/02-client-module/04_edit_billing_data.spec.js rename to e2e/paths/02-client/04_edit_billing_data.spec.js diff --git a/e2e/paths/02-client-module/05_add_address.spec.js b/e2e/paths/02-client/05_add_address.spec.js similarity index 100% rename from e2e/paths/02-client-module/05_add_address.spec.js rename to e2e/paths/02-client/05_add_address.spec.js diff --git a/e2e/paths/02-client-module/06_add_address_notes.spec.js b/e2e/paths/02-client/06_add_address_notes.spec.js similarity index 100% rename from e2e/paths/02-client-module/06_add_address_notes.spec.js rename to e2e/paths/02-client/06_add_address_notes.spec.js diff --git a/e2e/paths/02-client-module/07_edit_web_access.spec.js b/e2e/paths/02-client/07_edit_web_access.spec.js similarity index 100% rename from e2e/paths/02-client-module/07_edit_web_access.spec.js rename to e2e/paths/02-client/07_edit_web_access.spec.js diff --git a/e2e/paths/02-client-module/08_add_notes.spec.js b/e2e/paths/02-client/08_add_notes.spec.js similarity index 100% rename from e2e/paths/02-client-module/08_add_notes.spec.js rename to e2e/paths/02-client/08_add_notes.spec.js diff --git a/e2e/paths/02-client-module/09_add_credit.spec.js b/e2e/paths/02-client/09_add_credit.spec.js similarity index 94% rename from e2e/paths/02-client-module/09_add_credit.spec.js rename to e2e/paths/02-client/09_add_credit.spec.js index 1cb06fb36..05c50e809 100644 --- a/e2e/paths/02-client-module/09_add_credit.spec.js +++ b/e2e/paths/02-client/09_add_credit.spec.js @@ -24,7 +24,6 @@ describe('Client Add credit path', () => { }); it(`should edit the credit`, async() => { - await page.waitForContentLoaded(); await page.clearInput(selectors.clientCredit.credit); await page.write(selectors.clientCredit.credit, '999'); await page.waitToClick(selectors.clientCredit.saveButton); @@ -34,7 +33,6 @@ describe('Client Add credit path', () => { }); it('should confirm the credit was updated', async() => { - await page.waitForContentLoaded(); const result = await page.waitToGetProperty(selectors.clientCredit.firstCreditText, 'innerText'); expect(result).toContain(999); diff --git a/e2e/paths/02-client-module/10_add_greuge.spec.js b/e2e/paths/02-client/10_add_greuge.spec.js similarity index 100% rename from e2e/paths/02-client-module/10_add_greuge.spec.js rename to e2e/paths/02-client/10_add_greuge.spec.js diff --git a/e2e/paths/02-client-module/11_mandate.spec.js b/e2e/paths/02-client/11_mandate.spec.js similarity index 100% rename from e2e/paths/02-client-module/11_mandate.spec.js rename to e2e/paths/02-client/11_mandate.spec.js diff --git a/e2e/paths/02-client-module/12_lock_of_verified_data.spec.js b/e2e/paths/02-client/12_lock_of_verified_data.spec.js similarity index 100% rename from e2e/paths/02-client-module/12_lock_of_verified_data.spec.js rename to e2e/paths/02-client/12_lock_of_verified_data.spec.js diff --git a/e2e/paths/02-client-module/13_log.spec.js b/e2e/paths/02-client/13_log.spec.js similarity index 100% rename from e2e/paths/02-client-module/13_log.spec.js rename to e2e/paths/02-client/13_log.spec.js diff --git a/e2e/paths/02-client-module/14_balance.spec.js b/e2e/paths/02-client/14_balance.spec.js similarity index 98% rename from e2e/paths/02-client-module/14_balance.spec.js rename to e2e/paths/02-client/14_balance.spec.js index 2e29dc04e..52d179383 100644 --- a/e2e/paths/02-client-module/14_balance.spec.js +++ b/e2e/paths/02-client/14_balance.spec.js @@ -17,7 +17,6 @@ describe('Client balance path', () => { it('should now edit the local user config data', async() => { await page.waitToClick(selectors.globalItems.userMenuButton); - await page.waitForContentLoaded(); await page.autocompleteSearch(selectors.globalItems.userLocalCompany, 'CCs'); let result = await page.waitForLastSnackbar(); @@ -118,7 +117,6 @@ describe('Client balance path', () => { }); it('should now search for the user Petter Parker', async() => { - await page.waitForContentLoaded(); await page.write(selectors.clientsIndex.topbarSearch, 'Petter Parker'); await page.waitToClick(selectors.clientsIndex.searchButton); await page.waitForNumberOfElements(selectors.clientsIndex.searchResult, 1); diff --git a/e2e/paths/02-client-module/15_user_config.spec.js b/e2e/paths/02-client/15_user_config.spec.js similarity index 99% rename from e2e/paths/02-client-module/15_user_config.spec.js rename to e2e/paths/02-client/15_user_config.spec.js index 6f76c73ca..193305177 100644 --- a/e2e/paths/02-client-module/15_user_config.spec.js +++ b/e2e/paths/02-client/15_user_config.spec.js @@ -21,7 +21,7 @@ describe('User config', () => { it('should now open the user config form to check the settings', async() => { await page.waitToClick(selectors.globalItems.userMenuButton); - await page.waitFor(1000); + await page.waitForContentLoaded(); let expectedLocalWarehouse = await page .expectPropertyValue(selectors.globalItems.userLocalWarehouse, 'value', ''); diff --git a/e2e/paths/02-client-module/16_web_payment.spec.js b/e2e/paths/02-client/16_web_payment.spec.js similarity index 100% rename from e2e/paths/02-client-module/16_web_payment.spec.js rename to e2e/paths/02-client/16_web_payment.spec.js diff --git a/e2e/paths/02-client-module/17_dms.spec.js b/e2e/paths/02-client/17_dms.spec.js similarity index 100% rename from e2e/paths/02-client-module/17_dms.spec.js rename to e2e/paths/02-client/17_dms.spec.js diff --git a/e2e/paths/02-client-module/18_contacts.spec.js b/e2e/paths/02-client/18_contacts.spec.js similarity index 100% rename from e2e/paths/02-client-module/18_contacts.spec.js rename to e2e/paths/02-client/18_contacts.spec.js diff --git a/e2e/paths/03-worker-module/01_basicData.spec.js b/e2e/paths/03-worker/01_basicData.spec.js similarity index 100% rename from e2e/paths/03-worker-module/01_basicData.spec.js rename to e2e/paths/03-worker/01_basicData.spec.js diff --git a/e2e/paths/03-worker-module/02_time_control.spec.js b/e2e/paths/03-worker/02_time_control.spec.js similarity index 100% rename from e2e/paths/03-worker-module/02_time_control.spec.js rename to e2e/paths/03-worker/02_time_control.spec.js diff --git a/e2e/paths/03-worker-module/03_pbx.spec.js b/e2e/paths/03-worker/03_pbx.spec.js similarity index 100% rename from e2e/paths/03-worker-module/03_pbx.spec.js rename to e2e/paths/03-worker/03_pbx.spec.js diff --git a/e2e/paths/04-item-module/01_summary.spec.js b/e2e/paths/04-item/01_summary.spec.js similarity index 100% rename from e2e/paths/04-item-module/01_summary.spec.js rename to e2e/paths/04-item/01_summary.spec.js diff --git a/e2e/paths/04-item-module/02_basic_data.spec.js b/e2e/paths/04-item/02_basic_data.spec.js similarity index 98% rename from e2e/paths/04-item-module/02_basic_data.spec.js rename to e2e/paths/04-item/02_basic_data.spec.js index 2b3ff9d51..2c8a8a7a1 100644 --- a/e2e/paths/04-item-module/02_basic_data.spec.js +++ b/e2e/paths/04-item/02_basic_data.spec.js @@ -41,7 +41,6 @@ describe('Item Edit basic data path', () => { it(`should confirm the item name was edited`, async() => { await page.reloadSection('item.card.basicData'); - await page.waitForContentLoaded(); const result = await page.waitToGetProperty(selectors.itemBasicData.name, 'value'); expect(result).toEqual('Rose of Purity'); diff --git a/e2e/paths/04-item-module/03_tax.spec.js b/e2e/paths/04-item/03_tax.spec.js similarity index 100% rename from e2e/paths/04-item-module/03_tax.spec.js rename to e2e/paths/04-item/03_tax.spec.js diff --git a/e2e/paths/04-item-module/04_tags.spec.js b/e2e/paths/04-item/04_tags.spec.js similarity index 100% rename from e2e/paths/04-item-module/04_tags.spec.js rename to e2e/paths/04-item/04_tags.spec.js diff --git a/e2e/paths/04-item-module/05_niche.spec.js b/e2e/paths/04-item/05_niche.spec.js similarity index 100% rename from e2e/paths/04-item-module/05_niche.spec.js rename to e2e/paths/04-item/05_niche.spec.js diff --git a/e2e/paths/04-item-module/06_botanical.spec.js b/e2e/paths/04-item/06_botanical.spec.js similarity index 100% rename from e2e/paths/04-item-module/06_botanical.spec.js rename to e2e/paths/04-item/06_botanical.spec.js diff --git a/e2e/paths/04-item-module/07_barcode.spec.js b/e2e/paths/04-item/07_barcode.spec.js similarity index 100% rename from e2e/paths/04-item-module/07_barcode.spec.js rename to e2e/paths/04-item/07_barcode.spec.js diff --git a/e2e/paths/04-item-module/08_create_and_clone.spec.js b/e2e/paths/04-item/08_create_and_clone.spec.js similarity index 99% rename from e2e/paths/04-item-module/08_create_and_clone.spec.js rename to e2e/paths/04-item/08_create_and_clone.spec.js index 7d6a8e54d..32d0ff23b 100644 --- a/e2e/paths/04-item-module/08_create_and_clone.spec.js +++ b/e2e/paths/04-item/08_create_and_clone.spec.js @@ -40,7 +40,6 @@ describe('Item Create/Clone path', () => { }); it('should now access to the create item view by clicking the create floating button', async() => { - await page.waitForContentLoaded(); await page.waitToClick(selectors.itemsIndex.createItemButton); let url = await page.expectURL('#!/item/create'); diff --git a/e2e/paths/04-item-module/09_regularize.spec.js b/e2e/paths/04-item/09_regularize.spec.js similarity index 99% rename from e2e/paths/04-item-module/09_regularize.spec.js rename to e2e/paths/04-item/09_regularize.spec.js index 76e92f8a6..e43429aa0 100644 --- a/e2e/paths/04-item-module/09_regularize.spec.js +++ b/e2e/paths/04-item/09_regularize.spec.js @@ -81,7 +81,6 @@ describe('Item regularize path', () => { }); it('should clear the user local settings now', async() => { - await page.waitForTransitionEnd('vn-searchbar'); await page.waitToClick(selectors.globalItems.userMenuButton); await page.clearInput(selectors.globalItems.userConfigFirstAutocomplete); const result = await page.waitForLastSnackbar(); diff --git a/e2e/paths/04-item-module/10_item_index.spec.js b/e2e/paths/04-item/10_item_index.spec.js similarity index 100% rename from e2e/paths/04-item-module/10_item_index.spec.js rename to e2e/paths/04-item/10_item_index.spec.js diff --git a/e2e/paths/04-item-module/11_item_log.spec.js b/e2e/paths/04-item/11_item_log.spec.js similarity index 100% rename from e2e/paths/04-item-module/11_item_log.spec.js rename to e2e/paths/04-item/11_item_log.spec.js diff --git a/e2e/paths/04-item-module/12_descriptor.spec.js b/e2e/paths/04-item/12_descriptor.spec.js similarity index 100% rename from e2e/paths/04-item-module/12_descriptor.spec.js rename to e2e/paths/04-item/12_descriptor.spec.js diff --git a/e2e/paths/05-ticket-module/01-sale/01_list_sales.spec.js b/e2e/paths/05-ticket/01-sale/01_list_sales.spec.js similarity index 100% rename from e2e/paths/05-ticket-module/01-sale/01_list_sales.spec.js rename to e2e/paths/05-ticket/01-sale/01_list_sales.spec.js diff --git a/e2e/paths/05-ticket-module/01-sale/02_edit_sale.spec.js b/e2e/paths/05-ticket/01-sale/02_edit_sale.spec.js similarity index 100% rename from e2e/paths/05-ticket-module/01-sale/02_edit_sale.spec.js rename to e2e/paths/05-ticket/01-sale/02_edit_sale.spec.js diff --git a/e2e/paths/05-ticket-module/01_observations.spec.js b/e2e/paths/05-ticket/01_observations.spec.js similarity index 99% rename from e2e/paths/05-ticket-module/01_observations.spec.js rename to e2e/paths/05-ticket/01_observations.spec.js index b343bcfeb..cccfa8b67 100644 --- a/e2e/paths/05-ticket-module/01_observations.spec.js +++ b/e2e/paths/05-ticket/01_observations.spec.js @@ -25,7 +25,7 @@ describe('Ticket Create notes path', () => { const result = await page.waitForLastSnackbar(); expect(result).toEqual('Data saved!'); - }, 15000); + }); it('should confirm the note is the expected one', async() => { await page.reloadSection('ticket.card.observation'); diff --git a/e2e/paths/05-ticket-module/02_expeditions_and_log.spec.js b/e2e/paths/05-ticket/02_expeditions_and_log.spec.js similarity index 100% rename from e2e/paths/05-ticket-module/02_expeditions_and_log.spec.js rename to e2e/paths/05-ticket/02_expeditions_and_log.spec.js diff --git a/e2e/paths/05-ticket-module/04_packages.spec.js b/e2e/paths/05-ticket/04_packages.spec.js similarity index 100% rename from e2e/paths/05-ticket-module/04_packages.spec.js rename to e2e/paths/05-ticket/04_packages.spec.js diff --git a/e2e/paths/05-ticket-module/05_tracking_state.spec.js b/e2e/paths/05-ticket/05_tracking_state.spec.js similarity index 100% rename from e2e/paths/05-ticket-module/05_tracking_state.spec.js rename to e2e/paths/05-ticket/05_tracking_state.spec.js diff --git a/e2e/paths/05-ticket-module/06_basic_data_steps.spec.js b/e2e/paths/05-ticket/06_basic_data_steps.spec.js similarity index 100% rename from e2e/paths/05-ticket-module/06_basic_data_steps.spec.js rename to e2e/paths/05-ticket/06_basic_data_steps.spec.js diff --git a/e2e/paths/05-ticket-module/08_components.spec.js b/e2e/paths/05-ticket/08_components.spec.js similarity index 100% rename from e2e/paths/05-ticket-module/08_components.spec.js rename to e2e/paths/05-ticket/08_components.spec.js diff --git a/e2e/paths/05-ticket-module/09_weekly.spec.js b/e2e/paths/05-ticket/09_weekly.spec.js similarity index 97% rename from e2e/paths/05-ticket-module/09_weekly.spec.js rename to e2e/paths/05-ticket/09_weekly.spec.js index e88018ad5..c732a4b87 100644 --- a/e2e/paths/05-ticket-module/09_weekly.spec.js +++ b/e2e/paths/05-ticket/09_weekly.spec.js @@ -26,7 +26,6 @@ describe('Ticket descriptor path', () => { it('should go back to the ticket index then search and access a ticket summary', async() => { await page.accessToSection('ticket.index'); await page.accessToSearchResult('11'); - await page.waitForContentLoaded(); }); it('should add the ticket to thursday turn using the descriptor more menu', async() => { @@ -64,7 +63,6 @@ describe('Ticket descriptor path', () => { }); it('should now search for the ticket 11', async() => { - await page.waitForContentLoaded(); await page.write(selectors.ticketsIndex.topbarSearch, '11'); await page.waitToClick(selectors.ticketsIndex.searchButton); await page.waitForNumberOfElements(selectors.ticketsIndex.searchResult, 1); @@ -81,7 +79,6 @@ describe('Ticket descriptor path', () => { }); it('should add the ticket to saturday turn using the descriptor more menu', async() => { - await page.waitForContentLoaded(); await page.waitToClick(selectors.ticketDescriptor.moreMenu); await page.waitToClick(selectors.ticketDescriptor.moreMenuAddToTurn); await page.waitToClick(selectors.ticketDescriptor.saturdayButton); diff --git a/e2e/paths/05-ticket-module/10_request.spec.js b/e2e/paths/05-ticket/10_request.spec.js similarity index 100% rename from e2e/paths/05-ticket-module/10_request.spec.js rename to e2e/paths/05-ticket/10_request.spec.js diff --git a/e2e/paths/05-ticket-module/11_diary.spec.js b/e2e/paths/05-ticket/11_diary.spec.js similarity index 100% rename from e2e/paths/05-ticket-module/11_diary.spec.js rename to e2e/paths/05-ticket/11_diary.spec.js diff --git a/e2e/paths/05-ticket-module/12_descriptor.spec.js b/e2e/paths/05-ticket/12_descriptor.spec.js similarity index 98% rename from e2e/paths/05-ticket-module/12_descriptor.spec.js rename to e2e/paths/05-ticket/12_descriptor.spec.js index 6e3864b48..1aa0516de 100644 --- a/e2e/paths/05-ticket-module/12_descriptor.spec.js +++ b/e2e/paths/05-ticket/12_descriptor.spec.js @@ -34,7 +34,6 @@ describe('Ticket descriptor path', () => { }); it(`should update the shipped hour using the descriptor menu`, async() => { - await page.waitForContentLoaded(); await page.waitToClick(selectors.ticketDescriptor.moreMenu); await page.waitToClick(selectors.ticketDescriptor.moreMenuChangeShippedHour); await page.pickTime(selectors.ticketDescriptor.changeShippedHour, '08:15'); @@ -130,7 +129,6 @@ describe('Ticket descriptor path', () => { }); it('should delete the stowaway', async() => { - await page.waitForContentLoaded(); await page.waitToClick(selectors.ticketDescriptor.moreMenu); await page.waitToClick(selectors.ticketDescriptor.moreMenuDeleteStowawayButton); await page.waitToClick(selectors.ticketDescriptor.acceptDeleteStowawayButton); diff --git a/e2e/paths/05-ticket-module/13_services.spec.js b/e2e/paths/05-ticket/13_services.spec.js similarity index 98% rename from e2e/paths/05-ticket-module/13_services.spec.js rename to e2e/paths/05-ticket/13_services.spec.js index cafc5f27c..0a09c7aa3 100644 --- a/e2e/paths/05-ticket-module/13_services.spec.js +++ b/e2e/paths/05-ticket/13_services.spec.js @@ -26,7 +26,7 @@ describe('Ticket services path', () => { const result = await page.isDisabled(selectors.ticketService.firstAddServiceTypeButton); expect(result).toBeTruthy(); - }, 15000); + }); it('should receive an error if you attempt to save a service without access rights', async() => { await page.clearInput(selectors.ticketService.firstPrice); @@ -50,7 +50,6 @@ describe('Ticket services path', () => { }); it('should click on the add button to prepare the form to create a new service', async() => { - await page.waitForContentLoaded(); await page.waitToClick(selectors.ticketService.addServiceButton); const result = await page .isVisible(selectors.ticketService.firstServiceType); diff --git a/e2e/paths/05-ticket-module/14_create_ticket.spec.js b/e2e/paths/05-ticket/14_create_ticket.spec.js similarity index 100% rename from e2e/paths/05-ticket-module/14_create_ticket.spec.js rename to e2e/paths/05-ticket/14_create_ticket.spec.js diff --git a/e2e/paths/05-ticket-module/15_create_ticket_from_client.spec.js b/e2e/paths/05-ticket/15_create_ticket_from_client.spec.js similarity index 96% rename from e2e/paths/05-ticket-module/15_create_ticket_from_client.spec.js rename to e2e/paths/05-ticket/15_create_ticket_from_client.spec.js index 80bb217fb..28c11de3a 100644 --- a/e2e/paths/05-ticket-module/15_create_ticket_from_client.spec.js +++ b/e2e/paths/05-ticket/15_create_ticket_from_client.spec.js @@ -17,7 +17,6 @@ describe('Ticket create from client path', () => { }); it('should click the create simple ticket on the descriptor menu', async() => { - await page.waitForContentLoaded(); await page.waitToClick(selectors.clientDescriptor.moreMenu); await page.waitToClick(selectors.clientDescriptor.simpleTicketButton); let url = await page.expectURL('clientFk=102'); diff --git a/e2e/paths/05-ticket-module/16_summary.spec.js b/e2e/paths/05-ticket/16_summary.spec.js similarity index 100% rename from e2e/paths/05-ticket-module/16_summary.spec.js rename to e2e/paths/05-ticket/16_summary.spec.js diff --git a/e2e/paths/06-claim-module/01_basic_data.spec.js b/e2e/paths/06-claim/01_basic_data.spec.js similarity index 100% rename from e2e/paths/06-claim-module/01_basic_data.spec.js rename to e2e/paths/06-claim/01_basic_data.spec.js diff --git a/e2e/paths/06-claim-module/02_development.spec.js b/e2e/paths/06-claim/02_development.spec.js similarity index 99% rename from e2e/paths/06-claim-module/02_development.spec.js rename to e2e/paths/06-claim/02_development.spec.js index 351dee50f..346f88581 100644 --- a/e2e/paths/06-claim-module/02_development.spec.js +++ b/e2e/paths/06-claim/02_development.spec.js @@ -29,7 +29,7 @@ describe('Claim development', () => { const result = await page.waitForLastSnackbar(); expect(result).toEqual('Data saved!'); - }, 15000); + }); it(`should redirect to the next section of claims as the role is salesAssistant`, async() => { let url = await page.expectURL('/action'); diff --git a/e2e/paths/06-claim-module/03_detail.spec.js b/e2e/paths/06-claim/03_detail.spec.js similarity index 100% rename from e2e/paths/06-claim-module/03_detail.spec.js rename to e2e/paths/06-claim/03_detail.spec.js diff --git a/e2e/paths/06-claim-module/04_claim_action.spec.js b/e2e/paths/06-claim/04_claim_action.spec.js similarity index 100% rename from e2e/paths/06-claim-module/04_claim_action.spec.js rename to e2e/paths/06-claim/04_claim_action.spec.js diff --git a/e2e/paths/06-claim-module/05_summary.spec.js b/e2e/paths/06-claim/05_summary.spec.js similarity index 100% rename from e2e/paths/06-claim-module/05_summary.spec.js rename to e2e/paths/06-claim/05_summary.spec.js diff --git a/e2e/paths/06-claim-module/06_descriptor.spec.js b/e2e/paths/06-claim/06_descriptor.spec.js similarity index 98% rename from e2e/paths/06-claim-module/06_descriptor.spec.js rename to e2e/paths/06-claim/06_descriptor.spec.js index 8e6b3fd05..104f63945 100644 --- a/e2e/paths/06-claim-module/06_descriptor.spec.js +++ b/e2e/paths/06-claim/06_descriptor.spec.js @@ -24,7 +24,6 @@ describe('claim Descriptor path', () => { }); it(`should not be able to see the delete claim button of the descriptor more menu`, async() => { - await page.waitForContentLoaded(); await page.waitToClick(selectors.claimDescriptor.moreMenu); await page.waitForSelector(selectors.claimDescriptor.moreMenuDeleteClaim, {hidden: true}); }); diff --git a/e2e/paths/07-order-module/01_edit_basic_data.spec.js b/e2e/paths/07-order/01_edit_basic_data.spec.js similarity index 97% rename from e2e/paths/07-order-module/01_edit_basic_data.spec.js rename to e2e/paths/07-order/01_edit_basic_data.spec.js index 2cbee95f7..768985628 100644 --- a/e2e/paths/07-order-module/01_edit_basic_data.spec.js +++ b/e2e/paths/07-order/01_edit_basic_data.spec.js @@ -27,7 +27,7 @@ describe('Order edit basic data path', () => { const result = await page.waitForLastSnackbar(); expect(result).toEqual(`You can't make changes on the basic data of an confirmed order or with rows`); - }, 15000); + }); }); describe('when order with rows', () => { @@ -39,7 +39,6 @@ describe('Order edit basic data path', () => { await page.waitForContentLoaded(); await page.accessToSearchResult(orderId); await page.accessToSection('order.card.basicData'); - await page.waitForContentLoaded(); await page.waitForSelector(selectors.orderBasicData.observation, {visible: true}); let url = await page.expectURL(`#!/order/${orderId}/basic-data`); @@ -47,7 +46,6 @@ describe('Order edit basic data path', () => { }); it('should not be able to change anything', async() => { - await page.waitForContentLoaded(); await page.write(selectors.orderBasicData.observation, 'observation'); await page.waitToClick(selectors.orderBasicData.saveButton); const result = await page.waitForLastSnackbar(); diff --git a/e2e/paths/07-order-module/02_catalog.spec.js b/e2e/paths/07-order/02_catalog.spec.js similarity index 97% rename from e2e/paths/07-order-module/02_catalog.spec.js rename to e2e/paths/07-order/02_catalog.spec.js index d67dd3c92..ca6489779 100644 --- a/e2e/paths/07-order-module/02_catalog.spec.js +++ b/e2e/paths/07-order/02_catalog.spec.js @@ -35,9 +35,7 @@ describe('Order catalog', () => { }); it('should add the realm and type filters and obtain results', async() => { - await page.waitForContentLoaded(); await page.waitToClick(selectors.orderCatalog.plantRealmButton); - await page.waitForContentLoaded(); await page.autocompleteSearch(selectors.orderCatalog.type, 'Anthurium'); await page.waitForNumberOfElements('section.product', 4); const result = await page.countElement('section.product'); diff --git a/e2e/paths/07-order-module/03_lines.spec.js b/e2e/paths/07-order/03_lines.spec.js similarity index 100% rename from e2e/paths/07-order-module/03_lines.spec.js rename to e2e/paths/07-order/03_lines.spec.js diff --git a/e2e/paths/08-route-module/01_create.spec.js b/e2e/paths/08-route/01_create.spec.js similarity index 100% rename from e2e/paths/08-route-module/01_create.spec.js rename to e2e/paths/08-route/01_create.spec.js diff --git a/e2e/paths/08-route-module/02_basic_data.spec.js b/e2e/paths/08-route/02_basic_data.spec.js similarity index 99% rename from e2e/paths/08-route-module/02_basic_data.spec.js rename to e2e/paths/08-route/02_basic_data.spec.js index 7828b3827..91688b3ff 100644 --- a/e2e/paths/08-route-module/02_basic_data.spec.js +++ b/e2e/paths/08-route/02_basic_data.spec.js @@ -31,7 +31,7 @@ describe('Route basic Data path', () => { const result = await page.waitForLastSnackbar(); expect(result).toEqual('Data saved!'); - }, 15000); + }); it('should confirm the worker was edited', async() => { await page.reloadSection('route.card.basicData'); diff --git a/e2e/paths/08-route-module/03_tickets.spec.js b/e2e/paths/08-route/03_tickets.spec.js similarity index 100% rename from e2e/paths/08-route-module/03_tickets.spec.js rename to e2e/paths/08-route/03_tickets.spec.js diff --git a/e2e/paths/09-invoice-out-module/01_summary.spec.js b/e2e/paths/09-invoice-out/01_summary.spec.js similarity index 97% rename from e2e/paths/09-invoice-out-module/01_summary.spec.js rename to e2e/paths/09-invoice-out/01_summary.spec.js index c67fc547e..126c745d3 100644 --- a/e2e/paths/09-invoice-out-module/01_summary.spec.js +++ b/e2e/paths/09-invoice-out/01_summary.spec.js @@ -23,7 +23,6 @@ describe('InvoiceOut summary path', () => { }); it('should contain the company from which the invoice is emited', async() => { - await page.waitForContentLoaded(); const result = await page.waitToGetProperty(selectors.invoiceOutSummary.company, 'innerText'); expect(result).toEqual('Company VNL'); diff --git a/e2e/paths/09-invoice-out-module/02_descriptor.spec.js b/e2e/paths/09-invoice-out/02_descriptor.spec.js similarity index 98% rename from e2e/paths/09-invoice-out-module/02_descriptor.spec.js rename to e2e/paths/09-invoice-out/02_descriptor.spec.js index a51ae9d8f..e70c39ded 100644 --- a/e2e/paths/09-invoice-out-module/02_descriptor.spec.js +++ b/e2e/paths/09-invoice-out/02_descriptor.spec.js @@ -37,7 +37,6 @@ describe('InvoiceOut descriptor path', () => { }); it('should search for the target invoiceOut', async() => { - await page.waitForContentLoaded(); await page.write(selectors.invoiceOutIndex.topbarSearch, 'T2222222'); await page.waitToClick(selectors.invoiceOutIndex.searchButton); await page.waitForNumberOfElements(selectors.invoiceOutIndex.searchResult, 1); @@ -108,7 +107,6 @@ describe('InvoiceOut descriptor path', () => { }); it(`should search and access to the invoiceOut summary`, async() => { - await page.waitForContentLoaded(); await page.accessToSearchResult('T1111111'); let url = await page.expectURL('/summary'); diff --git a/e2e/paths/10-travel/01_thermograph.spec.js b/e2e/paths/10-travel/01_thermograph.spec.js new file mode 100644 index 000000000..efa2295a6 --- /dev/null +++ b/e2e/paths/10-travel/01_thermograph.spec.js @@ -0,0 +1,52 @@ +import selectors from '../../helpers/selectors.js'; +import getBrowser from '../../helpers/puppeteer'; + +describe('Travel thermograph path', () => { + let browser; + let page; + + beforeAll(async() => { + browser = await getBrowser(); + page = browser.page; + await page.loginAndModule('buyer', 'travel'); + await page.accessToSearchResult('3'); + await page.accessToSection('travel.card.thermograph.index'); + }); + + afterAll(async() => { + await browser.close(); + }); + + it('should reach the thermograph section', async() => { + const result = await page.expectURL('/thermograph/index'); + + expect(result).toBe(true); + }); + + it('should click the add thermograph floating button', async() => { + await page.waitToClick(selectors.travelThermograph.add); + const result = await page.expectURL('/thermograph/create'); + + expect(result).toBe(true); + }); + + it('should select the thermograph and then the file to upload', async() => { + let currentDir = process.cwd(); + let filePath = `${currentDir}/e2e/dms/ecc/3.jpeg`; + await page.autocompleteSearch(selectors.travelThermograph.thermographID, '138350-0'); + + const [fileChooser] = await Promise.all([ + page.waitForFileChooser(), + page.waitToClick(selectors.travelThermograph.uploadIcon) + ]); + await fileChooser.accept([filePath]); + + await page.waitToClick(selectors.travelThermograph.upload); + }); + + it('should reload the section and check everything was saved', async() => { + let createdThermograph = await page.waitToGetProperty(selectors.travelThermograph.createdThermograph, 'innerText'); + + expect(createdThermograph).toContain('138350-0'); + }); +}); diff --git a/gulpfile.js b/gulpfile.js index 853fcf2d4..eb421ba9b 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -174,12 +174,13 @@ function e2eSingleRun() { `${__dirname}/e2e/paths/07*/*[sS]pec.js`, `${__dirname}/e2e/paths/08*/*[sS]pec.js`, `${__dirname}/e2e/paths/09*/*[sS]pec.js`, + `${__dirname}/e2e/paths/10*/*[sS]pec.js`, `${__dirname}/e2e/paths/**/*[sS]pec.js` ]; return gulp.src(specFiles).pipe(jasmine({ errorOnFail: false, - timeout: 10000, + timeout: 30000, reporter: [ new SpecReporter({ spec: {