removed waitForTimeouts with 1 to 3 seconds #608

Merged
joan merged 2 commits from 2865-e2e_run_optimization into dev 2021-04-19 08:36:35 +00:00
19 changed files with 1 additions and 28 deletions

View File

@ -159,7 +159,6 @@ describe('Client Edit fiscalData path', () => {
}); });
it('should propagate the Equalization tax changes', async() => { it('should propagate the Equalization tax changes', async() => {
await page.waitForTimeout(1000);
await page.waitToClick(selectors.globalItems.acceptButton); await page.waitToClick(selectors.globalItems.acceptButton);
const message = await page.waitForSnackbar(); const message = await page.waitForSnackbar();

View File

@ -81,7 +81,6 @@ describe('Client Add address path', () => {
}); });
it(`should confirm the new address exists and it's the default one`, async() => { 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'); const result = await page.waitToGetProperty(selectors.clientAddresses.defaultAddress, 'innerText');
expect(result).toContain('320 Park Avenue New York'); expect(result).toContain('320 Park Avenue New York');

View File

@ -52,7 +52,6 @@ describe('User config', () => {
it('should open the user config form to check the settings', async() => { it('should open the user config form to check the settings', async() => {
await page.waitToClick(selectors.globalItems.userMenuButton); await page.waitToClick(selectors.globalItems.userMenuButton);
await page.waitForTimeout(1000);
let expectedLocalWarehouse = await page let expectedLocalWarehouse = await page
.expectPropertyValue(selectors.globalItems.userLocalWarehouse, 'value', ''); .expectPropertyValue(selectors.globalItems.userLocalWarehouse, 'value', '');

View File

@ -28,7 +28,6 @@ describe('Client contacts', () => {
}); });
it('should delete de contact', async() => { it('should delete de contact', async() => {
await page.waitForTimeout(3000);
await page.waitToClick(selectors.clientContacts.deleteFirstPhone); await page.waitToClick(selectors.clientContacts.deleteFirstPhone);
await page.waitToClick(selectors.clientContacts.saveButton); await page.waitToClick(selectors.clientContacts.saveButton);
const message = await page.waitForSnackbar(); const message = await page.waitForSnackbar();

View File

@ -20,7 +20,6 @@ describe('Client credit insurance path', () => {
}); });
it('should open the create a new credit contract form', async() => { it('should open the create a new credit contract form', async() => {
await page.waitForTimeout(1000);
await page.waitToClick(selectors.clientCreditInsurance.addNewContract); await page.waitToClick(selectors.clientCreditInsurance.addNewContract);
await page.waitForState('client.card.creditInsurance.create'); await page.waitForState('client.card.creditInsurance.create');
}); });

View File

@ -45,8 +45,7 @@ describe('Item Edit basic data path', () => {
await page.waitToClick(selectors.itemBasicData.newIntrastatButton); await page.waitToClick(selectors.itemBasicData.newIntrastatButton);
await page.write(selectors.itemBasicData.newIntrastatId, '588420239'); await page.write(selectors.itemBasicData.newIntrastatId, '588420239');
await page.write(selectors.itemBasicData.newIntrastatDescription, 'Tropical Flowers'); 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.waitToClick(selectors.itemBasicData.acceptIntrastatButton);
await page.waitForTimeout(2000);
await page.waitForTextInField(selectors.itemBasicData.intrastat, 'Tropical Flowers'); await page.waitForTextInField(selectors.itemBasicData.intrastat, 'Tropical Flowers');
let newcode = await page.waitToGetProperty(selectors.itemBasicData.intrastat, 'value'); let newcode = await page.waitToGetProperty(selectors.itemBasicData.intrastat, 'value');

View File

@ -55,7 +55,6 @@ describe('Item index path', () => {
}); });
it('should mark all unchecked boxes to leave the index as it was', async() => { 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.fieldsToShowButton);
await page.waitToClick(selectors.itemsIndex.idCheckbox); await page.waitToClick(selectors.itemsIndex.idCheckbox);
await page.waitToClick(selectors.itemsIndex.stemsCheckbox); await page.waitToClick(selectors.itemsIndex.stemsCheckbox);

View File

@ -45,7 +45,6 @@ describe('Item fixed prices path', () => {
await page.writeOnEditableTD(selectors.itemFixedPrice.fourthMinPrice, '5'); await page.writeOnEditableTD(selectors.itemFixedPrice.fourthMinPrice, '5');
await page.pickDate(selectors.itemFixedPrice.fourthStarted, now); await page.pickDate(selectors.itemFixedPrice.fourthStarted, now);
await page.pickDate(selectors.itemFixedPrice.fourthEnded, now); await page.pickDate(selectors.itemFixedPrice.fourthEnded, now);
await page.waitForTimeout(1000);
const message = await page.waitForSnackbar(); const message = await page.waitForSnackbar();
expect(message.text).toContain('Data saved!'); expect(message.text).toContain('Data saved!');

View File

@ -143,7 +143,6 @@ describe('Ticket Edit sale path', () => {
}); });
it('should remove 1 from the first sale quantity', async() => { it('should remove 1 from the first sale quantity', async() => {
await page.waitForTimeout(500);
await page.waitToClick(selectors.ticketSales.firstSaleQuantityCell); await page.waitToClick(selectors.ticketSales.firstSaleQuantityCell);
await page.waitForSelector(selectors.ticketSales.firstSaleQuantity); await page.waitForSelector(selectors.ticketSales.firstSaleQuantity);
await page.type(selectors.ticketSales.firstSaleQuantity, '9\u000d'); 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() => { it('should search for a ticket then access to the sales section', async() => {
await page.accessToSearchResult('16'); await page.accessToSearchResult('16');
await page.accessToSection('ticket.card.sale'); await page.accessToSection('ticket.card.sale');
await page.waitForTimeout(2000);
}); });
it('should select the third sale and delete it', async() => { it('should select the third sale and delete it', async() => {
await page.waitToClick(selectors.ticketSales.thirdSaleCheckbox); await page.waitToClick(selectors.ticketSales.thirdSaleCheckbox);
await page.waitForTimeout(2000);
await page.waitToClick(selectors.ticketSales.deleteSaleButton); await page.waitToClick(selectors.ticketSales.deleteSaleButton);
await page.waitForTimeout(2000);
await page.waitToClick(selectors.globalItems.acceptButton); await page.waitToClick(selectors.globalItems.acceptButton);
await page.waitForTimeout(2000);
await page.waitForSpinnerLoad(); await page.waitForSpinnerLoad();
const message = await page.waitForSnackbar(); const message = await page.waitForSnackbar();

View File

@ -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() => { 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.autocompleteSearch(selectors.createStateView.state, 'Encajado');
await page.waitToClick(selectors.createStateView.saveStateButton); await page.waitToClick(selectors.createStateView.saveStateButton);
const message = await page.waitForSnackbar(); const message = await page.waitForSnackbar();

View File

@ -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() => { 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.autocompleteSearch(selectors.ticketBasicData.agency, 'Super-Man delivery');
await page.waitForTimeout(1000);
let emptyZone = await page let emptyZone = await page
.expectPropertyValue(selectors.ticketBasicData.zone, 'value', ''); .expectPropertyValue(selectors.ticketBasicData.zone, 'value', '');

View File

@ -18,7 +18,6 @@ describe('Ticket purchase request path', () => {
}); });
it('should add a new request', async() => { it('should add a new request', async() => {
await page.waitForTimeout(500);
await page.waitToClick(selectors.ticketRequests.addRequestButton); await page.waitToClick(selectors.ticketRequests.addRequestButton);
await page.write(selectors.ticketRequests.descriptionInput, 'New stuff'); await page.write(selectors.ticketRequests.descriptionInput, 'New stuff');
await page.write(selectors.ticketRequests.quantity, '9'); await page.write(selectors.ticketRequests.quantity, '9');

View File

@ -42,7 +42,6 @@ describe('Ticket create path', () => {
it('should again open the new ticket form', async() => { it('should again open the new ticket form', async() => {
await page.waitToClick(selectors.globalItems.returnToModuleIndexButton); await page.waitToClick(selectors.globalItems.returnToModuleIndexButton);
await page.waitForTimeout(500);
await page.waitToClick(selectors.ticketsIndex.newTicketButton); await page.waitToClick(selectors.ticketsIndex.newTicketButton);
await page.waitForState('ticket.create'); await page.waitForState('ticket.create');
}); });

View File

@ -25,10 +25,6 @@ describe('Claim action path', () => {
}); });
it('should import the second importable ticket', async() => { 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.importTicketButton);
await page.waitToClick(selectors.claimAction.secondImportableTicket); await page.waitToClick(selectors.claimAction.secondImportableTicket);
const message = await page.waitForSnackbar(); const message = await page.waitForSnackbar();

View File

@ -8,7 +8,6 @@ describe('Order summary path', () => {
browser = await getBrowser(); browser = await getBrowser();
page = browser.page; page = browser.page;
await page.loginAndModule('employee', 'order'); await page.loginAndModule('employee', 'order');
await page.waitForTimeout(2000);
await page.accessToSearchResult('16'); await page.accessToSearchResult('16');
}); });

View File

@ -17,7 +17,6 @@ describe('Route create path', () => {
describe('as employee', () => { describe('as employee', () => {
it('should click on the add new route button and open the creation form', async() => { 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.waitToClick(selectors.routeIndex.addNewRouteButton);
await page.waitForState('route.create'); await page.waitForState('route.create');
}); });
@ -74,7 +73,6 @@ describe('Route create path', () => {
}); });
it(`should clone the first route`, async() => { 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.firstRouteCheckbox);
await page.waitToClick(selectors.routeIndex.cloneButton); await page.waitToClick(selectors.routeIndex.cloneButton);
await page.waitToClick(selectors.routeIndex.submitClonationButton); await page.waitToClick(selectors.routeIndex.submitClonationButton);

View File

@ -44,7 +44,6 @@ describe('Travel basic data path', () => {
it('should now edit the whole form then save', async() => { it('should now edit the whole form then save', async() => {
await page.clearInput(selectors.travelBasicData.reference); await page.clearInput(selectors.travelBasicData.reference);
await page.write(selectors.travelBasicData.reference, 'new 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.agency, 'Entanglement');
await page.autocompleteSearch(selectors.travelBasicData.outputWarehouse, 'Warehouse Three'); await page.autocompleteSearch(selectors.travelBasicData.outputWarehouse, 'Warehouse Three');
await page.autocompleteSearch(selectors.travelBasicData.inputWarehouse, 'Warehouse Four'); await page.autocompleteSearch(selectors.travelBasicData.inputWarehouse, 'Warehouse Four');

View File

@ -22,7 +22,6 @@ describe('Travel extra community path', () => {
await page.writeOnEditableTD(selectors.travelExtraCommunity.firstTravelReference, 'edited reference'); await page.writeOnEditableTD(selectors.travelExtraCommunity.firstTravelReference, 'edited reference');
await page.waitForSpinnerLoad(); await page.waitForSpinnerLoad();
await page.writeOnEditableTD(selectors.travelExtraCommunity.firstTravelLockedKg, '1500'); 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() => { it('should reload the index and confirm the reference and locked kg were edited', async() => {

View File

@ -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() => { 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.waitToClick(selectors.entryLatestBuys.latestBuysSectionButton);
await page.waitForTimeout(250);
await page.waitToClick(selectors.globalItems.searchButton); await page.waitToClick(selectors.globalItems.searchButton);
await page.waitForSelector(selectors.entryLatestBuys.editBuysButton, {visible: false}); await page.waitForSelector(selectors.entryLatestBuys.editBuysButton, {visible: false});
}); });