2020-03-03 09:26:16 +00:00
|
|
|
import selectors from '../../helpers/selectors.js';
|
|
|
|
import getBrowser from '../../helpers/puppeteer';
|
|
|
|
|
|
|
|
describe('Order summary path', () => {
|
|
|
|
let browser;
|
|
|
|
let page;
|
|
|
|
beforeAll(async() => {
|
|
|
|
browser = await getBrowser();
|
|
|
|
page = browser.page;
|
|
|
|
await page.loginAndModule('employee', 'order');
|
2020-07-02 05:46:55 +00:00
|
|
|
await page.waitFor(2000);
|
2020-03-03 09:26:16 +00:00
|
|
|
await page.accessToSearchResult('16');
|
|
|
|
});
|
|
|
|
|
|
|
|
afterAll(async() => {
|
|
|
|
await browser.close();
|
|
|
|
});
|
|
|
|
|
|
|
|
it('should reach the order summary section', async() => {
|
2020-03-24 15:49:36 +00:00
|
|
|
await page.waitForState('order.card.summary');
|
2020-03-03 09:26:16 +00:00
|
|
|
});
|
|
|
|
|
|
|
|
it('should check the summary contains the order id', async() => {
|
|
|
|
const result = await page.waitToGetProperty(selectors.orderSummary.id, 'innerText');
|
|
|
|
|
|
|
|
expect(result).toEqual('16');
|
|
|
|
});
|
|
|
|
|
|
|
|
it('should check the summary contains the order alias', async() => {
|
|
|
|
const result = await page.waitToGetProperty(selectors.orderSummary.alias, 'innerText');
|
|
|
|
|
2020-11-02 07:26:53 +00:00
|
|
|
expect(result).toEqual('Many places');
|
2020-03-03 09:26:16 +00:00
|
|
|
});
|
|
|
|
|
|
|
|
it('should check the summary contains the order consignee', async() => {
|
|
|
|
const result = await page.waitToGetProperty(selectors.orderSummary.consignee, 'innerText');
|
|
|
|
|
2020-11-02 07:26:53 +00:00
|
|
|
expect(result).toEqual('address 26 - Silla (Province one)');
|
2020-03-03 09:26:16 +00:00
|
|
|
});
|
|
|
|
|
|
|
|
it('should check the summary contains the order subtotal', async() => {
|
|
|
|
const result = await page.waitToGetProperty(selectors.orderSummary.subtotal, 'innerText');
|
|
|
|
|
|
|
|
expect(result.length).toBeGreaterThan(1);
|
|
|
|
});
|
|
|
|
|
|
|
|
it('should check the summary contains the order vat', async() => {
|
|
|
|
const result = await page.waitToGetProperty(selectors.orderSummary.vat, 'innerText');
|
|
|
|
|
|
|
|
expect(result.length).toBeGreaterThan(1);
|
|
|
|
});
|
|
|
|
|
|
|
|
it('should check the summary contains the order total', async() => {
|
|
|
|
const result = await page.waitToGetProperty(selectors.orderSummary.total, 'innerText');
|
|
|
|
|
|
|
|
expect(result.length).toBeGreaterThan(1);
|
|
|
|
});
|
|
|
|
|
|
|
|
it('should check the summary contains the order sales', async() => {
|
|
|
|
const result = await page.countElement(selectors.orderSummary.sale);
|
|
|
|
|
|
|
|
expect(result).toBeGreaterThan(0);
|
|
|
|
});
|
|
|
|
});
|