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

44 lines
1.3 KiB
JavaScript
Raw Normal View History

import getBrowser from '../../../helpers/puppeteer';
import selectors from '../../../helpers/selectors.js';
const $ = {
form: 'vn-worker-department-basic-data form',
};
2023-06-05 05:55:53 +00:00
describe('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();
});
2023-06-05 05:51:15 +00:00
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',
};
2023-06-05 06:29:56 +00:00
await page.fillForm($.form, values);
const formValues = await page.fetchForm($.form, Object.keys(values));
2023-06-05 06:29:56 +00:00
const message = await page.sendForm($.form, values);
expect(message.isSuccess).toBeTrue();
expect(formValues).toEqual(values);
});
});