2019-03-08 13:46:01 +00:00
|
|
|
import selectors from '../../helpers/selectors.js';
|
2020-01-14 08:24:09 +00:00
|
|
|
import getBrowser from '../../helpers/puppeteer';
|
2019-03-08 13:46:01 +00:00
|
|
|
|
2020-01-14 08:57:57 +00:00
|
|
|
describe('Worker pbx path', () => {
|
2020-01-14 08:24:09 +00:00
|
|
|
let browser;
|
2020-01-09 12:07:16 +00:00
|
|
|
let page;
|
|
|
|
beforeAll(async() => {
|
2020-01-14 08:24:09 +00:00
|
|
|
browser = await getBrowser();
|
|
|
|
page = browser.page;
|
2020-01-09 12:07:16 +00:00
|
|
|
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() => {
|
2020-01-14 08:41:49 +00:00
|
|
|
await browser.close();
|
2019-03-08 13:46:01 +00:00
|
|
|
});
|
|
|
|
|
|
|
|
it('should receive an error when the extension exceeds 4 characters', async() => {
|
2020-02-03 14:55:11 +00:00
|
|
|
await page.write(selectors.workerPbx.extension, '55555');
|
2020-01-09 12:07:16 +00:00
|
|
|
await page.waitToClick(selectors.workerPbx.saveButton);
|
|
|
|
const result = await page.waitForLastSnackbar();
|
2019-03-08 13:46:01 +00:00
|
|
|
|
2019-06-11 10:23:55 +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-02-03 14:55:11 +00:00
|
|
|
await page.clearInput(selectors.workerPbx.extension);
|
|
|
|
await page.write(selectors.workerPbx.extension, '4444');
|
2020-01-09 12:07:16 +00:00
|
|
|
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
|
|
|
});
|
|
|
|
});
|