diff --git a/e2e/paths/05-ticket/21_future.spec.js b/e2e/paths/05-ticket/21_future.spec.js index 1a101e9f1..c854dcbaf 100644 --- a/e2e/paths/05-ticket/21_future.spec.js +++ b/e2e/paths/05-ticket/21_future.spec.js @@ -21,7 +21,7 @@ describe('Ticket Future path', () => { await browser.close(); }); - it('should show errors snackbar because of the required data', async() => { + it('should search with required data, check three last tickets and move to the future', async() => { await page.waitToClick(selectors.ticketFuture.openAdvancedSearchButton); await page.clearInput(selectors.ticketFuture.warehouseFk); await page.waitToClick(selectors.ticketFuture.submit); @@ -42,25 +42,19 @@ describe('Ticket Future path', () => { message = await page.waitForSnackbar(); expect(message.text).toContain('originDated is a required argument'); - }); - it('should search with the required data', async() => { await page.waitToClick(selectors.ticketFuture.openAdvancedSearchButton); await page.waitToClick(selectors.ticketFuture.submit); expect(httpRequest).toBeDefined(); - }); - it('should search with the origin IPT', async() => { await page.waitToClick(selectors.ticketFuture.openAdvancedSearchButton); await page.autocompleteSearch(selectors.ticketFuture.ipt, 'H'); await page.waitToClick(selectors.ticketFuture.submit); expect(httpRequest).toContain('ipt=H'); - }); - it('should search with the destination IPT', async() => { await page.waitToClick(selectors.ticketFuture.openAdvancedSearchButton); await page.clearInput(selectors.ticketFuture.ipt); @@ -69,9 +63,7 @@ describe('Ticket Future path', () => { await page.waitToClick(selectors.ticketFuture.submit); expect(httpRequest).toContain('futureIpt=H'); - }); - it('should search with the origin grouped state', async() => { await page.waitToClick(selectors.ticketFuture.openAdvancedSearchButton); await page.clearInput(selectors.ticketFuture.futureIpt); @@ -80,9 +72,7 @@ describe('Ticket Future path', () => { await page.waitToClick(selectors.ticketFuture.submit); expect(httpRequest).toContain('state=FREE'); - }); - it('should search with the destination grouped state', async() => { await page.waitToClick(selectors.ticketFuture.openAdvancedSearchButton); await page.clearInput(selectors.ticketFuture.state); @@ -93,17 +83,16 @@ describe('Ticket Future path', () => { expect(httpRequest).toContain('futureState=FREE'); await page.waitToClick(selectors.ticketFuture.openAdvancedSearchButton); + await page.clearInput(selectors.ticketFuture.state); await page.clearInput(selectors.ticketFuture.futureState); await page.waitToClick(selectors.ticketFuture.submit); - }); - it('should check the three last tickets and move to the future', async() => { await page.waitForNumberOfElements(selectors.ticketFuture.searchResult, 4); await page.waitToClick(selectors.ticketFuture.multiCheck); await page.waitToClick(selectors.ticketFuture.firstCheck); await page.waitToClick(selectors.ticketFuture.moveButton); await page.waitToClick(selectors.globalItems.acceptButton); - const message = await page.waitForSnackbar(); + message = await page.waitForSnackbar(); expect(message.text).toContain('Tickets moved successfully!'); }); diff --git a/e2e/paths/05-ticket/22_advance.spec.js b/e2e/paths/05-ticket/22_advance.spec.js index d845219c5..0e5b5e0c3 100644 --- a/e2e/paths/05-ticket/22_advance.spec.js +++ b/e2e/paths/05-ticket/22_advance.spec.js @@ -21,7 +21,7 @@ describe('Ticket Advance path', () => { await browser.close(); }); - it('should show errors snackbar because of the required data', async() => { + it('should search with the required data, check the first ticket and move to the present', async() => { await page.waitToClick(selectors.ticketAdvance.openAdvancedSearchButton); await page.clearInput(selectors.ticketAdvance.warehouseFk); @@ -43,16 +43,12 @@ describe('Ticket Advance path', () => { message = await page.waitForSnackbar(); expect(message.text).toContain('dateFuture is a required argument'); - }); - it('should search with the required data', async() => { await page.waitToClick(selectors.ticketAdvance.openAdvancedSearchButton); await page.waitToClick(selectors.ticketAdvance.submit); expect(httpRequest).toBeDefined(); - }); - it('should search with the origin IPT', async() => { await page.waitToClick(selectors.ticketAdvance.openAdvancedSearchButton); await page.autocompleteSearch(selectors.ticketAdvance.futureIpt, 'H'); await page.waitToClick(selectors.ticketAdvance.submit); @@ -62,9 +58,7 @@ describe('Ticket Advance path', () => { await page.waitToClick(selectors.ticketAdvance.openAdvancedSearchButton); await page.clearInput(selectors.ticketAdvance.futureIpt); await page.waitToClick(selectors.ticketAdvance.submit); - }); - it('should search with the destination IPT', async() => { await page.waitToClick(selectors.ticketAdvance.openAdvancedSearchButton); await page.autocompleteSearch(selectors.ticketAdvance.ipt, 'H'); await page.waitToClick(selectors.ticketAdvance.submit); @@ -74,13 +68,11 @@ describe('Ticket Advance path', () => { await page.waitToClick(selectors.ticketAdvance.openAdvancedSearchButton); await page.clearInput(selectors.ticketAdvance.ipt); await page.waitToClick(selectors.ticketAdvance.submit); - }); - it('should check the first ticket and move to the present', async() => { await page.waitToClick(selectors.ticketAdvance.firstCheck); await page.waitToClick(selectors.ticketAdvance.moveButton); await page.waitToClick(selectors.ticketAdvance.acceptButton); - const message = await page.waitForSnackbar(); + message = await page.waitForSnackbar(); expect(message.text).toContain('Tickets moved successfully!'); });