Check for alert dialog when doing a force logout (#59329)

This commit is contained in:
Brian Seeders 2020-03-06 16:03:41 -05:00 committed by GitHub
parent 76c205cd1e
commit dd9999bf5d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -110,12 +110,7 @@ export function SecurityPageProvider({ getService, getPageObjects }) {
}
await userMenu.clickLogoutButton();
await retry.waitForWithTimeout(
'login form',
config.get('timeouts.waitFor') * 5,
async () => await find.existsByDisplayedByCssSelector('.login-form')
);
await this.waitForLoginForm();
}
async forceLogout() {
@ -129,11 +124,17 @@ export function SecurityPageProvider({ getService, getPageObjects }) {
const url = PageObjects.common.getHostPort() + '/logout';
await browser.get(url);
log.debug('Waiting on the login form to appear');
await retry.waitForWithTimeout(
'login form',
config.get('timeouts.waitFor') * 5,
async () => await find.existsByDisplayedByCssSelector('.login-form')
);
await this.waitForLoginForm();
}
async waitForLoginForm() {
await retry.waitForWithTimeout('login form', config.get('timeouts.waitFor') * 5, async () => {
const alert = await browser.getAlert();
if (alert && alert.accept) {
await alert.accept();
}
return await find.existsByDisplayedByCssSelector('.login-form');
});
}
async clickRolesSection() {