parent
ecb7e9fd4c
commit
0640f2913e
|
@ -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)
|
||||
|
|
|
@ -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'
|
||||
},
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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³');
|
||||
});
|
||||
});
|
||||
|
|
Loading…
Reference in New Issue