2022-10-20 07:40:23 +00:00
|
|
|
import selectors from '../../helpers/selectors.js';
|
|
|
|
import getBrowser from '../../helpers/puppeteer';
|
|
|
|
|
2022-10-20 08:21:44 +00:00
|
|
|
describe('Ticket expeditions', () => {
|
2022-10-20 07:40:23 +00:00
|
|
|
let browser;
|
|
|
|
let page;
|
|
|
|
|
|
|
|
beforeAll(async() => {
|
|
|
|
browser = await getBrowser();
|
|
|
|
page = browser.page;
|
|
|
|
await page.loginAndModule('production', 'ticket');
|
|
|
|
await page.accessToSearchResult('1');
|
|
|
|
await page.accessToSection('ticket.card.expedition');
|
|
|
|
});
|
|
|
|
|
|
|
|
afterAll(async() => {
|
|
|
|
await browser.close();
|
|
|
|
});
|
|
|
|
|
|
|
|
it(`should move one expedition to new ticket withoute route`, async() => {
|
|
|
|
await page.waitToClick(selectors.ticketExpedition.thirdSaleCheckbox);
|
|
|
|
await page.waitToClick(selectors.ticketExpedition.moveExpeditionButton);
|
|
|
|
await page.waitToClick(selectors.ticketExpedition.moreMenuWithoutRoute);
|
|
|
|
await page.waitToClick(selectors.ticketExpedition.saveButton);
|
|
|
|
await page.waitForState('ticket.card.summary');
|
|
|
|
await page.accessToSection('ticket.card.expedition');
|
|
|
|
|
|
|
|
await page.waitForSelector(selectors.ticketExpedition.expeditionRow, {});
|
|
|
|
const result = await page
|
|
|
|
.countElement(selectors.ticketExpedition.expeditionRow);
|
|
|
|
|
|
|
|
expect(result).toEqual(1);
|
|
|
|
});
|
|
|
|
|
|
|
|
it(`should move one expedition to new ticket with route`, async() => {
|
|
|
|
await page.waitToClick(selectors.ticketExpedition.firstSaleCheckbox);
|
|
|
|
await page.waitToClick(selectors.ticketExpedition.moveExpeditionButton);
|
|
|
|
await page.waitToClick(selectors.ticketExpedition.moreMenuWithRoute);
|
|
|
|
await page.write(selectors.ticketExpedition.newRouteId, '1');
|
|
|
|
await page.waitToClick(selectors.ticketExpedition.saveButton);
|
|
|
|
await page.waitForState('ticket.card.summary');
|
|
|
|
await page.accessToSection('ticket.card.expedition');
|
|
|
|
|
|
|
|
await page.waitForSelector(selectors.ticketExpedition.expeditionRow, {});
|
|
|
|
const result = await page
|
|
|
|
.countElement(selectors.ticketExpedition.expeditionRow);
|
|
|
|
|
|
|
|
expect(result).toEqual(1);
|
|
|
|
});
|
|
|
|
});
|