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

34 lines
1.1 KiB
JavaScript
Raw Normal View History

2019-03-08 13:46:01 +00:00
import selectors from '../../helpers/selectors.js';
import createNightmare from '../../helpers/nightmare';
2019-03-25 07:09:43 +00:00
describe('Worker pbx path', () => {
2019-03-08 13:46:01 +00:00
const nightmare = createNightmare();
beforeAll(() => {
nightmare
.loginAndModule('hr', 'worker')
.accessToSearchResult('employee')
.accessToSection('worker.card.pbx');
});
it('should receive an error when the extension exceeds 4 characters', async() => {
const result = await nightmare
.write(selectors.workerPbx.extensionInput, 55555)
.waitToClick(selectors.workerPbx.saveButton)
.waitForLastSnackbar();
expect(result).toEqual('Extension format is invalid');
2019-03-08 13:46:01 +00:00
});
it('should sucessfully save the changes', async() => {
const result = await nightmare
.clearInput(selectors.workerPbx.extensionInput)
.write(selectors.workerPbx.extensionInput, 4444)
.waitToClick(selectors.workerPbx.saveButton)
.waitForLastSnackbar();
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
});
});