diff --git a/e2e/helpers/selectors.js b/e2e/helpers/selectors.js index a1e54abb5..e6eb3a177 100644 --- a/e2e/helpers/selectors.js +++ b/e2e/helpers/selectors.js @@ -306,6 +306,9 @@ export default { total: 'vn-ticket-summary vn-one.taxes > p:nth-child(3) > strong', sale: 'vn-ticket-summary [name="sales"] vn-table > div > vn-tbody > vn-tr', firstSaleItemId: 'vn-ticket-summary [name="sales"] vn-table > div > vn-tbody > vn-tr > vn-td:nth-child(2) > span', + firstSaleDescriptorImage: 'vn-ticket-summary vn-item-descriptor-popover > vn-popover vn-item-descriptor img', + itemDescriptorPopover: 'vn-ticket-summary vn-item-descriptor-popover > vn-popover', + itemDescriptorPopoverItemDiaryButton: 'vn-ticket-summary > vn-item-descriptor-popover a[href="#!/item/2/diary?warehouseFk=5&ticketFk=20"]', popoverDiaryButton: 'vn-ticket-summary vn-item-descriptor-popover vn-item-descriptor vn-icon[icon="icon-transaction"]', firstSaleQuantity: 'vn-ticket-summary [name="sales"] vn-table > div > vn-tbody > vn-tr > vn-td:nth-child(3)', firstSaleDiscount: 'vn-ticket-summary [name="sales"] vn-table > div > vn-tbody > vn-tr > vn-td:nth-child(6)', diff --git a/e2e/paths/05-ticket-module/16_summary.spec.js b/e2e/paths/05-ticket-module/16_summary.spec.js index c66b636ef..d532bc139 100644 --- a/e2e/paths/05-ticket-module/16_summary.spec.js +++ b/e2e/paths/05-ticket-module/16_summary.spec.js @@ -53,6 +53,22 @@ describe('Ticket Summary path', () => { expect(result).toContain('000002'); }); + it(`should click on the first sale ID making the item descriptor visible`, async() => { + const visible = await nightmare + .waitToClick(selectors.ticketSummary.firstSaleItemId) + .waitImgLoad(selectors.ticketSummary.firstSaleDescriptorImage) + .isVisible(selectors.ticketSummary.itemDescriptorPopover); + + expect(visible).toBeTruthy(); + }); + + it(`should check the url for the item diary link of the descriptor is for the right item id`, async() => { + const exists = await nightmare + .exists(selectors.ticketSummary.itemDescriptorPopoverItemDiaryButton); + + expect(exists).toBeTruthy(); + }); + it('should click on the SET OK button and throw a privileges error', async() => { let result = await nightmare .waitToClick(selectors.ticketSummary.setOk)