From 05ccb957826c69ea554a33ead214ca8283c9df80 Mon Sep 17 00:00:00 2001 From: Robert Oskamp Date: Fri, 15 May 2020 11:58:44 +0200 Subject: [PATCH] Move welcome screen disabling to common page --- test/functional/page_objects/common_page.ts | 7 +++++++ x-pack/test/functional/page_objects/security_page.js | 4 ---- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/test/functional/page_objects/common_page.ts b/test/functional/page_objects/common_page.ts index aefb1e8ee1620..0671f26ecd149 100644 --- a/test/functional/page_objects/common_page.ts +++ b/test/functional/page_objects/common_page.ts @@ -73,6 +73,13 @@ export function CommonPageProvider({ getService, getPageObjects }: FtrProviderCo const loginPage = currentUrl.includes('/login'); const wantedLoginPage = appUrl.includes('/login') || appUrl.includes('/logout'); + // Disable the welcome screen if the corresponding environment variable is set + // 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 + if (process.env.DISABLE_WELCOME_SCREEN) { + await browser.setLocalStorageItem('home:welcome:show', 'false'); + } + if (loginPage && !wantedLoginPage) { log.debug('Found login page'); if (config.get('security.disableTestUser')) { diff --git a/x-pack/test/functional/page_objects/security_page.js b/x-pack/test/functional/page_objects/security_page.js index ae26a831d4172..bddadcce12e1f 100644 --- a/x-pack/test/functional/page_objects/security_page.js +++ b/x-pack/test/functional/page_objects/security_page.js @@ -31,10 +31,6 @@ export function SecurityPageProvider({ getService, getPageObjects }) { await PageObjects.common.navigateToApp('login'); - // ensure welcome screen won't be shown. This is relevant for environments which don't allow - // to use the yml setting, e.g. cloud - await browser.setLocalStorageItem('home:welcome:show', 'false'); - await testSubjects.setValue('loginUsername', username); await testSubjects.setValue('loginPassword', password); await testSubjects.click('loginSubmit');