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() => {
|
|
|
|
await page.autocompleteSearch(selectors.accountAcl.role, 'trainee');
|
2022-05-18 12:01:30 +00:00
|
|
|
await page.autocompleteSearch(selectors.accountAcl.model, 'Campaign');
|
2022-05-17 13:19:54 +00:00
|
|
|
await page.autocompleteSearch(selectors.accountAcl.accessType, 'WRITE');
|
|
|
|
await page.autocompleteSearch(selectors.accountAcl.permission, 'DENY');
|
|
|
|
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-17 13:19:54 +00:00
|
|
|
await page.autocompleteSearch(selectors.accountAcl.model, 'AccessToken');
|
|
|
|
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() => {
|
|
|
|
const firstResult = await page.waitToGetProperty(selectors.accountAcl.thirdAcl, 'innerText');
|
|
|
|
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-18 12:01:30 +00:00
|
|
|
const newFirstResult = 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');
|
|
|
|
expect(firstResult).not.toEqual(newFirstResult);
|
2022-05-17 13:19:54 +00:00
|
|
|
});
|
|
|
|
});
|