2022-05-18 12:01:30 +00:00
|
|
|
import selectors from '../../helpers/selectors.js';
|
|
|
|
import getBrowser from '../../helpers/puppeteer';
|
|
|
|
|
|
|
|
describe('Account Connections path', () => {
|
|
|
|
let browser;
|
|
|
|
let page;
|
|
|
|
const account = 'sysadmin';
|
|
|
|
|
|
|
|
beforeAll(async() => {
|
|
|
|
browser = await getBrowser();
|
|
|
|
page = browser.page;
|
|
|
|
await page.loginAndModule(account, 'account');
|
|
|
|
await page.accessToSection('account.connections');
|
|
|
|
});
|
|
|
|
|
|
|
|
afterAll(async() => {
|
|
|
|
await browser.close();
|
|
|
|
});
|
|
|
|
|
|
|
|
it('should check this is the last connection', async() => {
|
|
|
|
const firstResult = await page.waitToGetProperty(selectors.accountConnections.firstConnection, 'innerText');
|
|
|
|
|
|
|
|
expect(firstResult).toContain(account);
|
|
|
|
});
|
|
|
|
|
2022-05-25 06:27:26 +00:00
|
|
|
it('should kill this connection and then get redirected to the login page', async() => {
|
2022-05-18 12:01:30 +00:00
|
|
|
await page.waitToClick(selectors.accountConnections.deleteFirstConnection);
|
|
|
|
await page.waitToClick(selectors.globalItems.acceptButton);
|
|
|
|
const message = await page.waitForSnackbar();
|
|
|
|
|
|
|
|
expect(message.text).toContain('Your session has expired, please login again');
|
|
|
|
});
|
|
|
|
});
|