2018-09-10 11:38:14 +00:00
|
|
|
import selectors from '../../helpers/selectors.js';
|
|
|
|
import createNightmare from '../../helpers/helpers';
|
|
|
|
|
2018-10-22 15:12:41 +00:00
|
|
|
describe('Ticket Edit sale path', () => {
|
2018-09-10 11:38:14 +00:00
|
|
|
const nightmare = createNightmare();
|
|
|
|
|
|
|
|
beforeAll(() => {
|
|
|
|
return nightmare
|
|
|
|
.waitForLogin('salesPerson');
|
|
|
|
});
|
|
|
|
|
2018-10-22 15:12:41 +00:00
|
|
|
it('should click on the Tickets button of the top bar menu', done => {
|
2018-09-10 11:38:14 +00:00
|
|
|
return nightmare
|
|
|
|
.waitToClick(selectors.globalItems.applicationsMenuButton)
|
|
|
|
.wait(selectors.globalItems.applicationsMenuVisible)
|
|
|
|
.waitToClick(selectors.globalItems.ticketsButton)
|
2018-10-20 10:07:48 +00:00
|
|
|
.wait(selectors.ticketsIndex.searchResult)
|
2018-09-10 11:38:14 +00:00
|
|
|
.parsedUrl()
|
|
|
|
.then(url => {
|
|
|
|
expect(url.hash).toEqual('#!/ticket/index');
|
2018-10-22 15:12:41 +00:00
|
|
|
done();
|
|
|
|
}).catch(done.fail);
|
2018-09-10 11:38:14 +00:00
|
|
|
});
|
|
|
|
|
2018-10-22 15:12:41 +00:00
|
|
|
it('should search for a specific ticket', done => {
|
2018-09-10 11:38:14 +00:00
|
|
|
return nightmare
|
|
|
|
.wait(selectors.ticketsIndex.searchResult)
|
|
|
|
.type(selectors.ticketsIndex.searchTicketInput, 'id:16')
|
|
|
|
.click(selectors.ticketsIndex.searchButton)
|
|
|
|
.waitForNumberOfElements(selectors.ticketsIndex.searchResult, 1)
|
|
|
|
.countElement(selectors.ticketsIndex.searchResult)
|
|
|
|
.then(result => {
|
|
|
|
expect(result).toEqual(1);
|
2018-10-22 15:12:41 +00:00
|
|
|
done();
|
|
|
|
}).catch(done.fail);
|
2018-09-10 11:38:14 +00:00
|
|
|
});
|
|
|
|
|
2018-10-22 15:12:41 +00:00
|
|
|
it(`should click on the search result to access to the ticket Sale`, done => {
|
2018-09-10 11:38:14 +00:00
|
|
|
return nightmare
|
|
|
|
.waitForTextInElement(selectors.ticketsIndex.searchResult, 'address 21')
|
|
|
|
.waitToClick(selectors.ticketsIndex.searchResult)
|
|
|
|
.waitToClick(selectors.ticketSales.saleButton)
|
|
|
|
.waitForURL('/sale')
|
|
|
|
.url()
|
|
|
|
.then(url => {
|
|
|
|
expect(url).toContain('/sale');
|
2018-10-22 15:12:41 +00:00
|
|
|
done();
|
|
|
|
}).catch(done.fail);
|
2018-09-10 11:38:14 +00:00
|
|
|
});
|
|
|
|
|
2018-10-22 15:12:41 +00:00
|
|
|
it(`should check the zoomed image isnt present`, done => {
|
2018-09-10 11:38:14 +00:00
|
|
|
return nightmare
|
|
|
|
.countElement(selectors.ticketSales.firstSaleZoomedImage)
|
|
|
|
.then(result => {
|
|
|
|
expect(result).toEqual(0);
|
2018-10-22 15:12:41 +00:00
|
|
|
done();
|
|
|
|
}).catch(done.fail);
|
2018-09-10 11:38:14 +00:00
|
|
|
});
|
|
|
|
|
2018-10-22 15:12:41 +00:00
|
|
|
it(`should click on the thumbnail image of the 1st sale and see the zoomed image`, done => {
|
2018-09-10 11:38:14 +00:00
|
|
|
return nightmare
|
|
|
|
.waitToClick(selectors.ticketSales.firstSaleThumbnailImage)
|
|
|
|
.countElement(selectors.ticketSales.firstSaleZoomedImage)
|
|
|
|
.then(result => {
|
|
|
|
expect(result).toEqual(1);
|
2018-10-22 15:12:41 +00:00
|
|
|
done();
|
|
|
|
}).catch(done.fail);
|
2018-09-10 11:38:14 +00:00
|
|
|
});
|
|
|
|
|
2018-10-22 15:12:41 +00:00
|
|
|
it(`should click on the zoomed image to close it`, done => {
|
2018-09-10 11:38:14 +00:00
|
|
|
return nightmare
|
|
|
|
.waitToClick(selectors.ticketSales.firstSaleZoomedImage)
|
|
|
|
.countElement(selectors.ticketSales.firstSaleZoomedImage)
|
|
|
|
.then(result => {
|
|
|
|
expect(result).toEqual(0);
|
2018-10-22 15:12:41 +00:00
|
|
|
done();
|
|
|
|
}).catch(done.fail);
|
2018-09-10 11:38:14 +00:00
|
|
|
});
|
|
|
|
|
2018-10-22 15:12:41 +00:00
|
|
|
it(`should confirm the item descriptor insnt visible yet`, done => {
|
2018-09-10 11:38:14 +00:00
|
|
|
return nightmare
|
|
|
|
.isVisible(selectors.ticketSales.saleDescriptorPopover)
|
2018-10-22 15:12:41 +00:00
|
|
|
.then(visible => {
|
|
|
|
expect(visible).toBeFalsy();
|
|
|
|
done();
|
|
|
|
}).catch(done.fail);
|
2018-09-10 11:38:14 +00:00
|
|
|
});
|
|
|
|
|
2018-10-22 15:12:41 +00:00
|
|
|
it(`should click on the first sale ID making the item descriptor visible`, done => {
|
2018-09-10 11:38:14 +00:00
|
|
|
return nightmare
|
|
|
|
.waitToClick(selectors.ticketSales.firstSaleID)
|
2018-10-22 15:12:41 +00:00
|
|
|
.wait(1000)
|
2018-09-10 11:38:14 +00:00
|
|
|
.isVisible(selectors.ticketSales.saleDescriptorPopover)
|
2018-10-22 15:12:41 +00:00
|
|
|
.then(visible => {
|
|
|
|
expect(visible).toBeTruthy();
|
|
|
|
done();
|
|
|
|
}).catch(done.fail);
|
2018-09-10 11:38:14 +00:00
|
|
|
});
|
|
|
|
|
2018-10-22 15:12:41 +00:00
|
|
|
it(`should click on the descriptor image of the 1st sale and see the zoomed image`, done => {
|
2018-09-10 11:38:14 +00:00
|
|
|
return nightmare
|
|
|
|
.waitToClick('vn-item-descriptor img')
|
|
|
|
.countElement(selectors.ticketSales.firstSaleZoomedImage)
|
|
|
|
.then(result => {
|
|
|
|
expect(result).toEqual(1);
|
2018-10-22 15:12:41 +00:00
|
|
|
done();
|
|
|
|
}).catch(done.fail);
|
2018-09-10 11:38:14 +00:00
|
|
|
});
|
|
|
|
|
2018-10-22 15:12:41 +00:00
|
|
|
it(`should click on the zoomed image to close it`, done => {
|
2018-09-10 11:38:14 +00:00
|
|
|
return nightmare
|
|
|
|
.waitToClick(selectors.ticketSales.firstSaleZoomedImage)
|
|
|
|
.countElement(selectors.ticketSales.firstSaleZoomedImage)
|
|
|
|
.then(result => {
|
|
|
|
expect(result).toEqual(0);
|
2018-10-22 15:12:41 +00:00
|
|
|
done();
|
|
|
|
}).catch(done.fail);
|
2018-09-10 11:38:14 +00:00
|
|
|
});
|
|
|
|
|
2018-10-22 15:12:41 +00:00
|
|
|
it(`should click on the summary icon of the item-descriptor to access to the item summary`, done => {
|
2018-09-10 11:38:14 +00:00
|
|
|
return nightmare
|
|
|
|
.waitToClick(selectors.ticketSales.saleDescriptorPopoverSummaryButton)
|
|
|
|
.waitForURL('/summary')
|
|
|
|
.url()
|
|
|
|
.then(url => {
|
|
|
|
expect(url).toContain('/summary');
|
2018-10-22 15:12:41 +00:00
|
|
|
done();
|
|
|
|
}).catch(done.fail);
|
2018-09-10 11:38:14 +00:00
|
|
|
});
|
|
|
|
|
2018-10-22 15:12:41 +00:00
|
|
|
it('should return to ticket sales section', done => {
|
2018-09-10 11:38:14 +00:00
|
|
|
return nightmare
|
|
|
|
.waitToClick(selectors.globalItems.applicationsMenuButton)
|
|
|
|
.wait(selectors.globalItems.applicationsMenuVisible)
|
|
|
|
.waitToClick(selectors.globalItems.ticketsButton)
|
|
|
|
.wait(selectors.ticketsIndex.searchResult)
|
|
|
|
.type(selectors.ticketsIndex.searchTicketInput, 'id:16')
|
|
|
|
.click(selectors.ticketsIndex.searchButton)
|
|
|
|
.waitForNumberOfElements(selectors.ticketsIndex.searchResult, 1)
|
|
|
|
.waitForTextInElement(selectors.ticketsIndex.searchResult, 'address 21')
|
|
|
|
.waitToClick(selectors.ticketsIndex.searchResult)
|
|
|
|
.waitToClick(selectors.ticketSales.saleButton)
|
|
|
|
.waitForURL('/sale')
|
|
|
|
.url()
|
|
|
|
.then(url => {
|
|
|
|
expect(url).toContain('/sale');
|
2018-10-22 15:12:41 +00:00
|
|
|
done();
|
|
|
|
}).catch(done.fail);
|
2018-09-10 11:38:14 +00:00
|
|
|
});
|
|
|
|
|
2018-10-22 15:12:41 +00:00
|
|
|
it('should try to add a higher quantity value and then receive an error', done => {
|
2018-09-10 11:38:14 +00:00
|
|
|
return nightmare
|
|
|
|
.waitToClick(selectors.ticketSales.firstSaleQuantityClearInput)
|
|
|
|
.type(selectors.ticketSales.firstSaleQuantity, '9\u000d')
|
|
|
|
.waitForLastSnackbar()
|
|
|
|
.then(result => {
|
|
|
|
expect(result).toEqual('The new quantity should be smaller than the old one');
|
2018-10-22 15:12:41 +00:00
|
|
|
done();
|
|
|
|
}).catch(done.fail);
|
2018-09-10 11:38:14 +00:00
|
|
|
});
|
|
|
|
|
2018-10-22 15:12:41 +00:00
|
|
|
it('should remove 1 from quantity', done => {
|
2018-09-10 11:38:14 +00:00
|
|
|
return nightmare
|
|
|
|
.waitToClick(selectors.ticketSales.firstSaleQuantityClearInput)
|
|
|
|
.type(selectors.ticketSales.firstSaleQuantity, '4\u000d')
|
|
|
|
.waitForLastSnackbar()
|
|
|
|
.then(result => {
|
|
|
|
expect(result).toEqual('Data saved!');
|
2018-10-22 15:12:41 +00:00
|
|
|
done();
|
|
|
|
}).catch(done.fail);
|
2018-09-10 11:38:14 +00:00
|
|
|
});
|
|
|
|
|
2018-10-22 15:12:41 +00:00
|
|
|
it('should update the price', done => {
|
2018-09-10 11:38:14 +00:00
|
|
|
return nightmare
|
|
|
|
.waitToClick(selectors.ticketSales.firstSalePrice)
|
|
|
|
.wait(selectors.ticketSales.firstSalePriceInput)
|
|
|
|
.type(selectors.ticketSales.firstSalePriceInput, 5)
|
|
|
|
.type('body', '\u000d') // simulates enter
|
|
|
|
.waitForLastSnackbar()
|
|
|
|
.then(result => {
|
|
|
|
expect(result).toEqual('Data saved!');
|
2018-10-22 15:12:41 +00:00
|
|
|
done();
|
|
|
|
}).catch(done.fail);
|
2018-09-10 11:38:14 +00:00
|
|
|
});
|
|
|
|
|
2018-10-22 15:12:41 +00:00
|
|
|
it('should confirm the price have been updated', done => {
|
2018-09-10 11:38:14 +00:00
|
|
|
return nightmare
|
|
|
|
.getInnerText(selectors.ticketSales.firstSalePrice)
|
|
|
|
.then(result => {
|
2018-10-16 14:23:33 +00:00
|
|
|
expect(result).toContain('5.00');
|
2018-10-22 15:12:41 +00:00
|
|
|
done();
|
|
|
|
}).catch(done.fail);
|
2018-09-10 11:38:14 +00:00
|
|
|
});
|
|
|
|
|
2018-10-22 15:12:41 +00:00
|
|
|
it('should confirm the total price for that item have been updated', done => {
|
2018-09-10 11:38:14 +00:00
|
|
|
return nightmare
|
|
|
|
.getInnerText(selectors.ticketSales.firstSaleImport)
|
|
|
|
.then(result => {
|
2018-10-16 14:23:33 +00:00
|
|
|
expect(result).toContain('20.00');
|
2018-10-22 15:12:41 +00:00
|
|
|
done();
|
|
|
|
}).catch(done.fail);
|
2018-09-10 11:38:14 +00:00
|
|
|
});
|
|
|
|
|
2018-10-22 15:12:41 +00:00
|
|
|
it('should update the discount', done => {
|
2018-09-10 11:38:14 +00:00
|
|
|
return nightmare
|
|
|
|
.waitToClick(selectors.ticketSales.firstSaleDiscount)
|
|
|
|
.wait('vn-textfield[label="Discount"] > div[class="container selected"]') // a function selects the text after it's loaded
|
|
|
|
.type(selectors.ticketSales.firstSaleDiscountInput, 50)
|
|
|
|
.type('body', '\u000d') // simulates enter
|
|
|
|
.waitForLastSnackbar()
|
|
|
|
.then(result => {
|
|
|
|
expect(result).toEqual('Data saved!');
|
2018-10-22 15:12:41 +00:00
|
|
|
done();
|
|
|
|
}).catch(done.fail);
|
2018-09-10 11:38:14 +00:00
|
|
|
});
|
|
|
|
|
2018-10-22 15:12:41 +00:00
|
|
|
it('should confirm the discount have been updated', done => {
|
2018-09-10 11:38:14 +00:00
|
|
|
return nightmare
|
|
|
|
.waitForTextInElement(selectors.ticketSales.firstSaleDiscount, '50 %')
|
|
|
|
.getInnerText(selectors.ticketSales.firstSaleDiscount)
|
|
|
|
.then(result => {
|
|
|
|
expect(result).toContain('50 %');
|
2018-10-22 15:12:41 +00:00
|
|
|
done();
|
|
|
|
}).catch(done.fail);
|
2018-09-10 11:38:14 +00:00
|
|
|
});
|
|
|
|
|
2018-10-22 15:12:41 +00:00
|
|
|
it('should confirm the total import for that item have been updated', done => {
|
2018-09-10 11:38:14 +00:00
|
|
|
return nightmare
|
2018-10-16 14:23:33 +00:00
|
|
|
.waitForTextInElement(selectors.ticketSales.firstSaleImport, '10.00')
|
2018-09-10 11:38:14 +00:00
|
|
|
.getInnerText(selectors.ticketSales.firstSaleImport)
|
|
|
|
.then(result => {
|
2018-10-16 14:23:33 +00:00
|
|
|
expect(result).toContain('10.00');
|
2018-10-22 15:12:41 +00:00
|
|
|
done();
|
|
|
|
}).catch(done.fail);
|
2018-09-10 11:38:14 +00:00
|
|
|
});
|
|
|
|
|
2018-10-22 15:12:41 +00:00
|
|
|
it('should select the third sale and create a claim of it', done => {
|
2018-09-12 13:38:08 +00:00
|
|
|
return nightmare
|
2018-10-22 15:12:41 +00:00
|
|
|
.waitToClick(selectors.ticketSales.thirdSaleCheckbox)
|
2018-09-12 13:38:08 +00:00
|
|
|
.waitToClick(selectors.ticketSales.moreMenuButton)
|
|
|
|
.waitToClick(selectors.ticketSales.moreMenuCreateClaim)
|
2018-10-11 07:14:26 +00:00
|
|
|
.waitForLogin('salesPerson')
|
2018-09-12 13:38:08 +00:00
|
|
|
.waitToClick(selectors.globalItems.applicationsMenuButton)
|
|
|
|
.wait(selectors.globalItems.applicationsMenuVisible)
|
|
|
|
.waitToClick(selectors.globalItems.claimsButton)
|
|
|
|
.wait(selectors.claimsIndex.searchResult)
|
|
|
|
.parsedUrl()
|
|
|
|
.then(url => {
|
|
|
|
expect(url.hash).toEqual('#!/claim/index');
|
2018-10-22 15:12:41 +00:00
|
|
|
done();
|
|
|
|
}).catch(done.fail);
|
2018-09-12 13:38:08 +00:00
|
|
|
});
|
|
|
|
|
2018-10-22 15:12:41 +00:00
|
|
|
it('should click on the Claims button of the top bar menu', done => {
|
2018-09-12 13:38:08 +00:00
|
|
|
return nightmare
|
|
|
|
.waitToClick(selectors.globalItems.applicationsMenuButton)
|
|
|
|
.wait(selectors.globalItems.applicationsMenuVisible)
|
|
|
|
.waitToClick(selectors.globalItems.claimsButton)
|
|
|
|
.wait(selectors.claimsIndex.searchClaimInput)
|
|
|
|
.parsedUrl()
|
|
|
|
.then(url => {
|
|
|
|
expect(url.hash).toEqual('#!/claim/index');
|
2018-10-22 15:12:41 +00:00
|
|
|
done();
|
|
|
|
}).catch(done.fail);
|
2018-09-12 13:38:08 +00:00
|
|
|
});
|
|
|
|
|
2018-10-22 15:12:41 +00:00
|
|
|
it('should search for the claim with id 4', done => {
|
2018-09-12 13:38:08 +00:00
|
|
|
return nightmare
|
|
|
|
.wait(selectors.claimsIndex.searchResult)
|
|
|
|
.type(selectors.claimsIndex.searchClaimInput, 4)
|
|
|
|
.click(selectors.claimsIndex.searchButton)
|
|
|
|
.waitForNumberOfElements(selectors.claimsIndex.searchResult, 1)
|
|
|
|
.countElement(selectors.claimsIndex.searchResult)
|
|
|
|
.then(result => {
|
|
|
|
expect(result).toEqual(1);
|
2018-10-22 15:12:41 +00:00
|
|
|
done();
|
|
|
|
}).catch(done.fail);
|
2018-09-12 13:38:08 +00:00
|
|
|
});
|
|
|
|
|
2018-10-22 15:12:41 +00:00
|
|
|
it('should click the Tickets button of the top bar menu', done => {
|
2018-09-12 13:38:08 +00:00
|
|
|
return nightmare
|
|
|
|
.waitToClick(selectors.globalItems.applicationsMenuButton)
|
|
|
|
.wait(selectors.globalItems.applicationsMenuVisible)
|
|
|
|
.waitToClick(selectors.globalItems.ticketsButton)
|
2018-10-20 10:07:48 +00:00
|
|
|
.wait(selectors.ticketsIndex.searchResult)
|
2018-09-12 13:38:08 +00:00
|
|
|
.parsedUrl()
|
|
|
|
.then(url => {
|
|
|
|
expect(url.hash).toEqual('#!/ticket/index');
|
2018-10-22 15:12:41 +00:00
|
|
|
done();
|
|
|
|
}).catch(done.fail);
|
2018-09-12 13:38:08 +00:00
|
|
|
});
|
|
|
|
|
2018-10-22 15:12:41 +00:00
|
|
|
it('should search the ticket', done => {
|
2018-09-12 13:38:08 +00:00
|
|
|
return nightmare
|
|
|
|
.wait(selectors.ticketsIndex.searchResult)
|
|
|
|
.type(selectors.ticketsIndex.searchTicketInput, 'id:16')
|
|
|
|
.click(selectors.ticketsIndex.searchButton)
|
|
|
|
.waitForNumberOfElements(selectors.ticketsIndex.searchResult, 1)
|
|
|
|
.countElement(selectors.ticketsIndex.searchResult)
|
|
|
|
.then(result => {
|
|
|
|
expect(result).toEqual(1);
|
2018-10-22 15:12:41 +00:00
|
|
|
done();
|
|
|
|
}).catch(done.fail);
|
2018-09-12 13:38:08 +00:00
|
|
|
});
|
|
|
|
|
2018-10-22 15:12:41 +00:00
|
|
|
it(`should click on the result to access to the ticket Sale`, done => {
|
2018-09-12 13:38:08 +00:00
|
|
|
return nightmare
|
|
|
|
.waitForTextInElement(selectors.ticketsIndex.searchResult, 'address 21')
|
|
|
|
.waitToClick(selectors.ticketsIndex.searchResult)
|
|
|
|
.waitToClick(selectors.ticketSales.saleButton)
|
|
|
|
.waitForURL('/sale')
|
|
|
|
.url()
|
|
|
|
.then(url => {
|
|
|
|
expect(url).toContain('/sale');
|
2018-10-22 15:12:41 +00:00
|
|
|
done();
|
|
|
|
}).catch(done.fail);
|
2018-09-12 13:38:08 +00:00
|
|
|
});
|
|
|
|
|
2018-10-22 15:12:41 +00:00
|
|
|
it('should select the third sale and delete it', done => {
|
2018-09-10 11:38:14 +00:00
|
|
|
return nightmare
|
|
|
|
.waitToClick(selectors.ticketSales.thirdSaleCheckbox)
|
|
|
|
.waitToClick(selectors.ticketSales.deleteSaleButton)
|
2018-09-12 13:38:08 +00:00
|
|
|
.waitToClick(selectors.ticketSales.acceptDeleteLineButton)
|
2018-09-10 11:38:14 +00:00
|
|
|
.waitForLastSnackbar()
|
|
|
|
.then(result => {
|
|
|
|
expect(result).toEqual('Data saved!');
|
2018-10-22 15:12:41 +00:00
|
|
|
done();
|
|
|
|
}).catch(done.fail);
|
2018-09-10 11:38:14 +00:00
|
|
|
});
|
|
|
|
|
2018-10-22 15:12:41 +00:00
|
|
|
it(`should confirm the third sale was deleted`, done => {
|
2018-09-10 11:38:14 +00:00
|
|
|
return nightmare
|
|
|
|
.countElement(selectors.ticketSales.saleLine)
|
|
|
|
.then(result => {
|
|
|
|
expect(result).toEqual(3);
|
2018-10-22 15:12:41 +00:00
|
|
|
done();
|
|
|
|
}).catch(done.fail);
|
2018-09-10 11:38:14 +00:00
|
|
|
});
|
|
|
|
|
2018-10-22 15:12:41 +00:00
|
|
|
it('should select the third sale and attempt to send it to a frozen client ticket', done => {
|
2018-09-10 11:38:14 +00:00
|
|
|
return nightmare
|
|
|
|
.waitToClick(selectors.ticketSales.thirdSaleCheckbox)
|
|
|
|
.waitToClick(selectors.ticketSales.transferSaleButton)
|
|
|
|
.wait(selectors.ticketSales.moveToTicketInput)
|
|
|
|
.type(selectors.ticketSales.moveToTicketInput, 2)
|
|
|
|
.waitToClick(selectors.ticketSales.moveToTicketButton)
|
|
|
|
.waitForLastSnackbar()
|
|
|
|
.then(result => {
|
2018-09-21 13:01:51 +00:00
|
|
|
expect(result).toEqual(`The sales of this ticket can't be modified`);
|
2018-10-22 15:12:41 +00:00
|
|
|
done();
|
|
|
|
}).catch(done.fail);
|
2018-09-10 11:38:14 +00:00
|
|
|
});
|
|
|
|
|
2018-10-22 15:12:41 +00:00
|
|
|
it('should transfer the sale to a valid ticket', done => {
|
2018-09-10 11:38:14 +00:00
|
|
|
return nightmare
|
|
|
|
.waitToClick(selectors.ticketSales.moveToTicketInputClearButton)
|
|
|
|
.type(selectors.ticketSales.moveToTicketInput, 12)
|
|
|
|
.waitToClick(selectors.ticketSales.moveToTicketButton)
|
|
|
|
.waitForURL('ticket/12/sale')
|
|
|
|
.url()
|
|
|
|
.then(result => {
|
|
|
|
expect(result).toContain(`ticket/12/sale`);
|
2018-10-22 15:12:41 +00:00
|
|
|
done();
|
|
|
|
}).catch(done.fail);
|
2018-09-10 11:38:14 +00:00
|
|
|
});
|
|
|
|
|
2018-10-22 15:12:41 +00:00
|
|
|
it('should confirm the transfered line is the correct one', done => {
|
2018-09-10 11:38:14 +00:00
|
|
|
return nightmare
|
|
|
|
.wait(selectors.ticketSales.firstSaleText)
|
|
|
|
.getInnerText(selectors.ticketSales.firstSaleText)
|
|
|
|
.then(result => {
|
|
|
|
expect(result).toContain(`Mark I`);
|
2018-10-22 15:12:41 +00:00
|
|
|
done();
|
|
|
|
}).catch(done.fail);
|
2018-09-10 11:38:14 +00:00
|
|
|
});
|
|
|
|
|
2018-10-22 15:12:41 +00:00
|
|
|
it('should go back to the original ticket sales section', done => {
|
2018-09-10 11:38:14 +00:00
|
|
|
return nightmare
|
|
|
|
.waitToClick(selectors.itemsIndex.goBackToModuleIndexButton)
|
|
|
|
.wait(selectors.ticketsIndex.searchResult)
|
|
|
|
.type(selectors.ticketsIndex.searchTicketInput, 'id:16')
|
|
|
|
.click(selectors.ticketsIndex.searchButton)
|
|
|
|
.waitForNumberOfElements(selectors.ticketsIndex.searchResult, 1)
|
|
|
|
.waitForTextInElement(selectors.ticketsIndex.searchResult, 'address 21')
|
|
|
|
.waitToClick(selectors.ticketsIndex.searchResult)
|
|
|
|
.waitToClick(selectors.ticketSales.saleButton)
|
|
|
|
.waitForURL('/sale')
|
|
|
|
.url()
|
|
|
|
.then(url => {
|
|
|
|
expect(url).toContain('/sale');
|
2018-10-22 15:12:41 +00:00
|
|
|
done();
|
|
|
|
}).catch(done.fail);
|
2018-09-10 11:38:14 +00:00
|
|
|
});
|
|
|
|
|
2018-10-22 15:12:41 +00:00
|
|
|
it(`should confirm the original ticket has only two lines now`, done => {
|
2018-09-10 11:38:14 +00:00
|
|
|
return nightmare
|
|
|
|
.wait(selectors.ticketSales.saleLine)
|
|
|
|
.countElement(selectors.ticketSales.saleLine)
|
|
|
|
.then(result => {
|
|
|
|
expect(result).toEqual(2);
|
2018-10-22 15:12:41 +00:00
|
|
|
done();
|
|
|
|
}).catch(done.fail);
|
2018-09-10 11:38:14 +00:00
|
|
|
});
|
|
|
|
|
2018-10-22 15:12:41 +00:00
|
|
|
it('should go back to the receiver ticket sales section', done => {
|
2018-09-10 11:38:14 +00:00
|
|
|
return nightmare
|
|
|
|
.waitToClick(selectors.itemsIndex.goBackToModuleIndexButton)
|
|
|
|
.wait(selectors.ticketsIndex.searchResult)
|
|
|
|
.type(selectors.ticketsIndex.searchTicketInput, 'id:12')
|
|
|
|
.click(selectors.ticketsIndex.searchButton)
|
|
|
|
.waitForNumberOfElements(selectors.ticketsIndex.searchResult, 1)
|
|
|
|
.waitForTextInElement(selectors.ticketsIndex.searchResult, 'address 21')
|
|
|
|
.waitToClick(selectors.ticketsIndex.searchResult)
|
|
|
|
.waitToClick(selectors.ticketSales.saleButton)
|
|
|
|
.waitForURL('/sale')
|
|
|
|
.url()
|
|
|
|
.then(url => {
|
|
|
|
expect(url).toContain('/sale');
|
2018-10-22 15:12:41 +00:00
|
|
|
done();
|
|
|
|
}).catch(done.fail);
|
2018-09-10 11:38:14 +00:00
|
|
|
});
|
|
|
|
|
2018-10-22 15:12:41 +00:00
|
|
|
it('should transfer the sale back to the original ticket', done => {
|
2018-09-10 11:38:14 +00:00
|
|
|
return nightmare
|
|
|
|
.waitToClick(selectors.ticketSales.firstSaleCheckbox)
|
|
|
|
.waitToClick(selectors.ticketSales.transferSaleButton)
|
|
|
|
.wait(selectors.ticketSales.moveToTicketInput)
|
|
|
|
.type(selectors.ticketSales.moveToTicketInput, 16)
|
|
|
|
.waitToClick(selectors.ticketSales.moveToTicketButton)
|
|
|
|
.waitForURL('ticket/16/sale')
|
|
|
|
.url()
|
|
|
|
.then(result => {
|
|
|
|
expect(result).toContain(`ticket/16/sale`);
|
2018-10-22 15:12:41 +00:00
|
|
|
done();
|
|
|
|
}).catch(done.fail);
|
2018-09-10 11:38:14 +00:00
|
|
|
});
|
|
|
|
|
2018-10-22 15:12:41 +00:00
|
|
|
it('should confirm the original ticket received the line', done => {
|
2018-09-10 11:38:14 +00:00
|
|
|
return nightmare
|
|
|
|
.wait(selectors.ticketSales.saleLine)
|
|
|
|
.countElement(selectors.ticketSales.saleLine)
|
|
|
|
.then(result => {
|
|
|
|
expect(result).toEqual(3);
|
2018-10-22 15:12:41 +00:00
|
|
|
done();
|
|
|
|
}).catch(done.fail);
|
2018-09-10 11:38:14 +00:00
|
|
|
});
|
|
|
|
|
2018-10-22 15:12:41 +00:00
|
|
|
it('should select the second and third sale and tranfer them to a new ticket then get to the ticket index', done => {
|
2018-09-10 11:38:14 +00:00
|
|
|
return nightmare
|
|
|
|
.waitToClick(selectors.ticketSales.secondSaleCheckbox)
|
|
|
|
.waitToClick(selectors.ticketSales.thirdSaleCheckbox)
|
|
|
|
.waitToClick(selectors.ticketSales.transferSaleButton)
|
|
|
|
.waitToClick(selectors.ticketSales.moveToNewTicketButton)
|
|
|
|
.waitForLogin('salesPerson')
|
|
|
|
.waitToClick(selectors.globalItems.applicationsMenuButton)
|
|
|
|
.wait(selectors.globalItems.applicationsMenuVisible)
|
|
|
|
.waitToClick(selectors.globalItems.ticketsButton)
|
2018-10-20 10:07:48 +00:00
|
|
|
.wait(selectors.ticketsIndex.searchResult)
|
2018-09-10 11:38:14 +00:00
|
|
|
.parsedUrl()
|
|
|
|
.then(url => {
|
|
|
|
expect(url.hash).toEqual('#!/ticket/index');
|
2018-10-22 15:12:41 +00:00
|
|
|
done();
|
|
|
|
}).catch(done.fail);
|
2018-09-10 11:38:14 +00:00
|
|
|
});
|
|
|
|
|
2018-10-22 15:12:41 +00:00
|
|
|
it('should search for a specific created ticket', done => {
|
2018-09-10 11:38:14 +00:00
|
|
|
return nightmare
|
|
|
|
.wait(selectors.ticketsIndex.searchResult)
|
|
|
|
.type(selectors.ticketsIndex.searchTicketInput, 'id:22')
|
|
|
|
.click(selectors.ticketsIndex.searchButton)
|
|
|
|
.waitForNumberOfElements(selectors.ticketsIndex.searchResult, 1)
|
|
|
|
.countElement(selectors.ticketsIndex.searchResult)
|
|
|
|
.then(result => {
|
|
|
|
expect(result).toEqual(1);
|
2018-10-22 15:12:41 +00:00
|
|
|
done();
|
|
|
|
}).catch(done.fail);
|
2018-09-10 11:38:14 +00:00
|
|
|
});
|
|
|
|
|
2018-10-22 15:12:41 +00:00
|
|
|
it(`should click on the search result to access to the ticket Sale`, done => {
|
2018-09-10 11:38:14 +00:00
|
|
|
return nightmare
|
|
|
|
.waitForTextInElement(selectors.ticketsIndex.searchResult, 'address 21')
|
|
|
|
.waitToClick(selectors.ticketsIndex.searchResult)
|
|
|
|
.waitToClick(selectors.ticketSales.saleButton)
|
|
|
|
.waitForURL('/sale')
|
|
|
|
.url()
|
|
|
|
.then(url => {
|
|
|
|
expect(url).toContain('/sale');
|
2018-10-22 15:12:41 +00:00
|
|
|
done();
|
|
|
|
}).catch(done.fail);
|
2018-09-10 11:38:14 +00:00
|
|
|
});
|
|
|
|
|
2018-10-22 15:12:41 +00:00
|
|
|
it('should confirm the new ticket received both lines', done => {
|
2018-09-10 11:38:14 +00:00
|
|
|
return nightmare
|
|
|
|
.countElement(selectors.ticketSales.saleLine)
|
|
|
|
.then(result => {
|
|
|
|
expect(result).toEqual(2);
|
2018-10-22 15:12:41 +00:00
|
|
|
done();
|
|
|
|
}).catch(done.fail);
|
2018-09-10 11:38:14 +00:00
|
|
|
});
|
|
|
|
|
2018-10-22 15:12:41 +00:00
|
|
|
it('should check the first sale reserved icon isnt visible', done => {
|
2018-09-10 11:38:14 +00:00
|
|
|
return nightmare
|
|
|
|
.isVisible(selectors.ticketSales.firstSaleReservedIcon)
|
|
|
|
.then(result => {
|
|
|
|
expect(result).toBeFalsy();
|
2018-10-22 15:12:41 +00:00
|
|
|
done();
|
|
|
|
}).catch(done.fail);
|
2018-09-10 11:38:14 +00:00
|
|
|
});
|
|
|
|
|
2018-10-22 15:12:41 +00:00
|
|
|
it('should mark the first sale as reserved', done => {
|
2018-09-10 11:38:14 +00:00
|
|
|
return nightmare
|
|
|
|
.waitToClick(selectors.ticketSales.firstSaleCheckbox)
|
|
|
|
.waitToClick(selectors.ticketSales.moreMenuButton)
|
|
|
|
.waitToClick(selectors.ticketSales.moreMenuReseveOption)
|
|
|
|
.waitForClassNotPresent(selectors.ticketSales.firstSaleReservedIcon, 'ng-hide')
|
|
|
|
.isVisible(selectors.ticketSales.firstSaleReservedIcon)
|
|
|
|
.then(result => {
|
|
|
|
expect(result).toBeTruthy();
|
2018-10-22 15:12:41 +00:00
|
|
|
done();
|
|
|
|
}).catch(done.fail);
|
2018-09-10 11:38:14 +00:00
|
|
|
});
|
|
|
|
|
2018-10-22 15:12:41 +00:00
|
|
|
it('should unmark the first sale as reserved', done => {
|
2018-09-10 11:38:14 +00:00
|
|
|
return nightmare
|
|
|
|
.waitToClick(selectors.ticketSales.firstSaleCheckbox)
|
|
|
|
.waitToClick(selectors.ticketSales.moreMenuButton)
|
|
|
|
.waitToClick(selectors.ticketSales.moreMenuUnmarkResevedOption)
|
|
|
|
.waitForClassPresent(selectors.ticketSales.firstSaleReservedIcon, 'ng-hide')
|
|
|
|
.isVisible(selectors.ticketSales.firstSaleReservedIcon)
|
|
|
|
.then(result => {
|
|
|
|
expect(result).toBeFalsy();
|
2018-10-22 15:12:41 +00:00
|
|
|
done();
|
|
|
|
}).catch(done.fail);
|
|
|
|
});
|
|
|
|
|
|
|
|
// buged, somehow the update discount button doesn't seem to be present in the menu.
|
|
|
|
// it('should update all sales discount', done => {
|
|
|
|
// return nightmare
|
|
|
|
// .waitToClick(selectors.ticketSales.selectAllSalesCheckbox)
|
|
|
|
// .waitToClick(selectors.ticketSales.moreMenuButton)
|
|
|
|
// .waitToClick(selectors.ticketSales.moreMenuUpdateDiscount)
|
|
|
|
// .wait(selectors.ticketSales.moreMenuUpdateDiscountInput)
|
|
|
|
// .type(selectors.ticketSales.moreMenuUpdateDiscountInput, 100)
|
|
|
|
// .type('body', '\u000d') // simulates enter
|
|
|
|
// .waitForTextInElement(selectors.ticketSales.totalImport, '0.00')
|
|
|
|
// .getInnerText(selectors.ticketSales.totalImport)
|
|
|
|
// .then(result => {
|
|
|
|
// expect(result).toContain('0.00');
|
|
|
|
// done();
|
|
|
|
// }).catch(done.fail);
|
|
|
|
// });
|
|
|
|
|
|
|
|
it('should log in as Production role and go to the ticket index', done => {
|
2018-09-10 11:38:14 +00:00
|
|
|
return nightmare
|
|
|
|
.waitToClick(selectors.globalItems.logOutButton)
|
|
|
|
.waitForLogin('production')
|
|
|
|
.waitToClick(selectors.globalItems.applicationsMenuButton)
|
|
|
|
.wait(selectors.globalItems.applicationsMenuVisible)
|
|
|
|
.waitToClick(selectors.globalItems.ticketsButton)
|
2018-10-20 10:07:48 +00:00
|
|
|
.wait(selectors.ticketsIndex.searchResult)
|
2018-09-10 11:38:14 +00:00
|
|
|
.parsedUrl()
|
|
|
|
.then(url => {
|
|
|
|
expect(url.hash).toEqual('#!/ticket/index');
|
2018-10-22 15:12:41 +00:00
|
|
|
done();
|
|
|
|
}).catch(done.fail);
|
2018-09-10 11:38:14 +00:00
|
|
|
});
|
|
|
|
|
2018-10-22 15:12:41 +00:00
|
|
|
it('should now search for a specific ticket', done => {
|
2018-09-10 11:38:14 +00:00
|
|
|
return nightmare
|
|
|
|
.wait(selectors.ticketsIndex.searchResult)
|
|
|
|
.type(selectors.ticketsIndex.searchTicketInput, 'id:16')
|
|
|
|
.click(selectors.ticketsIndex.searchButton)
|
|
|
|
.waitForNumberOfElements(selectors.ticketsIndex.searchResult, 1)
|
|
|
|
.countElement(selectors.ticketsIndex.searchResult)
|
|
|
|
.then(result => {
|
|
|
|
expect(result).toEqual(1);
|
2018-10-22 15:12:41 +00:00
|
|
|
done();
|
|
|
|
}).catch(done.fail);
|
2018-09-10 11:38:14 +00:00
|
|
|
});
|
|
|
|
|
2018-10-22 15:12:41 +00:00
|
|
|
it(`should now click on the search result to access to the ticket Tracking`, done => {
|
2018-09-10 11:38:14 +00:00
|
|
|
return nightmare
|
|
|
|
.waitForTextInElement(selectors.ticketsIndex.searchResult, 'address 21')
|
|
|
|
.waitToClick(selectors.ticketsIndex.searchResult)
|
|
|
|
.waitToClick(selectors.ticketTracking.trackingButton)
|
|
|
|
.waitForURL('/tracking/index')
|
|
|
|
.url()
|
|
|
|
.then(url => {
|
|
|
|
expect(url).toContain('/tracking/index');
|
2018-10-22 15:12:41 +00:00
|
|
|
done();
|
|
|
|
}).catch(done.fail);
|
2018-09-10 11:38:14 +00:00
|
|
|
});
|
|
|
|
|
2018-10-22 15:12:41 +00:00
|
|
|
it(`should click on the edit ticket tracking state button`, done => {
|
2018-09-10 11:38:14 +00:00
|
|
|
return nightmare
|
|
|
|
.waitToClick(selectors.ticketTracking.createStateButton)
|
|
|
|
.waitForURL('/tracking/edit')
|
|
|
|
.url()
|
|
|
|
.then(url => {
|
|
|
|
expect(url).toContain('/tracking/edit');
|
2018-10-22 15:12:41 +00:00
|
|
|
done();
|
|
|
|
}).catch(done.fail);
|
2018-09-10 11:38:14 +00:00
|
|
|
});
|
|
|
|
|
2018-10-22 15:12:41 +00:00
|
|
|
it(`should set the state of the ticket to preparation`, done => {
|
2018-09-10 11:38:14 +00:00
|
|
|
return nightmare
|
|
|
|
.waitToClick(selectors.ticketTracking.stateSelect)
|
|
|
|
.wait(selectors.ticketTracking.stateSelectInput)
|
|
|
|
.type(selectors.ticketTracking.stateSelectInput, 'Preparación')
|
|
|
|
.waitToClick(selectors.ticketTracking.stateSelectFirstResult)
|
|
|
|
.waitForTextInInput(selectors.ticketTracking.stateSelectInput, 'Preparación')
|
|
|
|
.click(selectors.ticketTracking.saveButton)
|
|
|
|
.waitForURL('/tracking/index')
|
|
|
|
.url()
|
|
|
|
.then(url => {
|
|
|
|
expect(url).toContain('/tracking/index');
|
2018-10-22 15:12:41 +00:00
|
|
|
done();
|
|
|
|
}).catch(done.fail);
|
2018-09-10 11:38:14 +00:00
|
|
|
});
|
|
|
|
|
2018-10-22 15:12:41 +00:00
|
|
|
it(`should click on the ticket Sale menu button`, done => {
|
2018-09-10 11:38:14 +00:00
|
|
|
return nightmare
|
|
|
|
.waitToClick(selectors.ticketSales.saleButton)
|
|
|
|
.waitForURL('/sale')
|
|
|
|
.url()
|
|
|
|
.then(url => {
|
|
|
|
expect(url).toContain('/sale');
|
2018-10-22 15:12:41 +00:00
|
|
|
done();
|
|
|
|
}).catch(done.fail);
|
2018-09-10 11:38:14 +00:00
|
|
|
});
|
|
|
|
|
|
|
|
describe('when state is preparation and loged as Production', () => {
|
2018-10-22 15:12:41 +00:00
|
|
|
it(`should not be able to edit the sale price`, done => {
|
2018-09-10 11:38:14 +00:00
|
|
|
return nightmare
|
|
|
|
.waitToClick(selectors.ticketSales.firstSalePrice)
|
|
|
|
.exists(selectors.ticketSales.firstSalePriceInput)
|
|
|
|
.then(result => {
|
|
|
|
expect(result).toBeFalsy();
|
2018-10-22 15:12:41 +00:00
|
|
|
done();
|
|
|
|
}).catch(done.fail);
|
2018-09-10 11:38:14 +00:00
|
|
|
});
|
|
|
|
|
2018-10-22 15:12:41 +00:00
|
|
|
it(`should not be able to edit the sale discount`, done => {
|
2018-09-10 11:38:14 +00:00
|
|
|
return nightmare
|
|
|
|
.waitToClick(selectors.ticketSales.firstSaleDiscount)
|
|
|
|
.exists(selectors.ticketSales.firstSaleDiscountInput)
|
|
|
|
.then(result => {
|
|
|
|
expect(result).toBeFalsy();
|
2018-10-22 15:12:41 +00:00
|
|
|
done();
|
|
|
|
}).catch(done.fail);
|
2018-09-10 11:38:14 +00:00
|
|
|
});
|
|
|
|
|
2018-10-22 15:12:41 +00:00
|
|
|
it(`should not be able to edit the sale state`, done => {
|
2018-09-10 11:38:14 +00:00
|
|
|
return nightmare
|
|
|
|
.waitToClick(selectors.ticketSales.stateMenuButton)
|
|
|
|
.exists(selectors.ticketSales.stateMenuOptions)
|
|
|
|
.then(result => {
|
|
|
|
expect(result).toBeFalsy();
|
2018-10-22 15:12:41 +00:00
|
|
|
done();
|
|
|
|
}).catch(done.fail);
|
2018-09-10 11:38:14 +00:00
|
|
|
});
|
|
|
|
|
2018-10-22 15:12:41 +00:00
|
|
|
it('should log in as salesPerson role and go to the ticket index', done => {
|
2018-09-10 11:38:14 +00:00
|
|
|
return nightmare
|
|
|
|
.waitToClick(selectors.globalItems.logOutButton)
|
|
|
|
.waitForLogin('salesPerson')
|
|
|
|
.waitToClick(selectors.globalItems.applicationsMenuButton)
|
|
|
|
.wait(selectors.globalItems.applicationsMenuVisible)
|
|
|
|
.waitToClick(selectors.globalItems.ticketsButton)
|
2018-10-20 10:07:48 +00:00
|
|
|
.wait(selectors.ticketsIndex.searchResult)
|
2018-09-10 11:38:14 +00:00
|
|
|
.parsedUrl()
|
|
|
|
.then(url => {
|
|
|
|
expect(url.hash).toEqual('#!/ticket/index');
|
2018-10-22 15:12:41 +00:00
|
|
|
done();
|
|
|
|
}).catch(done.fail);
|
2018-09-10 11:38:14 +00:00
|
|
|
});
|
|
|
|
|
2018-10-22 15:12:41 +00:00
|
|
|
it('should again search for a specific ticket', done => {
|
2018-09-10 11:38:14 +00:00
|
|
|
return nightmare
|
|
|
|
.wait(selectors.ticketsIndex.searchResult)
|
|
|
|
.type(selectors.ticketsIndex.searchTicketInput, 'id:16')
|
|
|
|
.click(selectors.ticketsIndex.searchButton)
|
|
|
|
.waitForNumberOfElements(selectors.ticketsIndex.searchResult, 1)
|
|
|
|
.countElement(selectors.ticketsIndex.searchResult)
|
|
|
|
.then(result => {
|
|
|
|
expect(result).toEqual(1);
|
2018-10-22 15:12:41 +00:00
|
|
|
done();
|
|
|
|
}).catch(done.fail);
|
2018-09-10 11:38:14 +00:00
|
|
|
});
|
|
|
|
|
2018-10-22 15:12:41 +00:00
|
|
|
it(`should again click on the search result to access to the ticket Sales`, done => {
|
2018-09-10 11:38:14 +00:00
|
|
|
return nightmare
|
|
|
|
.waitForTextInElement(selectors.ticketsIndex.searchResult, 'address 21')
|
|
|
|
.waitToClick(selectors.ticketsIndex.searchResult)
|
|
|
|
.waitToClick(selectors.ticketSales.saleButton)
|
|
|
|
.waitForURL('/sale')
|
|
|
|
.url()
|
|
|
|
.then(url => {
|
|
|
|
expect(url).toContain('/sale');
|
2018-10-22 15:12:41 +00:00
|
|
|
done();
|
|
|
|
}).catch(done.fail);
|
2018-09-10 11:38:14 +00:00
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
describe('when state is preparation and loged as salesPerson', () => {
|
2018-10-22 15:12:41 +00:00
|
|
|
it(`shouldnt be able to edit the sale price`, done => {
|
2018-09-10 11:38:14 +00:00
|
|
|
return nightmare
|
|
|
|
.waitToClick(selectors.ticketSales.firstSalePrice)
|
|
|
|
.exists(selectors.ticketSales.firstSalePriceInput)
|
|
|
|
.then(result => {
|
|
|
|
expect(result).toBeFalsy();
|
2018-10-22 15:12:41 +00:00
|
|
|
done();
|
|
|
|
}).catch(done.fail);
|
2018-09-10 11:38:14 +00:00
|
|
|
});
|
|
|
|
|
2018-10-22 15:12:41 +00:00
|
|
|
it(`shouldnt be able to edit the sale discount`, done => {
|
2018-09-10 11:38:14 +00:00
|
|
|
return nightmare
|
|
|
|
.waitToClick(selectors.ticketSales.firstSaleDiscount)
|
|
|
|
.exists(selectors.ticketSales.firstSaleDiscountInput)
|
|
|
|
.then(result => {
|
|
|
|
expect(result).toBeFalsy();
|
2018-10-22 15:12:41 +00:00
|
|
|
done();
|
|
|
|
}).catch(done.fail);
|
2018-09-10 11:38:14 +00:00
|
|
|
});
|
|
|
|
|
2018-10-22 15:12:41 +00:00
|
|
|
it(`shouldnt be able to edit the sale state`, done => {
|
2018-09-10 11:38:14 +00:00
|
|
|
return nightmare
|
|
|
|
.waitToClick(selectors.ticketSales.stateMenuButton)
|
|
|
|
.exists(selectors.ticketSales.stateMenuOptions)
|
|
|
|
.then(result => {
|
|
|
|
expect(result).toBeFalsy();
|
2018-10-22 15:12:41 +00:00
|
|
|
done();
|
|
|
|
}).catch(done.fail);
|
2018-09-10 11:38:14 +00:00
|
|
|
});
|
|
|
|
|
2018-10-22 15:12:41 +00:00
|
|
|
it('should go to another ticket sales section', done => {
|
2018-09-12 13:38:08 +00:00
|
|
|
return nightmare
|
|
|
|
.waitToClick(selectors.itemsIndex.goBackToModuleIndexButton)
|
|
|
|
.wait(selectors.ticketsIndex.searchResult)
|
|
|
|
.type(selectors.ticketsIndex.searchTicketInput, 'id:17')
|
|
|
|
.click(selectors.ticketsIndex.searchButton)
|
|
|
|
.waitForNumberOfElements(selectors.ticketsIndex.searchResult, 1)
|
|
|
|
.waitForTextInElement(selectors.ticketsIndex.searchResult, 'address 26')
|
|
|
|
.waitToClick(selectors.ticketsIndex.searchResult)
|
|
|
|
.waitToClick(selectors.ticketSales.saleButton)
|
|
|
|
.waitForURL('/sale')
|
|
|
|
.url()
|
|
|
|
.then(url => {
|
|
|
|
expect(url).toContain('/sale');
|
2018-10-22 15:12:41 +00:00
|
|
|
done();
|
|
|
|
}).catch(done.fail);
|
2018-09-12 13:38:08 +00:00
|
|
|
});
|
|
|
|
|
2018-10-22 15:12:41 +00:00
|
|
|
it(`should be able to delete the ticket`, done => {
|
2018-09-12 13:38:08 +00:00
|
|
|
return nightmare
|
|
|
|
.waitToClick(selectors.ticketSales.moreMenuButton)
|
|
|
|
.waitToClick(selectors.ticketSales.moreMenuDeleteOption)
|
|
|
|
.waitToClick(selectors.ticketSales.acceptDeleteTicketButton)
|
|
|
|
.waitForURL('/ticket/index')
|
|
|
|
.url()
|
|
|
|
.then(url => {
|
|
|
|
expect(url).toContain('/ticket/index');
|
2018-10-22 15:12:41 +00:00
|
|
|
done();
|
|
|
|
}).catch(done.fail);
|
2018-09-12 13:38:08 +00:00
|
|
|
});
|
|
|
|
|
2018-10-22 15:12:41 +00:00
|
|
|
it(`should search for the deleted ticket`, done => {
|
2018-09-12 13:38:08 +00:00
|
|
|
return nightmare
|
|
|
|
.wait(selectors.ticketsIndex.searchResult)
|
|
|
|
.type(selectors.ticketsIndex.searchTicketInput, 'id:17')
|
|
|
|
.click(selectors.ticketsIndex.searchButton)
|
|
|
|
.waitForNumberOfElements(selectors.ticketsIndex.searchResult, 1)
|
|
|
|
.countElement(selectors.ticketsIndex.searchResult)
|
|
|
|
.then(result => {
|
|
|
|
expect(result).toEqual(1);
|
2018-10-22 15:12:41 +00:00
|
|
|
done();
|
|
|
|
}).catch(done.fail);
|
2018-09-12 13:38:08 +00:00
|
|
|
});
|
|
|
|
|
2018-10-22 15:12:41 +00:00
|
|
|
it(`should search for the deleted ticket`, done => {
|
2018-09-12 13:38:08 +00:00
|
|
|
return nightmare
|
|
|
|
.wait(selectors.ticketsIndex.searchResultDate)
|
|
|
|
.getInnerText(selectors.ticketsIndex.searchResultDate)
|
|
|
|
.then(result => {
|
|
|
|
expect(result).toContain(2000);
|
2018-10-22 15:12:41 +00:00
|
|
|
done();
|
|
|
|
}).catch(done.fail);
|
2018-09-10 11:38:14 +00:00
|
|
|
});
|
|
|
|
});
|
|
|
|
});
|