From a445632c29e11105c0392ebf99d4a45d77579765 Mon Sep 17 00:00:00 2001 From: carlosjr Date: Fri, 16 Apr 2021 16:16:05 +0200 Subject: [PATCH] removed waitForTimeouts with 1 to 3 seconds --- e2e/paths/02-client/03_edit_fiscal_data.spec.js | 1 - e2e/paths/02-client/05_add_address.spec.js | 1 - e2e/paths/02-client/15_user_config.spec.js | 1 - e2e/paths/02-client/18_contacts.spec.js | 1 - e2e/paths/02-client/20_credit_insurance.spec.js | 1 - e2e/paths/04-item/02_basic_data.spec.js | 3 +-- e2e/paths/04-item/10_index.spec.js | 1 - e2e/paths/04-item/14_fixedPrice.spec.js | 1 - e2e/paths/05-ticket/01-sale/02_edit_sale.spec.js | 5 ----- e2e/paths/05-ticket/05_tracking_state.spec.js | 1 - e2e/paths/05-ticket/06_basic_data_steps.spec.js | 1 - e2e/paths/05-ticket/10_request.spec.js | 1 - e2e/paths/05-ticket/14_create_ticket.spec.js | 1 - e2e/paths/06-claim/04_claim_action.spec.js | 4 ---- e2e/paths/07-order/01_summary.spec.js | 1 - e2e/paths/08-route/03_create_and_clone.spec.js | 2 -- e2e/paths/10-travel/02_basic_data_and_log.spec.js | 1 - e2e/paths/10-travel/04_extra_community.spec.js | 1 - e2e/paths/12-entry/03_latestBuys.spec.js | 1 - 19 files changed, 1 insertion(+), 28 deletions(-) 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 614ede0f0..d57cd968e 100644 --- a/e2e/paths/02-client/03_edit_fiscal_data.spec.js +++ b/e2e/paths/02-client/03_edit_fiscal_data.spec.js @@ -159,7 +159,6 @@ describe('Client Edit fiscalData path', () => { }); it('should propagate the Equalization tax changes', async() => { - await page.waitForTimeout(1000); await page.waitToClick(selectors.globalItems.acceptButton); const message = await page.waitForSnackbar(); diff --git a/e2e/paths/02-client/05_add_address.spec.js b/e2e/paths/02-client/05_add_address.spec.js index 90cbc15a5..c35237ab4 100644 --- a/e2e/paths/02-client/05_add_address.spec.js +++ b/e2e/paths/02-client/05_add_address.spec.js @@ -81,7 +81,6 @@ describe('Client Add address path', () => { }); it(`should confirm the new address exists and it's the default one`, async() => { - await page.waitForTimeout(2000); // needs more than a single second to load the section const result = await page.waitToGetProperty(selectors.clientAddresses.defaultAddress, 'innerText'); expect(result).toContain('320 Park Avenue New York'); diff --git a/e2e/paths/02-client/15_user_config.spec.js b/e2e/paths/02-client/15_user_config.spec.js index 2954ff522..615df4e0c 100644 --- a/e2e/paths/02-client/15_user_config.spec.js +++ b/e2e/paths/02-client/15_user_config.spec.js @@ -52,7 +52,6 @@ describe('User config', () => { it('should open the user config form to check the settings', async() => { await page.waitToClick(selectors.globalItems.userMenuButton); - await page.waitForTimeout(1000); let expectedLocalWarehouse = await page .expectPropertyValue(selectors.globalItems.userLocalWarehouse, 'value', ''); diff --git a/e2e/paths/02-client/18_contacts.spec.js b/e2e/paths/02-client/18_contacts.spec.js index 49d930435..b1159993d 100644 --- a/e2e/paths/02-client/18_contacts.spec.js +++ b/e2e/paths/02-client/18_contacts.spec.js @@ -28,7 +28,6 @@ describe('Client contacts', () => { }); it('should delete de contact', async() => { - await page.waitForTimeout(3000); await page.waitToClick(selectors.clientContacts.deleteFirstPhone); await page.waitToClick(selectors.clientContacts.saveButton); const message = await page.waitForSnackbar(); diff --git a/e2e/paths/02-client/20_credit_insurance.spec.js b/e2e/paths/02-client/20_credit_insurance.spec.js index 58cb2737c..904a51145 100644 --- a/e2e/paths/02-client/20_credit_insurance.spec.js +++ b/e2e/paths/02-client/20_credit_insurance.spec.js @@ -20,7 +20,6 @@ describe('Client credit insurance path', () => { }); it('should open the create a new credit contract form', async() => { - await page.waitForTimeout(1000); await page.waitToClick(selectors.clientCreditInsurance.addNewContract); await page.waitForState('client.card.creditInsurance.create'); }); diff --git a/e2e/paths/04-item/02_basic_data.spec.js b/e2e/paths/04-item/02_basic_data.spec.js index a728ac717..defefe279 100644 --- a/e2e/paths/04-item/02_basic_data.spec.js +++ b/e2e/paths/04-item/02_basic_data.spec.js @@ -45,8 +45,7 @@ describe('Item Edit basic data path', () => { await page.waitToClick(selectors.itemBasicData.newIntrastatButton); await page.write(selectors.itemBasicData.newIntrastatId, '588420239'); await page.write(selectors.itemBasicData.newIntrastatDescription, 'Tropical Flowers'); - await page.waitToClick(selectors.itemBasicData.acceptIntrastatButton); // this popover obscures the rest of the form for aprox 2 seconds - await page.waitForTimeout(2000); + await page.waitToClick(selectors.itemBasicData.acceptIntrastatButton); await page.waitForTextInField(selectors.itemBasicData.intrastat, 'Tropical Flowers'); let newcode = await page.waitToGetProperty(selectors.itemBasicData.intrastat, 'value'); diff --git a/e2e/paths/04-item/10_index.spec.js b/e2e/paths/04-item/10_index.spec.js index 40c567cac..3d7ab1632 100644 --- a/e2e/paths/04-item/10_index.spec.js +++ b/e2e/paths/04-item/10_index.spec.js @@ -55,7 +55,6 @@ describe('Item index path', () => { }); it('should mark all unchecked boxes to leave the index as it was', async() => { - await page.waitForTimeout(500); // otherwise the snackbar doesnt appear some times. await page.waitToClick(selectors.itemsIndex.fieldsToShowButton); await page.waitToClick(selectors.itemsIndex.idCheckbox); await page.waitToClick(selectors.itemsIndex.stemsCheckbox); diff --git a/e2e/paths/04-item/14_fixedPrice.spec.js b/e2e/paths/04-item/14_fixedPrice.spec.js index 477daa151..d68092904 100644 --- a/e2e/paths/04-item/14_fixedPrice.spec.js +++ b/e2e/paths/04-item/14_fixedPrice.spec.js @@ -45,7 +45,6 @@ describe('Item fixed prices path', () => { await page.writeOnEditableTD(selectors.itemFixedPrice.fourthMinPrice, '5'); await page.pickDate(selectors.itemFixedPrice.fourthStarted, now); await page.pickDate(selectors.itemFixedPrice.fourthEnded, now); - await page.waitForTimeout(1000); const message = await page.waitForSnackbar(); expect(message.text).toContain('Data saved!'); 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 713ccf7cd..6c82e31a7 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 @@ -143,7 +143,6 @@ describe('Ticket Edit sale path', () => { }); it('should remove 1 from the first sale quantity', async() => { - await page.waitForTimeout(500); await page.waitToClick(selectors.ticketSales.firstSaleQuantityCell); await page.waitForSelector(selectors.ticketSales.firstSaleQuantity); await page.type(selectors.ticketSales.firstSaleQuantity, '9\u000d'); @@ -225,16 +224,12 @@ describe('Ticket Edit sale path', () => { it('should search for a ticket then access to the sales section', async() => { await page.accessToSearchResult('16'); await page.accessToSection('ticket.card.sale'); - await page.waitForTimeout(2000); }); it('should select the third sale and delete it', async() => { await page.waitToClick(selectors.ticketSales.thirdSaleCheckbox); - await page.waitForTimeout(2000); await page.waitToClick(selectors.ticketSales.deleteSaleButton); - await page.waitForTimeout(2000); await page.waitToClick(selectors.globalItems.acceptButton); - await page.waitForTimeout(2000); await page.waitForSpinnerLoad(); const message = await page.waitForSnackbar(); diff --git a/e2e/paths/05-ticket/05_tracking_state.spec.js b/e2e/paths/05-ticket/05_tracking_state.spec.js index 07f0d86bc..7978cf85c 100644 --- a/e2e/paths/05-ticket/05_tracking_state.spec.js +++ b/e2e/paths/05-ticket/05_tracking_state.spec.js @@ -47,7 +47,6 @@ describe('Ticket Create new tracking state path', () => { }); it(`should attemp to create an state for which salesPerson doesn't have permissions`, async() => { - await page.waitForTimeout(1500); await page.autocompleteSearch(selectors.createStateView.state, 'Encajado'); await page.waitToClick(selectors.createStateView.saveStateButton); const message = await page.waitForSnackbar(); diff --git a/e2e/paths/05-ticket/06_basic_data_steps.spec.js b/e2e/paths/05-ticket/06_basic_data_steps.spec.js index fff6c1264..f7834e562 100644 --- a/e2e/paths/05-ticket/06_basic_data_steps.spec.js +++ b/e2e/paths/05-ticket/06_basic_data_steps.spec.js @@ -51,7 +51,6 @@ describe('Ticket Edit basic data path', () => { it(`should edit the ticket agency then check there are no zones for it`, async() => { await page.autocompleteSearch(selectors.ticketBasicData.agency, 'Super-Man delivery'); - await page.waitForTimeout(1000); let emptyZone = await page .expectPropertyValue(selectors.ticketBasicData.zone, 'value', ''); diff --git a/e2e/paths/05-ticket/10_request.spec.js b/e2e/paths/05-ticket/10_request.spec.js index af73d7081..1b580aec2 100644 --- a/e2e/paths/05-ticket/10_request.spec.js +++ b/e2e/paths/05-ticket/10_request.spec.js @@ -18,7 +18,6 @@ describe('Ticket purchase request path', () => { }); it('should add a new request', async() => { - await page.waitForTimeout(500); await page.waitToClick(selectors.ticketRequests.addRequestButton); await page.write(selectors.ticketRequests.descriptionInput, 'New stuff'); await page.write(selectors.ticketRequests.quantity, '9'); diff --git a/e2e/paths/05-ticket/14_create_ticket.spec.js b/e2e/paths/05-ticket/14_create_ticket.spec.js index 4e7d95493..bfaa08775 100644 --- a/e2e/paths/05-ticket/14_create_ticket.spec.js +++ b/e2e/paths/05-ticket/14_create_ticket.spec.js @@ -42,7 +42,6 @@ describe('Ticket create path', () => { it('should again open the new ticket form', async() => { await page.waitToClick(selectors.globalItems.returnToModuleIndexButton); - await page.waitForTimeout(500); await page.waitToClick(selectors.ticketsIndex.newTicketButton); await page.waitForState('ticket.create'); }); diff --git a/e2e/paths/06-claim/04_claim_action.spec.js b/e2e/paths/06-claim/04_claim_action.spec.js index b3fedc9c8..1170e0c9c 100644 --- a/e2e/paths/06-claim/04_claim_action.spec.js +++ b/e2e/paths/06-claim/04_claim_action.spec.js @@ -25,10 +25,6 @@ describe('Claim action path', () => { }); it('should import the second importable ticket', async() => { - // the animation adding the header element for the claimed total - // obscures somehow other elements for about 2 seconds - await page.waitForTimeout(3000); - await page.waitToClick(selectors.claimAction.importTicketButton); await page.waitToClick(selectors.claimAction.secondImportableTicket); const message = await page.waitForSnackbar(); diff --git a/e2e/paths/07-order/01_summary.spec.js b/e2e/paths/07-order/01_summary.spec.js index 1b4776826..9b9e37998 100644 --- a/e2e/paths/07-order/01_summary.spec.js +++ b/e2e/paths/07-order/01_summary.spec.js @@ -8,7 +8,6 @@ describe('Order summary path', () => { browser = await getBrowser(); page = browser.page; await page.loginAndModule('employee', 'order'); - await page.waitForTimeout(2000); await page.accessToSearchResult('16'); }); diff --git a/e2e/paths/08-route/03_create_and_clone.spec.js b/e2e/paths/08-route/03_create_and_clone.spec.js index c0132362f..0b8da98b4 100644 --- a/e2e/paths/08-route/03_create_and_clone.spec.js +++ b/e2e/paths/08-route/03_create_and_clone.spec.js @@ -17,7 +17,6 @@ describe('Route create path', () => { describe('as employee', () => { it('should click on the add new route button and open the creation form', async() => { - await page.waitForTimeout(500); await page.waitToClick(selectors.routeIndex.addNewRouteButton); await page.waitForState('route.create'); }); @@ -74,7 +73,6 @@ describe('Route create path', () => { }); it(`should clone the first route`, async() => { - await page.waitForTimeout(1000); // needs time for the index to show all items await page.waitToClick(selectors.routeIndex.firstRouteCheckbox); await page.waitToClick(selectors.routeIndex.cloneButton); await page.waitToClick(selectors.routeIndex.submitClonationButton); diff --git a/e2e/paths/10-travel/02_basic_data_and_log.spec.js b/e2e/paths/10-travel/02_basic_data_and_log.spec.js index 50e2e1980..a231a70b2 100644 --- a/e2e/paths/10-travel/02_basic_data_and_log.spec.js +++ b/e2e/paths/10-travel/02_basic_data_and_log.spec.js @@ -44,7 +44,6 @@ describe('Travel basic data path', () => { it('should now edit the whole form then save', async() => { await page.clearInput(selectors.travelBasicData.reference); await page.write(selectors.travelBasicData.reference, 'new reference!'); - await page.waitForTimeout(2000); await page.autocompleteSearch(selectors.travelBasicData.agency, 'Entanglement'); await page.autocompleteSearch(selectors.travelBasicData.outputWarehouse, 'Warehouse Three'); await page.autocompleteSearch(selectors.travelBasicData.inputWarehouse, 'Warehouse Four'); diff --git a/e2e/paths/10-travel/04_extra_community.spec.js b/e2e/paths/10-travel/04_extra_community.spec.js index af577d2f9..e4a859192 100644 --- a/e2e/paths/10-travel/04_extra_community.spec.js +++ b/e2e/paths/10-travel/04_extra_community.spec.js @@ -22,7 +22,6 @@ describe('Travel extra community path', () => { await page.writeOnEditableTD(selectors.travelExtraCommunity.firstTravelReference, 'edited reference'); await page.waitForSpinnerLoad(); await page.writeOnEditableTD(selectors.travelExtraCommunity.firstTravelLockedKg, '1500'); - await page.waitForTimeout(1000); }); it('should reload the index and confirm the reference and locked kg were edited', async() => { diff --git a/e2e/paths/12-entry/03_latestBuys.spec.js b/e2e/paths/12-entry/03_latestBuys.spec.js index f2d64e3b4..4b1050abc 100644 --- a/e2e/paths/12-entry/03_latestBuys.spec.js +++ b/e2e/paths/12-entry/03_latestBuys.spec.js @@ -17,7 +17,6 @@ describe('Entry lastest buys path', () => { it('should access the latest buys seccion and search not seeing the edit buys button yet', async() => { await page.waitToClick(selectors.entryLatestBuys.latestBuysSectionButton); - await page.waitForTimeout(250); await page.waitToClick(selectors.globalItems.searchButton); await page.waitForSelector(selectors.entryLatestBuys.editBuysButton, {visible: false}); });