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

50 lines
1.8 KiB
JavaScript
Raw Normal View History

import selectors from '../../helpers/selectors';
import getBrowser from '../../helpers/puppeteer';
2018-10-30 09:22:47 +00:00
2020-01-30 10:23:13 +00:00
describe('Client log path', () => {
let browser;
2019-12-31 11:00:16 +00:00
let page;
beforeAll(async() => {
browser = await getBrowser();
page = browser.page;
2019-12-31 11:00:16 +00:00
await page.loginAndModule('employee', 'client');
await page.accessToSearchResult('DavidCharlesHaller');
await page.accessToSection('client.card.basicData');
});
2018-10-30 09:22:47 +00:00
2019-12-31 11:00:16 +00:00
afterAll(async() => {
await browser.close();
2018-10-30 09:22:47 +00:00
});
2019-01-11 11:41:07 +00:00
it('should update the clients name', async() => {
2020-02-03 14:55:11 +00:00
await page.clearInput(selectors.clientBasicData.name);
await page.write(selectors.clientBasicData.name, 'this is a test');
2019-12-31 11:00:16 +00:00
await page.waitToClick(selectors.clientBasicData.saveButton);
2020-04-08 09:24:40 +00:00
const message = await page.waitForSnackbar();
2018-10-30 09:22:47 +00:00
2020-10-30 16:09:11 +00:00
expect(message.text).toBe('Data saved!');
2018-10-30 09:22:47 +00:00
});
2019-01-11 11:41:07 +00:00
it('should navigate to the log section', async() => {
2020-04-02 16:55:07 +00:00
await page.accessToSection('client.card.log');
2018-10-30 09:22:47 +00:00
});
2019-01-11 11:41:07 +00:00
it('should check the previous value of the last logged change', async() => {
2019-12-31 11:00:16 +00:00
let lastModificationPreviousValue = await page
.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() => {
2019-12-31 11:00:16 +00:00
let lastModificationPreviousValue = await page
2019-03-01 12:56:17 +00:00
.waitToGetProperty(selectors.clientLog.lastModificationPreviousValue, 'innerText');
2019-12-31 11:00:16 +00:00
let lastModificationCurrentValue = await page.
waitToGetProperty(selectors.clientLog.lastModificationCurrentValue, 'innerText');
2018-10-30 09:22:47 +00:00
2019-03-01 12:56:17 +00:00
expect(lastModificationPreviousValue).toEqual('name: DavidCharlesHaller');
expect(lastModificationCurrentValue).toEqual('name: this is a test');
2018-10-30 09:22:47 +00:00
});
});