salix/e2e/paths/05-ticket/02_expeditions_and_log.spec.js

48 lines
1.7 KiB
JavaScript
Raw Normal View History

import selectors from '../../helpers/selectors.js';
import getBrowser from '../../helpers/puppeteer';
2019-02-01 11:16:39 +00:00
describe('Ticket expeditions and log path', () => {
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();
2018-12-19 07:42:07 +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() => {
await page.waitToClick(selectors.ticketExpedition.secondExpeditionRemoveButton);
await page.waitToClick(selectors.ticketExpedition.acceptDeleteRowButton);
await page.reloadSection('ticket.card.expedition');
await page.waitForSelector(selectors.ticketExpedition.expeditionRow, {});
const result = await page
2018-12-19 07:42:07 +00:00
.countElement(selectors.ticketExpedition.expeditionRow);
expect(result).toEqual(3);
});
2019-01-11 11:41:07 +00:00
it(`should confirm the expedition deleted is shown now in the ticket log`, async() => {
await page.accessToSection('ticket.card.log');
const changedBy = await page
2019-01-11 11:41:07 +00:00
.waitToGetProperty(selectors.ticketLog.changedBy, 'innerText');
const actionTaken = await page
2019-01-11 11:41:07 +00:00
.waitToGetProperty(selectors.ticketLog.actionTaken, 'innerText');
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');
expect(id).toEqual('2');
2019-01-11 11:41:07 +00:00
});
});