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');