From d2780b7c467305160db8bf14995680417ab6faeb Mon Sep 17 00:00:00 2001 From: Marco Liberati Date: Tue, 3 Dec 2024 16:00:31 +0100 Subject: [PATCH] [Lens] Stabilize FTR test (#202476) ## Summary Fixes #200120 The navigation bar is not focused for some reason. Making it wait a bit seems to stabilize it. ### Checklist - [x] [Unit or functional tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html) were updated or added to match the most common scenarios (cherry picked from commit 9df737384642b57dc059e854be1236721f1a9bb3) # Conflicts: # x-pack/test/functional/apps/lens/group2/persistent_context.ts --- .../functional/apps/lens/group2/persistent_context.ts | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/x-pack/test/functional/apps/lens/group2/persistent_context.ts b/x-pack/test/functional/apps/lens/group2/persistent_context.ts index 0d34b0f68564d..7edb55594b64e 100644 --- a/x-pack/test/functional/apps/lens/group2/persistent_context.ts +++ b/x-pack/test/functional/apps/lens/group2/persistent_context.ts @@ -5,7 +5,7 @@ * 2.0. */ -import expect from '@kbn/expect'; +import expect from '@kbn/expect/expect'; import { FtrProviderContext } from '../../../ftr_provider_context'; export default function ({ getService, getPageObjects }: FtrProviderContext) { @@ -75,9 +75,11 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { await listingTable.searchForItemWithName('lnsTableVis'); await lens.clickVisualizeListItemTitle('lnsTableVis'); await lens.goToTimeRange(); - await navigationalSearch.focus(); - await navigationalSearch.searchFor('type:application lens'); - await navigationalSearch.clickOnOption(0); + await retry.try(async () => { + await navigationalSearch.focus(); + await navigationalSearch.searchFor('type:application lens'); + await navigationalSearch.clickOnOption(0); + }); await lens.waitForEmptyWorkspace(); await lens.switchToVisualization('lnsLegacyMetric'); await lens.dragFieldToWorkspace('@timestamp', 'legacyMtrVis');