salix/e2e/paths/client-module/13_log.spec.js

48 lines
1.7 KiB
JavaScript
Raw Normal View History

2018-10-30 09:22:47 +00:00
import selectors from '../../helpers/selectors.js';
import createNightmare from '../../helpers/nightmare';
describe('Client log path', () => {
const nightmare = createNightmare();
beforeAll(() => {
2018-11-20 13:22:00 +00:00
nightmare
.loginAndModule('employee', 'client')
.accessToSearchResult('DavidCharlesHaller')
.accessToSection('client.card.basicData');
2018-10-30 09:22:47 +00:00
});
2019-01-11 11:41:07 +00:00
it('should update the clients name', async() => {
2018-10-30 09:22:47 +00:00
let result = await nightmare
.wait(selectors.clientBasicData.nameInput)
.clearInput(selectors.clientBasicData.nameInput)
.type(selectors.clientBasicData.nameInput, 'this is a test')
.waitToClick(selectors.clientBasicData.saveButton)
.waitForLastSnackbar();
expect(result).toEqual('Data saved!');
});
2019-01-11 11:41:07 +00:00
it('should navigate to the log section', async() => {
2018-10-30 09:22:47 +00:00
let url = await nightmare
.waitToClick(selectors.clientLog.logButton)
.waitForURL('log')
.parsedUrl();
expect(url.hash).toContain('log');
});
2019-01-11 11:41:07 +00:00
it('should check the previous value of the last logged change', async() => {
2018-10-30 09:22:47 +00:00
let lastModificationPreviousValue = await nightmare
.waitToGetProperty(selectors.clientLog.lastModificationPreviousValue, 'innerText');
2018-10-30 09:22:47 +00:00
expect(lastModificationPreviousValue).toContain('DavidCharlesHaller');
});
2019-01-11 11:41:07 +00:00
it('should check the current value of the last logged change', async() => {
2018-10-30 09:22:47 +00:00
let lastModificationCurrentValue = await nightmare
.waitToGetProperty(selectors.clientLog.lastModificationCurrentValue, 'innerText');
2018-10-30 09:22:47 +00:00
expect(lastModificationCurrentValue).toContain('this is a test');
});
});