2018-04-04 09:56:07 +00:00
|
|
|
import selectors from '../../helpers/selectors.js';
|
2018-10-24 08:57:14 +00:00
|
|
|
import createNightmare from '../../helpers/nightmare';
|
2018-04-04 09:56:07 +00:00
|
|
|
|
2019-06-19 07:03:45 +00:00
|
|
|
describe('Ticket List sale path', () => {
|
2018-09-11 13:09:15 +00:00
|
|
|
const nightmare = createNightmare();
|
2018-04-04 09:56:07 +00:00
|
|
|
|
2018-09-11 13:09:15 +00:00
|
|
|
beforeAll(() => {
|
|
|
|
return nightmare
|
2018-12-02 23:45:34 +00:00
|
|
|
.loginAndModule('employee', 'ticket')
|
2019-06-19 07:03:45 +00:00
|
|
|
.accessToSearchResult(12)
|
2018-12-02 23:45:34 +00:00
|
|
|
.accessToSection('ticket.card.sale');
|
2018-09-11 13:09:15 +00:00
|
|
|
});
|
2018-04-04 09:56:07 +00:00
|
|
|
|
2019-01-11 11:41:07 +00:00
|
|
|
it('should confirm the first ticket sale contains the colour', async() => {
|
2018-10-25 14:44:03 +00:00
|
|
|
const value = await nightmare
|
2018-11-22 14:44:33 +00:00
|
|
|
.waitToGetProperty(selectors.ticketSales.firstSaleColour, 'innerText');
|
2018-10-25 14:44:03 +00:00
|
|
|
|
2019-06-19 07:03:45 +00:00
|
|
|
expect(value).toContain('Black');
|
2018-09-11 13:09:15 +00:00
|
|
|
});
|
2018-04-04 09:56:07 +00:00
|
|
|
|
2019-01-11 11:41:07 +00:00
|
|
|
it('should confirm the first ticket sale contains the lenght', async() => {
|
2018-10-25 14:44:03 +00:00
|
|
|
const value = await nightmare
|
2018-11-22 14:44:33 +00:00
|
|
|
.waitToGetProperty(selectors.ticketSales.firstSaleText, 'innerText');
|
2018-10-25 14:44:03 +00:00
|
|
|
|
2019-06-14 10:27:41 +00:00
|
|
|
expect(value).toContain('1');
|
2018-09-11 13:09:15 +00:00
|
|
|
});
|
|
|
|
|
2019-01-11 11:41:07 +00:00
|
|
|
it('should confirm the first ticket sale contains the price', async() => {
|
2018-10-25 14:44:03 +00:00
|
|
|
const value = await nightmare
|
2018-11-22 14:44:33 +00:00
|
|
|
.waitToGetProperty(selectors.ticketSales.firstSalePrice, 'innerText');
|
2018-10-25 14:44:03 +00:00
|
|
|
|
2019-06-27 07:03:03 +00:00
|
|
|
expect(value).toContain('1.72');
|
2018-09-11 13:09:15 +00:00
|
|
|
});
|
|
|
|
|
2019-01-11 11:41:07 +00:00
|
|
|
it('should confirm the first ticket sale contains the discount', async() => {
|
2018-10-25 14:44:03 +00:00
|
|
|
const value = await nightmare
|
2018-11-22 14:44:33 +00:00
|
|
|
.waitToGetProperty(selectors.ticketSales.firstSaleDiscount, 'innerText');
|
2018-10-25 14:44:03 +00:00
|
|
|
|
|
|
|
expect(value).toContain('0 %');
|
2018-09-11 13:09:15 +00:00
|
|
|
});
|
|
|
|
|
2019-01-11 11:41:07 +00:00
|
|
|
it('should confirm the first ticket sale contains the total import', async() => {
|
2018-10-25 14:44:03 +00:00
|
|
|
const value = await nightmare
|
2018-11-22 14:44:33 +00:00
|
|
|
.waitToGetProperty(selectors.ticketSales.firstSaleImport, 'innerText');
|
2018-10-25 14:44:03 +00:00
|
|
|
|
2019-06-27 07:03:03 +00:00
|
|
|
expect(value).toContain('34.40');
|
2018-09-11 13:09:15 +00:00
|
|
|
});
|
|
|
|
|
2019-01-11 11:41:07 +00:00
|
|
|
it('should navigate to the catalog by pressing the new item button', async() => {
|
2018-11-15 13:15:34 +00:00
|
|
|
const url = await nightmare
|
|
|
|
.waitToClick(selectors.ticketSales.newItemButton)
|
|
|
|
.waitForURL('/catalog')
|
2018-11-22 14:44:33 +00:00
|
|
|
.parsedUrl();
|
2018-10-25 14:44:03 +00:00
|
|
|
|
2018-11-22 14:44:33 +00:00
|
|
|
expect(url.hash).toContain('/catalog');
|
2018-04-04 09:56:07 +00:00
|
|
|
});
|
|
|
|
});
|