2018-03-22 14:01:36 +00:00
|
|
|
import selectors from '../../helpers/selectors.js';
|
2020-01-23 15:01:29 +00:00
|
|
|
import getBrowser from '../../helpers/puppeteer';
|
2018-03-22 14:01:36 +00:00
|
|
|
|
2019-02-01 11:16:39 +00:00
|
|
|
describe('Ticket expeditions and log path', () => {
|
2020-01-23 15:01:29 +00:00
|
|
|
let browser;
|
|
|
|
let page;
|
2018-03-22 14:01:36 +00:00
|
|
|
|
2020-01-23 15:01:29 +00:00
|
|
|
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();
|
2018-12-19 07:42:07 +00:00
|
|
|
});
|
2018-03-22 14:01:36 +00:00
|
|
|
|
2019-01-07 08:33:07 +00:00
|
|
|
it(`should delete a former expedition and confirm the remaining expedition are the expected ones`, async() => {
|
2020-01-23 15:01:29 +00:00
|
|
|
await page.waitToClick(selectors.ticketExpedition.secondExpeditionRemoveButton);
|
2020-03-23 22:57:11 +00:00
|
|
|
await page.waitToClick(selectors.ticketExpedition.acceptDeleteRowButton);
|
2020-01-23 15:01:29 +00:00
|
|
|
await page.reloadSection('ticket.card.expedition');
|
2020-03-23 22:57:11 +00:00
|
|
|
|
2020-01-23 15:01:29 +00:00
|
|
|
await page.waitForSelector(selectors.ticketExpedition.expeditionRow, {});
|
|
|
|
const result = await page
|
2018-12-19 07:42:07 +00:00
|
|
|
.countElement(selectors.ticketExpedition.expeditionRow);
|
2018-10-29 08:21:33 +00:00
|
|
|
|
2019-06-27 11:20:30 +00:00
|
|
|
expect(result).toEqual(3);
|
2018-03-22 14:01:36 +00:00
|
|
|
});
|
2019-01-11 11:41:07 +00:00
|
|
|
|
|
|
|
it(`should confirm the expedition deleted is shown now in the ticket log`, async() => {
|
2020-04-02 09:39:39 +00:00
|
|
|
await page.accessToSection('ticket.card.log');
|
2020-01-23 15:01:29 +00:00
|
|
|
const changedBy = await page
|
2019-01-11 11:41:07 +00:00
|
|
|
.waitToGetProperty(selectors.ticketLog.changedBy, 'innerText');
|
2020-01-23 15:01:29 +00:00
|
|
|
|
|
|
|
const actionTaken = await page
|
2019-01-11 11:41:07 +00:00
|
|
|
.waitToGetProperty(selectors.ticketLog.actionTaken, 'innerText');
|
2020-01-23 15:01:29 +00:00
|
|
|
|
|
|
|
const id = await page
|
2019-01-11 11:41:07 +00:00
|
|
|
.waitToGetProperty(selectors.ticketLog.id, 'innerText');
|
|
|
|
|
|
|
|
expect(changedBy).toEqual('production');
|
|
|
|
expect(actionTaken).toEqual('Deletes');
|
2019-06-11 10:23:55 +00:00
|
|
|
expect(id).toEqual('2');
|
2019-01-11 11:41:07 +00:00
|
|
|
});
|
2018-03-22 14:01:36 +00:00
|
|
|
});
|