#957 e2e ticket.descriptor add stowaway
gitea/salix/dev This commit looks good Details

This commit is contained in:
Carlos Jimenez Ruiz 2019-03-20 15:33:33 +01:00
parent 8a9bcc3822
commit e0b3b8d4ca
2 changed files with 32 additions and 2 deletions

View File

@ -327,6 +327,7 @@ export default {
ticketDescriptor: {
moreMenu: `vn-ticket-descriptor vn-icon-menu > div > vn-icon`,
moreMenuAddStowaway: `vn-ticket-descriptor vn-icon-menu > div > vn-drop-down > vn-popover ul > li:nth-child(1)`,
moreMenuDeleteStowawayButton: 'vn-ticket-descriptor vn-icon-menu > div > vn-drop-down > vn-popover ul > li:nth-child(4)',
moreMenuAddToTurn: `vn-ticket-descriptor vn-icon-menu > div > vn-drop-down > vn-popover ul > li:nth-child(2)`,
moreMenuDeleteTicket: `vn-ticket-descriptor vn-icon-menu > div > vn-drop-down > vn-popover ul > li:nth-child(3)`,
addStowawayDialogSecondTicket: 'vn-ticket-descriptor > vn-add-stowaway > vn-dialog vn-table vn-tr:nth-child(2)',
@ -336,7 +337,8 @@ export default {
thursdayButton: `vn-ticket-descriptor > vn-dialog > div > form > div.body > tpl-body > div > vn-tool-bar > vn-button:nth-child(4)`,
saturdayButton: `vn-ticket-descriptor > vn-dialog > div > form > div.body > tpl-body > div > vn-tool-bar > vn-button:nth-child(6)`,
closeStowawayDialog: 'vn-ticket-descriptor > vn-add-stowaway > vn-dialog > div > button[class="close"]',
acceptDeleteTicketButton: `vn-ticket-descriptor button[response="ACCEPT"]`
acceptDeleteButton: 'vn-ticket-descriptor button[response="ACCEPT"]',
acceptDeleteStowawayButton: 'vn-ticket-descriptor > vn-remove-stowaway button[response="ACCEPT"]'
},
ticketNotes: {
firstNoteRemoveButton: `vn-icon[icon="delete"]`,

View File

@ -34,7 +34,7 @@ describe('Ticket descriptor path', () => {
const result = await nightmare
.waitToClick(selectors.ticketDescriptor.moreMenu)
.waitToClick(selectors.ticketDescriptor.moreMenuDeleteTicket)
.waitToClick(selectors.ticketDescriptor.acceptDeleteTicketButton)
.waitToClick(selectors.ticketDescriptor.acceptDeleteButton)
.waitForLastSnackbar();
expect(result).toEqual('Ticket deleted');
@ -119,5 +119,33 @@ describe('Ticket descriptor path', () => {
expect(url.hash).toContain('#!/ticket/20/summary');
});
it(`should navigate back to the added ticket using the descriptors ship button`, async() => {
const url = await nightmare
.waitToClick(selectors.ticketDescriptor.closeStowawayDialog)
.waitToClick(selectors.ticketDescriptor.shipSelectButton)
.waitToClick(selectors.ticketDescriptor.shipMenuSecondTicket)
.waitForURL('#!/ticket/22/sale')
.parsedUrl();
expect(url.hash).toContain('#!/ticket/22/sale');
});
it('should delete the stowaway', async() => {
const result = await nightmare
.waitToClick(selectors.ticketDescriptor.moreMenu)
.waitToClick(selectors.ticketDescriptor.moreMenuDeleteStowawayButton)
.waitToClick(selectors.ticketDescriptor.acceptDeleteStowawayButton)
.waitForLastSnackbar();
expect(result).toEqual('Data saved!');
});
it(`should confirm the ship buton doesn't exisist any more`, async() => {
const exists = await nightmare
.exists(selectors.ticketDescriptor.shipButton);
expect(exists).toBeFalsy();
});
});
});