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

55 lines
2.0 KiB
JavaScript
Raw Normal View History

import selectors from '../../helpers/selectors';
import getBrowser from '../../helpers/puppeteer';
2018-10-30 09:22:47 +00:00
fdescribe('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() => {
2019-12-31 11:00:16 +00:00
await page.clearInput(selectors.clientBasicData.nameInput);
await page.write(selectors.clientBasicData.nameInput, 'this is a test');
await page.waitToClick(selectors.clientBasicData.saveButton);
let result = await page.waitForLastSnackbar();
2018-10-30 09:22:47 +00:00
expect(result).toEqual('Data saved!');
});
2019-01-11 11:41:07 +00:00
it('should navigate to the log section', async() => {
2019-12-31 11:00:16 +00:00
await page.waitToClick(selectors.clientLog.logButton);
await page.waitForURL('log');
let url = await page.parsedUrl();
2018-10-30 09:22:47 +00:00
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() => {
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
});
});