From 171f6559a183183bee518e1939df25af88532b68 Mon Sep 17 00:00:00 2001 From: Kibana Machine <42973632+kibanamachine@users.noreply.github.com> Date: Mon, 23 Aug 2021 08:16:58 -0400 Subject: [PATCH] [Flaky test] Application Usage: Wait for chrome to visible (#109405) (#109600) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Alejandro Fernández Haro --- .../test_suites/application_usage/index.ts | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/x-pack/test/usage_collection/test_suites/application_usage/index.ts b/x-pack/test/usage_collection/test_suites/application_usage/index.ts index 43d7714dfea1d..fc53c8ddf5ed3 100644 --- a/x-pack/test/usage_collection/test_suites/application_usage/index.ts +++ b/x-pack/test/usage_collection/test_suites/application_usage/index.ts @@ -16,8 +16,14 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { const browser = getService('browser'); it('keys in the schema match the registered application IDs', async () => { - await common.navigateToApp('home'); // Navigate to Home to make sure all the appIds are loaded + await common.navigateToApp('home'); // Navigate to Home + await common.isChromeVisible(); // Make sure the page is fully loaded const appIds = await browser.execute(() => window.__applicationIds__); + if (!appIds || !Array.isArray(appIds)) { + throw new Error( + 'Failed to retrieve all the existing applications in Kibana. Did it fail to boot or to navigate to home?' + ); + } try { expect(Object.keys(applicationUsageSchema).sort()).to.eql(appIds.sort()); } catch (err) {