2023-06-02 12:44:56 +00:00
|
|
|
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', () => {
|
2023-06-02 12:44:56 +00:00
|
|
|
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() => {
|
2023-06-02 12:44:56 +00:00
|
|
|
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);
|
2023-06-02 12:44:56 +00:00
|
|
|
const formValues = await page.fetchForm($.form, Object.keys(values));
|
2023-06-05 06:29:56 +00:00
|
|
|
const message = await page.sendForm($.form, values);
|
2023-06-02 12:44:56 +00:00
|
|
|
|
|
|
|
expect(message.isSuccess).toBeTrue();
|
|
|
|
expect(formValues).toEqual(values);
|
|
|
|
});
|
|
|
|
});
|