salix/e2e/paths/05-ticket-module/11_diary.spec.js

69 lines
2.5 KiB
JavaScript
Raw Normal View History

2018-11-16 11:03:52 +00:00
import selectors from '../../helpers/selectors.js';
import getBrowser from '../../helpers/puppeteer';
2018-11-16 11:03:52 +00:00
// #2026 Fallo en relocate de descriptor popover
xdescribe('Ticket diary path', () => {
let browser;
let page;
2018-11-16 11:03:52 +00:00
beforeAll(async() => {
browser = await getBrowser();
page = browser.page;
await page.loginAndModule('employee', 'ticket');
});
afterAll(async() => {
await browser.close();
2018-11-16 11:03:52 +00:00
});
2019-01-07 08:33:07 +00:00
it('should search for a specific ticket', async() => {
await page.write(selectors.ticketsIndex.searchTicketInput, '1');
await page.waitToClick(selectors.ticketsIndex.searchButton);
await page.waitForNumberOfElements(selectors.ticketsIndex.searchResult, 1);
const result = await page.countElement(selectors.ticketsIndex.searchResult);
2018-11-16 11:03:52 +00:00
expect(result).toEqual(1);
});
2019-01-07 08:33:07 +00:00
it(`should click on the search result to access to the ticket summary`, async() => {
await page.waitForTextInElement(selectors.ticketsIndex.searchResult, 'Bat cave');
await page.waitToClick(selectors.ticketsIndex.searchResult);
await page.waitForURL('/summary');
const url = await page.parsedUrl();
2018-11-16 11:03:52 +00:00
expect(url.hash).toContain('/summary');
2018-11-16 11:03:52 +00:00
});
2019-01-07 08:33:07 +00:00
it(`should navigate to the item diary from the 1st sale item id descriptor popover`, async() => {
await page.waitToClick(selectors.ticketSummary.firstSaleItemId);
await page.waitForTransitionEnd('.vn-popover');
await page.waitToClick(selectors.ticketSummary.popoverDiaryButton);
await page.waitForURL('/diary');
const url = await page.parsedUrl();
2018-11-16 11:03:52 +00:00
expect(url.hash).toContain('/diary');
});
2019-09-12 11:20:07 +00:00
it(`should check the second line id is marked as message`, async() => {
const result = await page
2019-06-19 07:03:45 +00:00
.waitToGetProperty(selectors.itemDiary.secondTicketId, 'className');
2018-11-16 11:03:52 +00:00
2019-09-12 11:20:07 +00:00
expect(result).toContain('message');
2018-11-16 11:03:52 +00:00
});
2019-09-12 11:20:07 +00:00
it(`should check the third line balance is marked as message`, async() => {
const result = await page
.waitToGetProperty(`${selectors.itemDiary.fourthBalance} > span`, 'className');
2018-11-16 11:03:52 +00:00
2019-09-12 11:20:07 +00:00
expect(result).toContain('message');
2018-11-16 11:03:52 +00:00
});
2019-01-07 08:33:07 +00:00
it(`should change to the warehouse two and check there are sales marked as negative balance`, async() => {
await page.autocompleteSearch(selectors.itemDiary.warehouseAutocomplete, 'Warehouse Two');
const result = await page
.waitToGetProperty(selectors.itemDiary.firstBalance, 'className');
2018-11-16 11:03:52 +00:00
expect(result).toContain('balance');
});
});