salix/e2e/paths/05-ticket-module/03_sale.spec.js

58 lines
1.9 KiB
JavaScript

import selectors from '../../helpers/selectors.js';
import createNightmare from '../../helpers/nightmare';
describe('Ticket List sale path', () => {
const nightmare = createNightmare();
beforeAll(() => {
return nightmare
.loginAndModule('employee', 'ticket')
.accessToSearchResult(12)
.accessToSection('ticket.card.sale');
});
it('should confirm the first ticket sale contains the colour', async() => {
const value = await nightmare
.waitToGetProperty(selectors.ticketSales.firstSaleColour, 'innerText');
expect(value).toContain('Black');
});
it('should confirm the first ticket sale contains the lenght', async() => {
const value = await nightmare
.waitToGetProperty(selectors.ticketSales.firstSaleText, 'innerText');
expect(value).toContain('1');
});
it('should confirm the first ticket sale contains the price', async() => {
const value = await nightmare
.waitToGetProperty(selectors.ticketSales.firstSalePrice, 'innerText');
expect(value).toContain('1.72');
});
it('should confirm the first ticket sale contains the discount', async() => {
const value = await nightmare
.waitToGetProperty(selectors.ticketSales.firstSaleDiscount, 'innerText');
expect(value).toContain('0 %');
});
it('should confirm the first ticket sale contains the total import', async() => {
const value = await nightmare
.waitToGetProperty(selectors.ticketSales.firstSaleImport, 'innerText');
expect(value).toContain('34.40');
});
it('should navigate to the catalog by pressing the new item button', async() => {
const url = await nightmare
.waitToClick(selectors.ticketSales.newItemButton)
.waitForURL('/catalog')
.parsedUrl();
expect(url.hash).toContain('/catalog');
});
});