2020-05-19 09:49:09 +00:00
|
|
|
import selectors from '../../helpers/selectors.js';
|
|
|
|
import getBrowser from '../../helpers/puppeteer';
|
|
|
|
|
|
|
|
describe('Order Index', () => {
|
|
|
|
let browser;
|
|
|
|
let page;
|
|
|
|
|
|
|
|
beforeAll(async() => {
|
|
|
|
browser = await getBrowser();
|
|
|
|
page = browser.page;
|
|
|
|
await page.loginAndModule('employee', 'order');
|
|
|
|
});
|
|
|
|
|
|
|
|
afterAll(async() => {
|
|
|
|
await browser.close();
|
|
|
|
});
|
|
|
|
|
2020-07-06 08:20:45 +00:00
|
|
|
it(`should check the second search result doesn't contain a total of 0€`, async() => {
|
2020-10-01 06:53:31 +00:00
|
|
|
await page.waitToClick(selectors.globalItems.searchButton);
|
2020-07-06 08:20:45 +00:00
|
|
|
const result = await page.waitToGetProperty(selectors.ordersIndex.secondSearchResultTotal, 'innerText');
|
2020-05-19 09:49:09 +00:00
|
|
|
|
|
|
|
expect(result).not.toContain('0.00');
|
|
|
|
});
|
|
|
|
|
|
|
|
it('should search including empty orders', async() => {
|
|
|
|
await page.waitToClick(selectors.ordersIndex.openAdvancedSearch);
|
|
|
|
await page.waitToClick(selectors.ordersIndex.advancedSearchShowEmptyCheckbox);
|
|
|
|
await page.waitToClick(selectors.ordersIndex.advancedSearchButton);
|
2020-07-06 08:20:45 +00:00
|
|
|
await page.waitForTextInElement(selectors.ordersIndex.secondSearchResultTotal, '0.00');
|
|
|
|
const result = await page.waitToGetProperty(selectors.ordersIndex.secondSearchResultTotal, 'innerText');
|
2020-05-19 09:49:09 +00:00
|
|
|
|
|
|
|
expect(result).toContain('0.00');
|
|
|
|
});
|
|
|
|
});
|