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

33 lines
1.1 KiB
JavaScript
Raw Permalink Normal View History

2019-03-08 13:46:01 +00:00
import selectors from '../../helpers/selectors.js';
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', () => {
let browser;
2020-01-09 12:07:16 +00:00
let page;
beforeAll(async() => {
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() => {
await browser.close();
2019-03-08 13:46:01 +00:00
});
2022-12-28 12:06:00 +00:00
it('should receive an error when the extension exceeds 4 characters and then sucessfully save the changes', async() => {
2020-02-03 14:55:11 +00:00
await page.write(selectors.workerPbx.extension, '55555');
2022-12-28 12:06:00 +00:00
await page.click(selectors.workerPbx.saveButton);
let message = await page.waitForSnackbar();
2019-03-08 13:46:01 +00:00
2020-11-10 11:06:21 +00:00
expect(message.text).toContain('Extension format is invalid');
2019-03-08 13:46:01 +00:00
2022-12-28 12:06:00 +00:00
await page.overwrite(selectors.workerPbx.extension, '4444');
await page.click(selectors.workerPbx.saveButton);
message = await page.waitForSnackbar();
2019-03-08 13:46:01 +00:00
2020-11-10 11:06:21 +00:00
expect(message.text).toContain('Data saved! User must access web');
2019-03-08 13:46:01 +00:00
});
});