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

53 lines
1.8 KiB
JavaScript

import selectors from '../../helpers/selectors.js';
import getBrowser from '../../helpers/puppeteer';
describe('Supplier billing data path', () => {
let browser;
let page;
beforeAll(async() => {
browser = await getBrowser();
page = browser.page;
await page.loginAndModule('administrative', 'supplier');
await page.accessToSearchResult('442');
await page.accessToSection('supplier.card.billingData');
});
afterAll(async() => {
await browser.close();
});
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();
expect(message.text).toContain('Data saved!');
});
it('should reload the section', async() => {
await page.reloadSection('supplier.card.billingData');
});
it('should check the pay method was edited', async() => {
const result = await page.waitToGetProperty(selectors.supplierBillingData.payMethod, 'value');
expect(result).toEqual('PayMethod with IBAN');
});
it('should check the payDem was edited', async() => {
const result = await page.waitToGetProperty(selectors.supplierBillingData.payDem, 'value');
expect(result).toEqual('10');
});
it('should check the pay day was edited', async() => {
const result = await page.waitToGetProperty(selectors.supplierBillingData.payDay, 'value');
expect(result).toEqual('19');
});
});