salix/e2e/paths/05-ticket-module/06_basic_data_steps.spec.js

51 lines
1.8 KiB
JavaScript
Raw Normal View History

2018-09-03 11:54:35 +00:00
import selectors from '../../helpers/selectors.js';
import createNightmare from '../../helpers/nightmare';
2018-09-03 11:54:35 +00:00
describe('Ticket Edit basic data path', () => {
const nightmare = createNightmare();
beforeAll(() => {
return nightmare
.loginAndModule('employee', 'ticket')
2019-05-30 12:42:54 +00:00
.accessToSearchResult(11)
.accessToSection('ticket.card.basicData.stepOne');
});
2019-01-07 09:55:23 +00:00
it(`should edit the ticket agency then click next`, async() => {
let url = await nightmare
2019-01-07 09:55:23 +00:00
.autocompleteSearch(selectors.ticketBasicData.agencyAutocomplete, 'Silla247Expensive')
2019-01-23 15:00:56 +00:00
.waitToClick(selectors.ticketBasicData.nextStepButton)
.waitForURL('data/step-two')
.parsedUrl();
expect(url.hash).toContain('data/step-two');
});
2019-01-07 09:55:23 +00:00
it(`should have a price diference`, async() => {
const result = await nightmare
2019-01-26 14:53:06 +00:00
.wait(1900)
.waitToGetProperty(selectors.ticketBasicData.stepTwoTotalPriceDif, 'innerText');
expect(result).toContain('-€13.95');
});
2019-01-07 09:55:23 +00:00
it(`should then click next to move on to step three`, async() => {
let url = await nightmare
2019-01-23 15:00:56 +00:00
.waitToClick(selectors.ticketBasicData.nextStepButton)
.waitForURL('data/step-three')
.parsedUrl();
expect(url.hash).toContain('data/step-three');
});
2019-01-07 09:55:23 +00:00
it(`should select a new reason for the changes made then click on finalize`, async() => {
let url = await nightmare
2019-01-07 09:55:23 +00:00
.autocompleteSearch(selectors.ticketBasicData.chargesReasonAutocomplete, 'Cambiar los precios en el ticket')
2019-01-23 15:00:56 +00:00
.waitToClick(selectors.ticketBasicData.finalizeButton)
.waitForURL('summary')
.parsedUrl();
expect(url.hash).toContain('summary');
2018-09-03 11:54:35 +00:00
});
});