salix/e2e/paths/03-worker-module/01_pbx.spec.js

34 lines
1.2 KiB
JavaScript
Raw Normal View History

2019-03-08 13:46:01 +00:00
import selectors from '../../helpers/selectors.js';
2020-01-09 12:07:16 +00:00
import openPage from '../../helpers/puppeteer';
2019-03-08 13:46:01 +00:00
2019-03-25 07:09:43 +00:00
describe('Worker pbx path', () => {
2020-01-09 12:07:16 +00:00
let page;
beforeAll(async() => {
page = await openPage();
await page.loginAndModule('hr', 'worker');
await page.accessToSearchResult('employee');
await page.accessToSection('worker.card.pbx');
});
2019-03-08 13:46:01 +00:00
2020-01-09 12:07:16 +00:00
afterAll(async() => {
page.close();
2019-03-08 13:46:01 +00:00
});
it('should receive an error when the extension exceeds 4 characters', async() => {
2020-01-09 12:07:16 +00:00
await page.write(selectors.workerPbx.extensionInput, '55555');
await page.waitToClick(selectors.workerPbx.saveButton);
const result = await page.waitForLastSnackbar();
2019-03-08 13:46:01 +00:00
expect(result).toEqual('Extension format is invalid');
2019-03-08 13:46:01 +00:00
});
it('should sucessfully save the changes', async() => {
2020-01-09 12:07:16 +00:00
await page.clearInput(selectors.workerPbx.extensionInput);
await page.write(selectors.workerPbx.extensionInput, '4444');
await page.waitToClick(selectors.workerPbx.saveButton);
const result = await page.waitForLastSnackbar();
2019-03-08 13:46:01 +00:00
2019-06-17 09:14:45 +00:00
expect(result).toEqual('Data saved! User must access web');
2019-03-08 13:46:01 +00:00
});
});