salix/e2e/paths/03-worker/01-department/02-basicData.spec.js

45 lines
1.4 KiB
JavaScript

import getBrowser from '../../../helpers/puppeteer';
import selectors from '../../../helpers/selectors.js';
const $ = {
form: 'vn-worker-department-basic-data form',
};
fdescribe('department summary path', () => {
let browser;
let page;
beforeAll(async() => {
browser = await getBrowser();
page = browser.page;
await page.loginAndModule('hr', 'worker');
await page.accessToSection('worker.department');
await page.doSearch('INFORMATICA');
await page.click(selectors.department.firstDepartment);
});
beforeEach(async() => {
await page.accessToSection('worker.department.card.basicData');
});
afterAll(async() => {
await browser.close();
});
it(`should edit the department basic data and confirm the department data was edited`, async() => {
const values = {
Name: 'Informatica',
Code: 'IT',
Chat: 'informatica-cau',
Email: 'it@verdnatura.es',
};
const message = await page.sendForm($.form, values);
await page.reloadSection('worker.department.card.basicData');
const formValues = await page.fetchForm($.form, Object.keys(values));
await page.click(selectors.departmentBasicData.saveButton);
expect(message.isSuccess).toBeTrue();
expect(formValues).toEqual(values);
});
});