From c3573309f0ab61cd90089f7d19e0a8ae3648f6d0 Mon Sep 17 00:00:00 2001 From: Kibana Machine <42973632+kibanamachine@users.noreply.github.com> Date: Mon, 2 Aug 2021 06:05:45 -0400 Subject: [PATCH] [Discover] Improve functional testing searchOnPageLoad (#107181) (#107363) Co-authored-by: Matthias Wilhelm --- test/functional/apps/discover/_discover.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/test/functional/apps/discover/_discover.ts b/test/functional/apps/discover/_discover.ts index f837a96587c2c..eaeb8f485c8f0 100644 --- a/test/functional/apps/discover/_discover.ts +++ b/test/functional/apps/discover/_discover.ts @@ -298,8 +298,10 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { await kibanaServer.uiSettings.replace({ 'discover:searchOnPageLoad': true }); await PageObjects.common.navigateToApp('discover'); await PageObjects.header.awaitKibanaChrome(); - - expect(await PageObjects.discover.getNrOfFetches()).to.be(1); + await retry.waitFor('number of fetches to be 1', async () => { + const nrOfFetches = await PageObjects.discover.getNrOfFetches(); + return nrOfFetches === 1; + }); }); });