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

67 lines
2.4 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() => {
2020-02-03 14:55:11 +00:00
await page.write(selectors.ticketsIndex.topbarSearch, '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);
2020-02-04 15:21:10 +00:00
let url = await page.expectURL('/summary');
2018-11-16 11:03:52 +00:00
2020-02-04 15:21:10 +00:00
expect(url).toBe(true);
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);
2020-02-04 15:21:10 +00:00
let url = await page.expectURL('/diary');
2018-11-16 11:03:52 +00:00
2020-02-04 15:21:10 +00:00
expect(url).toBe(true);
2018-11-16 11:03:52 +00:00
});
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() => {
2020-02-03 14:55:11 +00:00
await page.autocompleteSearch(selectors.itemDiary.warehouse, 'Warehouse Two');
const result = await page
.waitToGetProperty(selectors.itemDiary.firstBalance, 'className');
2018-11-16 11:03:52 +00:00
expect(result).toContain('balance');
});
});