45 lines
1.7 KiB
JavaScript
45 lines
1.7 KiB
JavaScript
import selectors from '../../helpers/selectors';
|
|
import getBrowser from '../../helpers/puppeteer';
|
|
|
|
describe('Client Edit web access path', () => {
|
|
let browser;
|
|
let page;
|
|
beforeAll(async() => {
|
|
browser = await getBrowser();
|
|
page = browser.page;
|
|
await page.loginAndModule('employee', 'client');
|
|
await page.accessToSearchResult('Bruce Banner');
|
|
await page.accessToSection('client.card.webAccess');
|
|
});
|
|
|
|
afterAll(async() => {
|
|
await browser.close();
|
|
});
|
|
|
|
it(`should uncheck the Enable web access checkbox and update the name`, async() => {
|
|
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();
|
|
|
|
expect(result).toEqual('Data saved!');
|
|
});
|
|
|
|
it('should confirm web access is now unchecked', async() => {
|
|
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);
|
|
|
|
expect(result).toBe('unchecked');
|
|
});
|
|
|
|
it('should confirm web access name have been updated', async() => {
|
|
const result = await page.waitToGetProperty(`${selectors.clientWebAccess.userNameInput} input`, 'value');
|
|
|
|
expect(result).toEqual('Hulk');
|
|
});
|
|
});
|