#208 ticket expedition e2e path plus some ticket volume files preparation and refactors

This commit is contained in:
Carlos Jimenez 2018-03-22 15:01:36 +01:00
parent 43c412beeb
commit d57dbe2224
7 changed files with 80 additions and 7 deletions

View File

@ -71,7 +71,7 @@
} }
}, },
{ {
"url": "/expedition", "url": "/Expedition",
"state": "ticket.card.expedition", "state": "ticket.card.expedition",
"component": "vn-ticket-expedition", "component": "vn-ticket-expedition",
"params": { "params": {

View File

@ -0,0 +1,10 @@
<form name="form" ng-submit="$ctrl.submit()">
<vn-card pad-large>
<vn-one margin-medium-top>
<vn-title>Volumes</vn-title>
</vn-one>
</vn-card>
<vn-button-bar>
<vn-submit label="Save"></vn-submit>
</vn-button-bar>
</form>

View File

@ -288,6 +288,11 @@ export default {
firstDescriptionInput: `vn-textfield[label="Description"] > div > input`, firstDescriptionInput: `vn-textfield[label="Description"] > div > input`,
submitNotesButton: `${components.vnSubmit}` submitNotesButton: `${components.vnSubmit}`
}, },
ticketExpedition: {
expeditionButton: `${components.vnMenuItem}[ui-sref="ticket.card.expedition"]`,
secondExpeditionRemoveButton: `body > vn-app > vn-vertical > vn-vertical > ui-view > vn-ticket-card > vn-main-block > vn-horizontal > vn-one > vn-vertical > vn-ticket-expedition > vn-vertical > vn-card > div > vn-vertical > vn-one > vn-horizontal:nth-child(2) > vn-none > i`,
secondExpeditionText: `body > vn-app > vn-vertical > vn-vertical > ui-view > vn-ticket-card > vn-main-block > vn-horizontal > vn-one > vn-vertical > vn-ticket-expedition > vn-vertical > vn-card > div > vn-vertical > vn-one > vn-horizontal:nth-child(2)`
},
ticketPackages: { ticketPackages: {
packagesButton: `${components.vnMenuItem}[ui-sref="ticket.card.package"]`, packagesButton: `${components.vnMenuItem}[ui-sref="ticket.card.package"]`,
firstPackageSelect: `${components.vnAutocomplete}[label="Package"] input` firstPackageSelect: `${components.vnAutocomplete}[label="Package"] input`

View File

@ -1,7 +1,7 @@
import selectors from '../../helpers/selectors.js'; import selectors from '../../helpers/selectors.js';
import createNightmare from '../../helpers/helpers'; import createNightmare from '../../helpers/helpers';
describe('create item niche path', () => { describe('create ticket notes path', () => {
const nightmare = createNightmare(); const nightmare = createNightmare();
beforeAll(() => { beforeAll(() => {

View File

@ -0,0 +1,59 @@
import selectors from '../../helpers/selectors.js';
import createNightmare from '../../helpers/helpers';
describe('delete ticket expeditions path', () => {
const nightmare = createNightmare();
beforeAll(() => {
return nightmare
.waitForLogin('developer');
});
it('should access to the tickets index by clicking the tickets button', () => {
return nightmare
.click(selectors.moduleAccessView.ticketsSectionButton)
.wait(selectors.ticketsIndex.createTicketButton)
.parsedUrl()
.then(url => {
expect(url.hash).toEqual('#!/ticket/list');
});
});
it('should search for the ticket with id 1', () => {
return nightmare
.wait(selectors.ticketsIndex.searchTicketInput)
.type(selectors.ticketsIndex.searchTicketInput, '1')
.click(selectors.ticketsIndex.searchButton)
.waitForNumberOfElements(selectors.ticketsIndex.searchResult, 1)
.countSearchResults(selectors.ticketsIndex.searchResult)
.then(result => {
expect(result).toEqual(1);
});
});
it(`should click on the search result to access to the ticket expeditions`, () => {
return nightmare
.waitForTextInElement(selectors.ticketsIndex.searchResult, '1')
.waitToClick(selectors.ticketsIndex.searchResult)
.waitToClick(selectors.ticketExpedition.expeditionButton)
.waitForURL('Expedition')
.url()
.then(url => {
expect(url).toContain('Expedition');
});
});
it(`should delete a former expedition and confirm the remaining expedition is the expected one`, () => {
return nightmare
.waitToClick(selectors.ticketExpedition.secondExpeditionRemoveButton)
.click(selectors.ticketPackages.packagesButton)
.wait(selectors.ticketPackages.firstPackageSelect)
.click(selectors.ticketExpedition.expeditionButton)
.wait(selectors.ticketExpedition.secondExpeditionText)
.getInnerText(selectors.ticketExpedition.secondExpeditionText)
.then(value => {
expect(value).toContain('Iron Patriot');
expect(value).toContain('root');
});
});
});

View File

@ -401,7 +401,10 @@ INSERT INTO `vn`.`expedition`(`id`, `agencyModeFk`, `ticketFk`, `isBox`, `create
VALUES VALUES
( 1, 1, 1, 0, CURDATE(), 1, 0, 2, 1), ( 1, 1, 1, 0, CURDATE(), 1, 0, 2, 1),
( 2, 1, 1, 1, CURDATE(), 2, 1, 0, 2), ( 2, 1, 1, 1, CURDATE(), 2, 1, 0, 2),
( 3, 2, 2, 2, CURDATE(), 3, 2, 0, NULL); ( 3, 2, 1, 2, CURDATE(), 3, 2, 0, NULL),
( 4, 1, 1, 0, CURDATE(), 1, 0, 2, 1),
( 5, 1, 1, 1, CURDATE(), 2, 1, 0, 2),
( 6, 2, 1, 2, CURDATE(), 3, 2, 0, NULL);
INSERT INTO `vn`.`packaging`(`id`, `volume`, `width`, `height`, `depth`, `isPackageReturnable`, `created`, `itemFk`, `price`) INSERT INTO `vn`.`packaging`(`id`, `volume`, `width`, `height`, `depth`, `isPackageReturnable`, `created`, `itemFk`, `price`)
VALUES VALUES

View File

@ -16,10 +16,6 @@ module.exports = Self => {
{ {
relation: 'worker', relation: 'worker',
scope: {fields: ['firstName', 'name']} scope: {fields: ['firstName', 'name']}
},
{
relation: 'package',
scope: {fields: ['name']}
}] }]
}; };
} }