salix/e2e/paths/02-client-module/07_edit_web_access.spec.js

45 lines
1.7 KiB
JavaScript
Raw Normal View History

import selectors from '../../helpers/selectors';
import getBrowser from '../../helpers/puppeteer';
2017-12-15 09:07:52 +00:00
2018-11-20 13:22:00 +00:00
describe('Client Edit web access 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('Bruce Banner');
await page.accessToSection('client.card.webAccess');
});
2017-12-15 09:07:52 +00:00
2019-12-31 11:00:16 +00:00
afterAll(async() => {
browser.close();
2018-11-20 13:22:00 +00:00
});
2017-12-15 09:07:52 +00:00
2019-01-16 14:02:50 +00:00
it(`should uncheck the Enable web access checkbox and update the name`, async() => {
2019-12-31 11:00:16 +00:00
await page.waitToClick(selectors.clientWebAccess.enableWebAccessCheckbox);
await page.clearInput(selectors.clientWebAccess.userNameInput);
await page.write(selectors.clientWebAccess.userNameInput, 'Hulk');
await page.waitToClick(selectors.clientWebAccess.saveButton);
const result = await page.waitForLastSnackbar();
2018-10-30 07:51:18 +00:00
2018-11-20 13:22:00 +00:00
expect(result).toEqual('Data saved!');
});
2017-12-15 09:07:52 +00:00
2019-01-16 14:02:50 +00:00
it('should confirm web access is now unchecked', async() => {
2019-12-31 11:00:16 +00:00
await page.waitToClick(selectors.clientBasicData.basicDataButton);
await page.wait(selectors.clientBasicData.nameInput);
await page.waitToClick(selectors.clientsIndex.othersButton);
await page.waitToClick(selectors.clientWebAccess.webAccessButton);
const result = await page.checkboxState(selectors.clientWebAccess.enableWebAccessCheckbox);
2018-10-30 07:51:18 +00:00
expect(result).toBe('unchecked');
2018-11-20 13:22:00 +00:00
});
2018-04-05 07:43:37 +00:00
2019-01-16 14:02:50 +00:00
it('should confirm web access name have been updated', async() => {
const result = await page.waitToGetProperty(`${selectors.clientWebAccess.userNameInput} input`, 'value');
2018-10-30 07:51:18 +00:00
2018-11-20 13:22:00 +00:00
expect(result).toEqual('Hulk');
2017-12-15 09:07:52 +00:00
});
});