salix/e2e/paths/13-supplier/05_billing_data.spec.js

53 lines
1.8 KiB
JavaScript
Raw Normal View History

2020-12-16 15:16:56 +00:00
import selectors from '../../helpers/selectors.js';
import getBrowser from '../../helpers/puppeteer';
2020-12-17 11:29:37 +00:00
fdescribe('Supplier billing data path', () => {
2020-12-16 15:16:56 +00:00
let browser;
let page;
beforeAll(async() => {
browser = await getBrowser();
page = browser.page;
2020-12-17 11:29:37 +00:00
await page.loginAndModule('administrative', 'supplier');
2020-12-16 15:16:56 +00:00
await page.accessToSearchResult('442');
await page.accessToSection('supplier.card.billingData');
});
afterAll(async() => {
await browser.close();
});
2020-12-16 15:37:53 +00:00
it('should edit the billing data', async() => {
await page.autocompleteSearch(selectors.supplierBillingData.payMethod, 'PayMethod with IBAN');
await page.autocompleteSearch(selectors.supplierBillingData.payDem, '10');
await page.clearInput(selectors.supplierBillingData.payDay);
await page.write(selectors.supplierBillingData.payDay, '19');
await page.waitToClick(selectors.supplierBillingData.saveButton);
const message = await page.waitForSnackbar();
2020-12-16 15:16:56 +00:00
2020-12-16 15:37:53 +00:00
expect(message.text).toContain('Data saved!');
2020-12-16 15:16:56 +00:00
});
2020-12-16 15:37:53 +00:00
it('should reload the section', async() => {
await page.reloadSection('supplier.card.billingData');
});
2020-12-16 15:16:56 +00:00
2020-12-16 15:37:53 +00:00
it('should check the pay method was edited', async() => {
const result = await page.waitToGetProperty(selectors.supplierBillingData.payMethod, 'value');
2020-12-16 15:16:56 +00:00
2020-12-16 15:37:53 +00:00
expect(result).toEqual('PayMethod with IBAN');
});
2020-12-16 15:16:56 +00:00
2020-12-16 15:37:53 +00:00
it('should check the payDem was edited', async() => {
const result = await page.waitToGetProperty(selectors.supplierBillingData.payDem, 'value');
2020-12-16 15:16:56 +00:00
2020-12-16 15:37:53 +00:00
expect(result).toEqual('10');
});
2020-12-16 15:16:56 +00:00
2020-12-16 15:37:53 +00:00
it('should check the pay day was edited', async() => {
const result = await page.waitToGetProperty(selectors.supplierBillingData.payDay, 'value');
2020-12-16 15:16:56 +00:00
2020-12-16 15:37:53 +00:00
expect(result).toEqual('19');
});
2020-12-16 15:16:56 +00:00
});