50 lines
1.5 KiB
JavaScript
50 lines
1.5 KiB
JavaScript
|
import selectors from '../../helpers/selectors.js';
|
||
|
import getBrowser from '../../helpers/puppeteer';
|
||
|
|
||
|
describe('Account Connections path', () => {
|
||
|
let browser;
|
||
|
let page;
|
||
|
|
||
|
beforeAll(async() => {
|
||
|
browser = await getBrowser();
|
||
|
page = browser.page;
|
||
|
await page.loginAndModule('sysadmin', 'account');
|
||
|
await page.accessToSection('account.accounts');
|
||
|
});
|
||
|
|
||
|
afterAll(async() => {
|
||
|
await browser.close();
|
||
|
});
|
||
|
|
||
|
it('should sync roles', async() => {
|
||
|
await page.waitToClick(selectors.accountAccounts.syncRoles);
|
||
|
const message = await page.waitForSnackbar();
|
||
|
|
||
|
expect(message.text).toContain('Roles synchronized!');
|
||
|
});
|
||
|
|
||
|
it('should sync user', async() => {
|
||
|
await page.waitToClick(selectors.accountAccounts.syncUser);
|
||
|
await page.write(selectors.accountAccounts.syncUserName, 'sysadmin');
|
||
|
await page.write(selectors.accountAccounts.syncUserPassword, 'nightmare');
|
||
|
|
||
|
await page.waitToClick(selectors.accountAccounts.buttonAccept);
|
||
|
|
||
|
const message = await page.waitForSnackbar();
|
||
|
|
||
|
expect(message.text).toContain('User synchronized!');
|
||
|
});
|
||
|
|
||
|
it('should relogin', async() => {
|
||
|
await page.loginAndModule('sysadmin', 'account');
|
||
|
await page.accessToSection('account.accounts');
|
||
|
});
|
||
|
|
||
|
it('should sync all', async() => {
|
||
|
await page.waitToClick(selectors.accountAccounts.syncAll);
|
||
|
const message = await page.waitForSnackbar();
|
||
|
|
||
|
expect(message.text).toContain('Synchronizing in the background');
|
||
|
});
|
||
|
});
|