From 43205ec8c7a2ba0cfe2f730217e87c33a873ed92 Mon Sep 17 00:00:00 2001 From: Dmitry Lemeshko Date: Tue, 5 May 2020 11:47:55 +0300 Subject: [PATCH] [functional/page_objects] wait for infra ops page is loaded (#65050) * [functional/page_objects] wait for infra ops page is loaded * put waiting in PO method --- x-pack/plugins/infra/public/components/loading_page.tsx | 2 +- x-pack/test/functional/apps/infra/home_page.ts | 1 + x-pack/test/functional/page_objects/infra_home_page.ts | 4 ++++ 3 files changed, 6 insertions(+), 1 deletion(-) diff --git a/x-pack/plugins/infra/public/components/loading_page.tsx b/x-pack/plugins/infra/public/components/loading_page.tsx index ae179c6542c1..9d37fed45b58 100644 --- a/x-pack/plugins/infra/public/components/loading_page.tsx +++ b/x-pack/plugins/infra/public/components/loading_page.tsx @@ -27,7 +27,7 @@ export const LoadingPage = ({ message }: LoadingPageProps) => ( - {message} + {message} diff --git a/x-pack/test/functional/apps/infra/home_page.ts b/x-pack/test/functional/apps/infra/home_page.ts index ed8bec570ab6..28d7956e353e 100644 --- a/x-pack/test/functional/apps/infra/home_page.ts +++ b/x-pack/test/functional/apps/infra/home_page.ts @@ -33,6 +33,7 @@ export default ({ getPageObjects, getService }: FtrProviderContext) => { before(async () => { await esArchiver.load('infra/metrics_and_logs'); await pageObjects.common.navigateToApp('infraOps'); + await pageObjects.infraHome.waitForLoading(); }); after(async () => await esArchiver.unload('infra/metrics_and_logs')); diff --git a/x-pack/test/functional/page_objects/infra_home_page.ts b/x-pack/test/functional/page_objects/infra_home_page.ts index 998a60500aca..51dad594f21f 100644 --- a/x-pack/test/functional/page_objects/infra_home_page.ts +++ b/x-pack/test/functional/page_objects/infra_home_page.ts @@ -74,5 +74,9 @@ export function InfraHomePageProvider({ getService }: FtrProviderContext) { await testSubjects.click('configureSourceButton'); await testSubjects.exists('sourceConfigurationFlyout'); }, + + async waitForLoading() { + await testSubjects.missingOrFail('loadingMessage', { timeout: 20000 }); + }, }; }