diff --git a/e2e/helpers/selectors.js b/e2e/helpers/selectors.js index 6566bd181..571493ed4 100644 --- a/e2e/helpers/selectors.js +++ b/e2e/helpers/selectors.js @@ -276,6 +276,7 @@ export default { createTicketButton: `vn-ticket-index ${components.vnFloatButton}`, searchResult: `vn-ticket-index vn-card > div > vn-table > div > vn-tbody > a.vn-tr`, searchResultDate: `vn-ticket-index vn-table vn-tbody > a:nth-child(1) > vn-td:nth-child(4)`, + searchResultAddress: `vn-ticket-index vn-table vn-tbody > a:nth-child(1) > vn-td:nth-child(6)`, searchTicketInput: `vn-ticket-index ${components.vnTextfield}`, searchButton: `vn-ticket-index vn-searchbar vn-icon-button[icon="search"]` }, @@ -297,9 +298,9 @@ export default { packagesButton: `vn-menu-item a[ui-sref="ticket.card.package.index"]`, firstPackageSelect: `vn-autocomplete[label="Package"] > div > div > input`, firstPackageSelectOptionThree: `vn-autocomplete[label="Package"] vn-drop-down ul > li:nth-child(3)`, - firstQuantityInput: `vn-textfield[label="Quantity"] > div > input`, + firstQuantityInput: `vn-textfield[label="Quantity"] input`, firstRemovePackageButton: `vn-icon[vn-tooltip="Remove package"]`, - addPackageButton: `vn-icon[vn-tooltip="Add package"]`, + addPackageButton: `vn-icon-button[vn-tooltip="Add package"]`, clearPackageSelectButton: `vn-autocomplete[label="Package"] > div > div > div > vn-icon > i`, savePackagesButton: `${components.vnSubmit}` }, diff --git a/e2e/paths/ticket-module/04_create_ticket_packages.spec.js b/e2e/paths/ticket-module/04_create_ticket_packages.spec.js index c65bf7d4f..f9f36f424 100644 --- a/e2e/paths/ticket-module/04_create_ticket_packages.spec.js +++ b/e2e/paths/ticket-module/04_create_ticket_packages.spec.js @@ -1,8 +1,7 @@ import selectors from '../../helpers/selectors.js'; import createNightmare from '../../helpers/helpers'; -// #640 Ticket Create packages path is excluded -xdescribe('Ticket Create packages path', () => { +describe('Ticket Create packages path', () => { const nightmare = createNightmare(); beforeAll(() => { @@ -36,7 +35,7 @@ xdescribe('Ticket Create packages path', () => { it(`should click on the search result to access to the ticket packages`, () => { return nightmare - .waitForTextInElement(selectors.ticketsIndex.searchResult, 'Batman') + .waitForTextInElement(selectors.ticketsIndex.searchResultAddress, 'address 21') .waitToClick(selectors.ticketsIndex.searchResult) .waitToClick(selectors.ticketPackages.packagesButton) .waitForURL('package/index') @@ -53,9 +52,9 @@ xdescribe('Ticket Create packages path', () => { .waitToClick(selectors.ticketPackages.firstPackageSelect) .waitToClick(selectors.ticketPackages.firstPackageSelectOptionThree) .click(selectors.ticketPackages.savePackagesButton) - .waitForSnackbar() + .waitForLastSnackbar() .then(result => { - expect(result).toEqual(jasmine.arrayContaining(['Some fields are invalid'])); + expect(result).toEqual('Some fields are invalid'); }); }); @@ -63,32 +62,32 @@ xdescribe('Ticket Create packages path', () => { return nightmare .type(selectors.ticketPackages.firstQuantityInput, 'ninety 9') .click(selectors.ticketPackages.savePackagesButton) - .waitForSnackbar() + .waitForLastSnackbar() .then(result => { - expect(result).toEqual(jasmine.arrayContaining(['Some fields are invalid'])); + expect(result).toEqual('Some fields are invalid'); }); }); it(`should attempt create a new package but receive an error if quantity is 0`, () => { return nightmare .clearInput(selectors.ticketPackages.firstQuantityInput) - .type(selectors.ticketPackages.firstQuantityInput, '0') + .type(selectors.ticketPackages.firstQuantityInput, 0) .click(selectors.ticketPackages.savePackagesButton) - .waitForSnackbar() + .waitForLastSnackbar() .then(result => { - expect(result).toEqual(jasmine.arrayContaining(['Some fields are invalid'])); + expect(result).toEqual('Some fields are invalid'); }); }); it(`should attempt create a new package but receive an error if package is blank`, () => { return nightmare .clearInput(selectors.ticketPackages.firstQuantityInput) - .type(selectors.ticketPackages.firstQuantityInput, '99') + .type(selectors.ticketPackages.firstQuantityInput, 99) .click(selectors.ticketPackages.clearPackageSelectButton) .click(selectors.ticketPackages.savePackagesButton) - .waitForSnackbar() + .waitForLastSnackbar() .then(result => { - expect(result).toEqual(jasmine.arrayContaining(['Package cannot be blank'])); + expect(result).toEqual('The package cannot be blank'); }); }); @@ -98,9 +97,9 @@ xdescribe('Ticket Create packages path', () => { .waitToClick(selectors.ticketPackages.firstPackageSelectOptionThree) .waitForTextInInput(selectors.ticketPackages.firstPackageSelect, 'Iron Patriot') .click(selectors.ticketPackages.savePackagesButton) - .waitForSnackbar() + .waitForLastSnackbar() .then(result => { - expect(result).toEqual(jasmine.arrayContaining(['Data saved!'])); + expect(result).toEqual('Data saved!'); }); });