diff --git a/e2e/helpers/extensions.js b/e2e/helpers/extensions.js index 9ddac85892..abdb637e3a 100644 --- a/e2e/helpers/extensions.js +++ b/e2e/helpers/extensions.js @@ -144,6 +144,7 @@ let actions = { waitToGetProperty: function(selector, property, done) { this.wait((selector, property) => { const element = document.querySelector(selector); + return element && element[property] != null && element[property] !== ''; }, selector, property) .getProperty(selector, property) diff --git a/e2e/helpers/selectors.js b/e2e/helpers/selectors.js index c941d80a2d..b8ab866ca0 100644 --- a/e2e/helpers/selectors.js +++ b/e2e/helpers/selectors.js @@ -601,6 +601,9 @@ export default { descriptionInput: 'vn-route-create vn-textfield[field="$ctrl.route.description"] input', submitButton: 'vn-route-create vn-submit > input[type="submit"]' }, + routeDescriptor: { + volume: 'vn-route-descriptor vn-label-value[label="Volume"] > section > span' + }, routeSummary: { routeId: 'vn-route-summary > vn-card > div > vn-horizontal > vn-one:nth-child(1) > vn-label-value:nth-child(1) > section > span' }, diff --git a/e2e/paths/05-ticket-module/12_descriptor.spec.js b/e2e/paths/05-ticket-module/12_descriptor.spec.js index e236e701ae..bfc6ad5013 100644 --- a/e2e/paths/05-ticket-module/12_descriptor.spec.js +++ b/e2e/paths/05-ticket-module/12_descriptor.spec.js @@ -110,6 +110,13 @@ describe('Ticket descriptor path', () => { expect(url.hash).toContain('#!/ticket/17/summary'); }); + it(`should check the state of the stowaway ticket is embarked`, async() => { + const state = await nightmare + .waitToGetProperty(selectors.ticketDescriptor.stateLabelValue, 'innerText'); + + expect(state).toEqual('State Embarcando'); + }); + it(`should navigate to the ship ticket using the descriptors ship button`, async() => { const url = await nightmare .waitToClick(selectors.ticketDescriptor.shipButton) diff --git a/e2e/paths/08-route-module/03_tickets.spec.js b/e2e/paths/08-route-module/03_tickets.spec.js index 935efdad13..945947c1dd 100644 --- a/e2e/paths/08-route-module/03_tickets.spec.js +++ b/e2e/paths/08-route-module/03_tickets.spec.js @@ -79,6 +79,13 @@ describe('Route basic Data path', () => { expect(result).toBeFalsy(); }); + it('should check the route volume on the descriptor', async() => { + const result = await nightmare + .waitToGetProperty(selectors.routeDescriptor.volume, 'innerText'); + + expect(result).toEqual('0.9 / 50 m³'); + }); + it('should count how many tickets are in route', async() => { const result = await nightmare .countElement('vn-route-tickets vn-textfield[model="ticket.priority"]'); @@ -101,4 +108,11 @@ describe('Route basic Data path', () => { expect(result).toEqual(2); }); + + it('should confirm the route volume on the descriptor has been updated by the changes made', async() => { + const result = await nightmare + .waitToGetProperty(selectors.routeDescriptor.volume, 'innerText'); + + expect(result).toEqual('0.7 / 50 m³'); + }); });