#640 Ticket Create packages path is excluded

This commit is contained in:
Carlos Jimenez 2018-09-12 16:25:12 +02:00
parent b5301fcc94
commit 6b6e7d96b8
2 changed files with 17 additions and 17 deletions

View File

@ -276,6 +276,7 @@ export default {
createTicketButton: `vn-ticket-index ${components.vnFloatButton}`,
searchResult: `vn-ticket-index vn-card > div > vn-table > div > vn-tbody > a.vn-tr`,
searchResultDate: `vn-ticket-index vn-table vn-tbody > a:nth-child(1) > vn-td:nth-child(4)`,
searchResultAddress: `vn-ticket-index vn-table vn-tbody > a:nth-child(1) > vn-td:nth-child(6)`,
searchTicketInput: `vn-ticket-index ${components.vnTextfield}`,
searchButton: `vn-ticket-index vn-searchbar vn-icon-button[icon="search"]`
},
@ -297,9 +298,9 @@ export default {
packagesButton: `vn-menu-item a[ui-sref="ticket.card.package.index"]`,
firstPackageSelect: `vn-autocomplete[label="Package"] > div > div > input`,
firstPackageSelectOptionThree: `vn-autocomplete[label="Package"] vn-drop-down ul > li:nth-child(3)`,
firstQuantityInput: `vn-textfield[label="Quantity"] > div > input`,
firstQuantityInput: `vn-textfield[label="Quantity"] input`,
firstRemovePackageButton: `vn-icon[vn-tooltip="Remove package"]`,
addPackageButton: `vn-icon[vn-tooltip="Add package"]`,
addPackageButton: `vn-icon-button[vn-tooltip="Add package"]`,
clearPackageSelectButton: `vn-autocomplete[label="Package"] > div > div > div > vn-icon > i`,
savePackagesButton: `${components.vnSubmit}`
},

View File

@ -1,8 +1,7 @@
import selectors from '../../helpers/selectors.js';
import createNightmare from '../../helpers/helpers';
// #640 Ticket Create packages path is excluded
xdescribe('Ticket Create packages path', () => {
describe('Ticket Create packages path', () => {
const nightmare = createNightmare();
beforeAll(() => {
@ -36,7 +35,7 @@ xdescribe('Ticket Create packages path', () => {
it(`should click on the search result to access to the ticket packages`, () => {
return nightmare
.waitForTextInElement(selectors.ticketsIndex.searchResult, 'Batman')
.waitForTextInElement(selectors.ticketsIndex.searchResultAddress, 'address 21')
.waitToClick(selectors.ticketsIndex.searchResult)
.waitToClick(selectors.ticketPackages.packagesButton)
.waitForURL('package/index')
@ -53,9 +52,9 @@ xdescribe('Ticket Create packages path', () => {
.waitToClick(selectors.ticketPackages.firstPackageSelect)
.waitToClick(selectors.ticketPackages.firstPackageSelectOptionThree)
.click(selectors.ticketPackages.savePackagesButton)
.waitForSnackbar()
.waitForLastSnackbar()
.then(result => {
expect(result).toEqual(jasmine.arrayContaining(['Some fields are invalid']));
expect(result).toEqual('Some fields are invalid');
});
});
@ -63,32 +62,32 @@ xdescribe('Ticket Create packages path', () => {
return nightmare
.type(selectors.ticketPackages.firstQuantityInput, 'ninety 9')
.click(selectors.ticketPackages.savePackagesButton)
.waitForSnackbar()
.waitForLastSnackbar()
.then(result => {
expect(result).toEqual(jasmine.arrayContaining(['Some fields are invalid']));
expect(result).toEqual('Some fields are invalid');
});
});
it(`should attempt create a new package but receive an error if quantity is 0`, () => {
return nightmare
.clearInput(selectors.ticketPackages.firstQuantityInput)
.type(selectors.ticketPackages.firstQuantityInput, '0')
.type(selectors.ticketPackages.firstQuantityInput, 0)
.click(selectors.ticketPackages.savePackagesButton)
.waitForSnackbar()
.waitForLastSnackbar()
.then(result => {
expect(result).toEqual(jasmine.arrayContaining(['Some fields are invalid']));
expect(result).toEqual('Some fields are invalid');
});
});
it(`should attempt create a new package but receive an error if package is blank`, () => {
return nightmare
.clearInput(selectors.ticketPackages.firstQuantityInput)
.type(selectors.ticketPackages.firstQuantityInput, '99')
.type(selectors.ticketPackages.firstQuantityInput, 99)
.click(selectors.ticketPackages.clearPackageSelectButton)
.click(selectors.ticketPackages.savePackagesButton)
.waitForSnackbar()
.waitForLastSnackbar()
.then(result => {
expect(result).toEqual(jasmine.arrayContaining(['Package cannot be blank']));
expect(result).toEqual('The package cannot be blank');
});
});
@ -98,9 +97,9 @@ xdescribe('Ticket Create packages path', () => {
.waitToClick(selectors.ticketPackages.firstPackageSelectOptionThree)
.waitForTextInInput(selectors.ticketPackages.firstPackageSelect, 'Iron Patriot')
.click(selectors.ticketPackages.savePackagesButton)
.waitForSnackbar()
.waitForLastSnackbar()
.then(result => {
expect(result).toEqual(jasmine.arrayContaining(['Data saved!']));
expect(result).toEqual('Data saved!');
});
});