Merge pull request '2194_e2e_order_index_empty_filter' (#262) from 2194_e2e_order_index_empty_filter into dev
gitea/salix/pipeline/head This commit looks good Details

Reviewed-by: Bernat Exposito <bernat@verdnatura.es>
This commit is contained in:
Bernat Exposito 2020-05-19 10:38:01 +00:00
commit bbe5436350
2 changed files with 38 additions and 0 deletions

View File

@ -618,9 +618,13 @@ export default {
}, },
ordersIndex: { ordersIndex: {
searchResult: 'vn-order-index vn-card > vn-table > div > vn-tbody > a.vn-tr', 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)', 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)', searchResultAddress: 'vn-order-index vn-table vn-tbody > a:nth-child(1) > vn-td:nth-child(6)',
searchButton: 'vn-searchbar vn-icon[icon="search"]', 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', createOrderButton: 'vn-float-button',
}, },
orderDescriptor: { orderDescriptor: {

View File

@ -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');
});
});