2022-05-17 13:19:54 +00:00
|
|
|
import selectors from '../../helpers/selectors.js';
|
|
|
|
import getBrowser from '../../helpers/puppeteer';
|
|
|
|
|
2022-05-18 12:01:30 +00:00
|
|
|
describe('Account ACL path', () => {
|
2022-05-17 13:19:54 +00:00
|
|
|
let browser;
|
|
|
|
let page;
|
|
|
|
|
|
|
|
beforeAll(async() => {
|
|
|
|
browser = await getBrowser();
|
|
|
|
page = browser.page;
|
2022-05-18 12:01:30 +00:00
|
|
|
await page.loginAndModule('developer', 'account');
|
2022-05-17 13:19:54 +00:00
|
|
|
await page.accessToSection('account.acl');
|
|
|
|
});
|
|
|
|
|
|
|
|
afterAll(async() => {
|
|
|
|
await browser.close();
|
|
|
|
});
|
|
|
|
|
|
|
|
it('should go to create new acl', async() => {
|
|
|
|
await page.waitToClick(selectors.accountAcl.addAcl);
|
|
|
|
await page.waitForState('account.acl.create');
|
|
|
|
});
|
|
|
|
|
|
|
|
it('should create new acl', async() => {
|
2022-05-25 06:27:26 +00:00
|
|
|
await page.autocompleteSearch(selectors.accountAcl.role, 'sysadmin');
|
|
|
|
await page.autocompleteSearch(selectors.accountAcl.model, 'UserAccount');
|
|
|
|
await page.autocompleteSearch(selectors.accountAcl.accessType, '*');
|
|
|
|
await page.autocompleteSearch(selectors.accountAcl.permission, 'ALLOW');
|
2022-05-17 13:19:54 +00:00
|
|
|
await page.waitToClick(selectors.accountAcl.save);
|
|
|
|
const message = await page.waitForSnackbar();
|
|
|
|
|
|
|
|
expect(message.text).toContain('Data saved!');
|
|
|
|
});
|
|
|
|
|
|
|
|
it('should navigate to edit', async() => {
|
|
|
|
await page.doSearch();
|
2022-05-18 12:01:30 +00:00
|
|
|
await page.waitToClick(selectors.accountAcl.thirdAcl);
|
2022-05-17 13:19:54 +00:00
|
|
|
await page.waitForState('account.acl.edit');
|
|
|
|
});
|
|
|
|
|
2022-05-18 12:01:30 +00:00
|
|
|
it('should edit the third acl', async() => {
|
2022-05-25 06:27:26 +00:00
|
|
|
await page.autocompleteSearch(selectors.accountAcl.model, 'Supplier');
|
2022-05-17 13:19:54 +00:00
|
|
|
await page.autocompleteSearch(selectors.accountAcl.accessType, 'READ');
|
|
|
|
await page.waitToClick(selectors.accountAcl.save);
|
|
|
|
const message = await page.waitForSnackbar();
|
|
|
|
|
|
|
|
expect(message.text).toContain('Data saved!');
|
|
|
|
});
|
|
|
|
|
2022-05-18 12:01:30 +00:00
|
|
|
it('should delete the third result', async() => {
|
2022-05-25 06:27:26 +00:00
|
|
|
const result = await page.waitToGetProperty(selectors.accountAcl.thirdAcl, 'innerText');
|
2022-05-18 12:01:30 +00:00
|
|
|
await page.waitToClick(selectors.accountAcl.deleteThirdAcl);
|
|
|
|
await page.waitToClick(selectors.globalItems.acceptButton);
|
2022-05-17 13:19:54 +00:00
|
|
|
const message = await page.waitForSnackbar();
|
2022-05-25 06:27:26 +00:00
|
|
|
const newResult = await page.waitToGetProperty(selectors.accountAcl.thirdAcl, 'innerText');
|
2022-05-17 13:19:54 +00:00
|
|
|
|
2022-05-18 12:01:30 +00:00
|
|
|
expect(message.text).toContain('ACL removed');
|
2022-05-25 06:27:26 +00:00
|
|
|
expect(result).not.toEqual(newResult);
|
2022-05-17 13:19:54 +00:00
|
|
|
});
|
|
|
|
});
|