Skip to content

Commit

Permalink
Make welcome screen disabling first action in loginIfPrompted (elasti…
Browse files Browse the repository at this point in the history
…c#68238)

This PR moves the welcome screen disabling in loginIfPrompted to the first position.
  • Loading branch information
pheyos committed Jun 5, 2020
1 parent 8ec0ddb commit d23f9f8
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions test/functional/page_objects/common_page.ts
Original file line number Diff line number Diff line change
Expand Up @@ -67,17 +67,17 @@ export function CommonPageProvider({ getService, getPageObjects }: FtrProviderCo
* @param appUrl Kibana URL
*/
private async loginIfPrompted(appUrl: string, insertTimestamp: boolean) {
// Disable the welcome screen. This is relevant for environments
// which don't allow to use the yml setting, e.g. cloud production.
// It is done here so it applies to logins but also to a login re-use.
await browser.setLocalStorageItem('home:welcome:show', 'false');

let currentUrl = await browser.getCurrentUrl();
log.debug(`currentUrl = ${currentUrl}\n appUrl = ${appUrl}`);
await testSubjects.find('kibanaChrome', 6 * defaultFindTimeout); // 60 sec waiting
const loginPage = currentUrl.includes('/login');
const wantedLoginPage = appUrl.includes('/login') || appUrl.includes('/logout');

// Disable the welcome screen. This is relevant for environments
// which don't allow to use the yml setting, e.g. cloud production.
// It is done here so it applies to logins but also to a login re-use.
await browser.setLocalStorageItem('home:welcome:show', 'false');

if (loginPage && !wantedLoginPage) {
log.debug('Found login page');
if (config.get('security.disableTestUser')) {
Expand Down

0 comments on commit d23f9f8

Please sign in to comment.