diff --git a/e2e/helpers/selectors.js b/e2e/helpers/selectors.js index 27cfde167..3b947c81a 100644 --- a/e2e/helpers/selectors.js +++ b/e2e/helpers/selectors.js @@ -350,6 +350,7 @@ export default { saleDescriptorPopoverSummaryButton: 'vn-item-descriptor-popover a[href="#!/item/1/summary"]', saleButton: `vn-left-menu a[ui-sref="ticket.card.sale"]`, descriptorItemDiaryButton: `vn-item-descriptor > vn-card > div > vn-horizontal.quicklinks.ng-scope > vn-horizontal > a > vn-icon > i`, + newItemButton: 'vn-float-button[icon="add"]', firstSaleText: `vn-table div > vn-tbody > vn-tr:nth-child(1)`, firstSaleThumbnailImage: 'vn-ticket-sale:nth-child(1) vn-td:nth-child(3) > img', firstSaleZoomedImage: 'body > div > div > img', @@ -459,4 +460,7 @@ export default { detailsButton: `vn-left-menu a[ui-sref="claim.card.detail"]`, addItemButton: `vn-claim-detail a vn-float-button` }, + orderCatalog: { + catalogButton: `vn-left-menu a[ui-sref="order.card.catalog"]` + }, }; diff --git a/e2e/paths/ticket-module/03_list_sale.spec.js b/e2e/paths/ticket-module/03_list_sale.spec.js index 2fae92db6..00579a4c9 100644 --- a/e2e/paths/ticket-module/03_list_sale.spec.js +++ b/e2e/paths/ticket-module/03_list_sale.spec.js @@ -20,10 +20,10 @@ describe('Ticket List sale path', () => { expect(url.hash).toEqual('#!/ticket/index'); }); - it('should search for the ticket 1', async () => { + it('should search for the ticket 8', async () => { const result = await nightmare .wait(selectors.ticketsIndex.searchResult) - .type(selectors.ticketsIndex.searchTicketInput, 'id:1') + .type(selectors.ticketsIndex.searchTicketInput, 'id:8') .click(selectors.ticketsIndex.searchButton) .waitForNumberOfElements(selectors.ticketsIndex.searchResult, 1) .countElement(selectors.ticketsIndex.searchResult); @@ -33,13 +33,13 @@ describe('Ticket List sale path', () => { it(`should click on the search result to access to the ticket's sale`, async () => { const url = await nightmare - .waitForTextInElement(selectors.ticketsIndex.searchResult, 'address 21') + .waitForTextInElement(selectors.ticketsIndex.searchResult, 'address 24') .waitToClick(selectors.ticketsIndex.searchResult) .waitToClick(selectors.ticketSales.saleButton) - .waitForURL('sale') + .waitForURL('/sale') .url(); - expect(url).toContain('sale'); + expect(url).toContain('/sale'); }); it('should confirm the first ticket sale contains the colour', async () => { @@ -47,7 +47,7 @@ describe('Ticket List sale path', () => { .wait(selectors.ticketSales.firstSaleText) .getInnerText(selectors.ticketSales.firstSaleColour); - expect(value).toContain('Yellow'); + expect(value).toContain('Red'); }); it('should confirm the first ticket sale contains the lenght', async () => { @@ -55,7 +55,7 @@ describe('Ticket List sale path', () => { .wait(selectors.ticketSales.firstSaleText) .getInnerText(selectors.ticketSales.firstSaleText); - expect(value).toContain('5'); + expect(value).toContain('3'); }); it('should confirm the first ticket sale contains the price', async () => { @@ -63,7 +63,7 @@ describe('Ticket List sale path', () => { .wait(selectors.ticketSales.firstSaleText) .getInnerText(selectors.ticketSales.firstSalePrice); - expect(value).toContain('9.10'); + expect(value).toContain('1.30'); }); it('should confirm the first ticket sale contains the discount', async () => { @@ -79,38 +79,15 @@ describe('Ticket List sale path', () => { .wait(selectors.ticketSales.firstSaleText) .getInnerText(selectors.ticketSales.firstSaleImport); - expect(value).toContain('45.50'); + expect(value).toContain('19.50'); }); - it('should confirm the second ticket sale contains the colour', async () => { - const value = await nightmare - .wait(selectors.ticketSales.secondSaleText) - .getInnerText(selectors.ticketSales.secondSaleColour); + it('should navigate to the catalog by pressing the new item button', async () => { + const url = await nightmare + .waitToClick(selectors.ticketSales.newItemButton) + .waitForURL('/catalog') + .url(); - expect(value).toContain('Red'); - }); - - it('should confirm the second ticket sale contains the price', async () => { - const value = await nightmare - .wait(selectors.ticketSales.secondSaleText) - .getInnerText(selectors.ticketSales.secondSalePrice); - - expect(value).toContain('1.07'); - }); - - it('should confirm the second ticket sale contains the discount', async () => { - const value = await nightmare - .wait(selectors.ticketSales.secondSaleText) - .getInnerText(selectors.ticketSales.secondSaleDiscount); - - expect(value).toContain('0 %'); - }); - - it('should confirm the second ticket sale contains the total import', async () => { - const value = await nightmare - .wait(selectors.ticketSales.secondSaleText) - .getInnerText(selectors.ticketSales.secondSaleImport); - - expect(value).toContain('10.70'); + expect(url).toContain('/catalog'); }); });