44 lines
1.3 KiB
JavaScript
44 lines
1.3 KiB
JavaScript
import getBrowser from '../../../helpers/puppeteer';
|
|
import selectors from '../../../helpers/selectors.js';
|
|
|
|
const $ = {
|
|
form: 'vn-worker-department-basic-data form',
|
|
};
|
|
|
|
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();
|
|
});
|
|
|
|
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',
|
|
};
|
|
|
|
await page.fillForm($.form, values);
|
|
const formValues = await page.fetchForm($.form, Object.keys(values));
|
|
const message = await page.sendForm($.form, values);
|
|
|
|
expect(message.isSuccess).toBeTrue();
|
|
expect(formValues).toEqual(values);
|
|
});
|
|
});
|