From 321aa827c2c0ca4549a42a0193979a42bc120d57 Mon Sep 17 00:00:00 2001 From: Carlos Jimenez Ruiz Date: Tue, 19 May 2020 11:49:09 +0200 Subject: [PATCH] created order.index showEmpty filter path --- e2e/helpers/selectors.js | 4 ++++ e2e/paths/07-order/05_index.spec.js | 34 +++++++++++++++++++++++++++++ 2 files changed, 38 insertions(+) create mode 100644 e2e/paths/07-order/05_index.spec.js diff --git a/e2e/helpers/selectors.js b/e2e/helpers/selectors.js index 58ecb9499..3e972516c 100644 --- a/e2e/helpers/selectors.js +++ b/e2e/helpers/selectors.js @@ -618,9 +618,13 @@ export default { }, ordersIndex: { searchResult: 'vn-order-index vn-card > vn-table > div > vn-tbody > a.vn-tr', + firstSearchResultTotal: 'vn-order-index vn-card > vn-table > div > vn-tbody vn-tr vn-td:nth-child(9)', searchResultDate: 'vn-order-index vn-table vn-tbody > a:nth-child(1) > vn-td:nth-child(4)', searchResultAddress: 'vn-order-index vn-table vn-tbody > a:nth-child(1) > vn-td:nth-child(6)', searchButton: 'vn-searchbar vn-icon[icon="search"]', + advancedSearchButton: 'vn-order-search-panel vn-submit[label="Search"]', + openAdvancedSearch: 'vn-searchbar vn-icon[icon="arrow_drop_down"]', + advancedSearchShowEmptyCheckbox: 'vn-order-search-panel vn-check[label="Show empty"]', createOrderButton: 'vn-float-button', }, orderDescriptor: { diff --git a/e2e/paths/07-order/05_index.spec.js b/e2e/paths/07-order/05_index.spec.js new file mode 100644 index 000000000..ef55051aa --- /dev/null +++ b/e2e/paths/07-order/05_index.spec.js @@ -0,0 +1,34 @@ +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(); + }); + + it(`should check the first search result doesn't contain a total of 0€`, async() => { + await page.waitToClick(selectors.ordersIndex.searchButton); + const result = await page.waitToGetProperty(selectors.ordersIndex.firstSearchResultTotal, 'innerText'); + + 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); + await page.waitForTextInElement(selectors.ordersIndex.firstSearchResultTotal, '0.00'); + const result = await page.waitToGetProperty(selectors.ordersIndex.firstSearchResultTotal, 'innerText'); + + expect(result).toContain('0.00'); + }); +});