Skip to content

Commit

Permalink
Review#1: return code that closes browser native alerts when we log u…
Browse files Browse the repository at this point in the history
…ser out.
  • Loading branch information
azasypkin committed May 14, 2020
1 parent e8766ee commit 73cc2b9
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions x-pack/test/functional/page_objects/security_page.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,13 @@ export function SecurityPageProvider({ getService, getPageObjects }: FtrProvider
async function waitForLoginPage() {
log.debug('Waiting for Login Page to appear.');
await retry.waitForWithTimeout('login page', config.get('timeouts.waitFor') * 5, async () => {
// As a part of the cleanup flow tests usually try to log users out, but there are cases when
// browser/Kibana would like users to confirm that they want to navigate away from the current
// page and lose the state (e.g. unsaved changes) via native alert dialog.
const alert = await browser.getAlert();
if (alert && alert.accept) {
await alert.accept();
}
return await find.existsByDisplayedByCssSelector('.login-form');
});
}
Expand Down

0 comments on commit 73cc2b9

Please sign in to comment.