diff --git a/test/functional/page_objects/common_page.ts b/test/functional/page_objects/common_page.ts index 645c2a2abc050..4355ceeb5b03a 100644 --- a/test/functional/page_objects/common_page.ts +++ b/test/functional/page_objects/common_page.ts @@ -150,6 +150,7 @@ export function CommonPageProvider({ getService, getPageObjects }: FtrProviderCo } }); + await this.waitForKbnLoadingMessageToClose(); await this.closeWelcomeScreenIfNeeded(); } @@ -505,10 +506,19 @@ export function CommonPageProvider({ getService, getPageObjects }: FtrProviderCo }); } + async waitForKbnLoadingMessageToClose() { + log.debug('Waiting for Kibana loading message to close'); + await retry.tryForTime(30 * 1000, async () => { + if (await testSubjects.exists('kbnLoadingMessage')) { + throw new Error('loading message still open'); + } + }); + } + async closeWelcomeScreenIfNeeded() { if (await testSubjects.exists('skipWelcomeScreen')) { await testSubjects.click('skipWelcomeScreen'); - await testSubjects.missingOrFail('skipWelcomeScreen', { timeout: 5000 }); + await testSubjects.missingOrFail('skipWelcomeScreen'); } } } diff --git a/x-pack/test/functional/page_objects/security_page.js b/x-pack/test/functional/page_objects/security_page.js index 03dc34800c496..16dd78b852cb2 100644 --- a/x-pack/test/functional/page_objects/security_page.js +++ b/x-pack/test/functional/page_objects/security_page.js @@ -34,6 +34,7 @@ export function SecurityPageProvider({ getService, getPageObjects }) { await testSubjects.setValue('loginPassword', password); await testSubjects.click('loginSubmit'); + await PageObjects.common.waitForKbnLoadingMessageToClose(); await PageObjects.common.closeWelcomeScreenIfNeeded(); // wait for either space selector, kibanaChrome or loginErrorMessage