#1568 #1510 e2e descriptor paths

This commit is contained in:
Carlos Jimenez Ruiz 2019-07-01 13:41:38 +02:00
parent ecb7e9fd4c
commit 0640f2913e
4 changed files with 25 additions and 0 deletions

View File

@ -144,6 +144,7 @@ let actions = {
waitToGetProperty: function(selector, property, done) { waitToGetProperty: function(selector, property, done) {
this.wait((selector, property) => { this.wait((selector, property) => {
const element = document.querySelector(selector); const element = document.querySelector(selector);
return element && element[property] != null && element[property] !== ''; return element && element[property] != null && element[property] !== '';
}, selector, property) }, selector, property)
.getProperty(selector, property) .getProperty(selector, property)

View File

@ -601,6 +601,9 @@ export default {
descriptionInput: 'vn-route-create vn-textfield[field="$ctrl.route.description"] input', descriptionInput: 'vn-route-create vn-textfield[field="$ctrl.route.description"] input',
submitButton: 'vn-route-create vn-submit > input[type="submit"]' submitButton: 'vn-route-create vn-submit > input[type="submit"]'
}, },
routeDescriptor: {
volume: 'vn-route-descriptor vn-label-value[label="Volume"] > section > span'
},
routeSummary: { routeSummary: {
routeId: 'vn-route-summary > vn-card > div > vn-horizontal > vn-one:nth-child(1) > vn-label-value:nth-child(1) > section > span' routeId: 'vn-route-summary > vn-card > div > vn-horizontal > vn-one:nth-child(1) > vn-label-value:nth-child(1) > section > span'
}, },

View File

@ -110,6 +110,13 @@ describe('Ticket descriptor path', () => {
expect(url.hash).toContain('#!/ticket/17/summary'); 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() => { it(`should navigate to the ship ticket using the descriptors ship button`, async() => {
const url = await nightmare const url = await nightmare
.waitToClick(selectors.ticketDescriptor.shipButton) .waitToClick(selectors.ticketDescriptor.shipButton)

View File

@ -79,6 +79,13 @@ describe('Route basic Data path', () => {
expect(result).toBeFalsy(); 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() => { it('should count how many tickets are in route', async() => {
const result = await nightmare const result = await nightmare
.countElement('vn-route-tickets vn-textfield[model="ticket.priority"]'); .countElement('vn-route-tickets vn-textfield[model="ticket.priority"]');
@ -101,4 +108,11 @@ describe('Route basic Data path', () => {
expect(result).toEqual(2); 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³');
});
}); });