2018-11-16 11:03:52 +00:00
|
|
|
import selectors from '../../helpers/selectors.js';
|
2020-01-23 15:01:29 +00:00
|
|
|
import getBrowser from '../../helpers/puppeteer';
|
2018-11-16 11:03:52 +00:00
|
|
|
|
2020-01-23 15:01:29 +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
|
|
|
|
2020-01-23 15:01:29 +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');
|
2020-01-23 15:01:29 +00:00
|
|
|
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() => {
|
2020-01-23 15:01:29 +00:00
|
|
|
await page.waitForTextInElement(selectors.ticketsIndex.searchResult, 'Bat cave');
|
|
|
|
await page.waitToClick(selectors.ticketsIndex.searchResult);
|
2020-03-24 15:49:36 +00:00
|
|
|
let url = await page.expectURL('/summary'); // use waitForState instead
|
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() => {
|
2020-01-23 15:01:29 +00:00
|
|
|
await page.waitToClick(selectors.ticketSummary.firstSaleItemId);
|
|
|
|
await page.waitForTransitionEnd('.vn-popover');
|
|
|
|
await page.waitToClick(selectors.ticketSummary.popoverDiaryButton);
|
2020-03-24 15:49:36 +00:00
|
|
|
let url = await page.expectURL('/diary'); // use waitForState instead
|
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() => {
|
2020-01-23 15:01:29 +00:00
|
|
|
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() => {
|
2020-01-23 15:01:29 +00:00
|
|
|
const result = await page
|
2019-07-01 09:56:16 +00:00
|
|
|
.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');
|
2020-01-23 15:01:29 +00:00
|
|
|
const result = await page
|
2018-11-22 11:34:20 +00:00
|
|
|
.waitToGetProperty(selectors.itemDiary.firstBalance, 'className');
|
2018-11-16 11:03:52 +00:00
|
|
|
|
|
|
|
expect(result).toContain('balance');
|
|
|
|
});
|
|
|
|
});
|