From b5570ecdc420cd4649ec63fe2a95f841481b487e Mon Sep 17 00:00:00 2001 From: Marta Bondyra <4283304+mbondyra@users.noreply.github.com> Date: Tue, 27 Aug 2024 12:31:32 +0200 Subject: [PATCH] [Lens] fix flaky test with deleting filters (#191316) ## Summary Fixes https://github.com/elastic/kibana/issues/191009 (also fixes https://github.com/elastic/kibana/issues/189569 https://github.com/elastic/kibana/issues/178270 https://github.com/elastic/kibana/issues/139040 which are already closed as one time occurances but could happen again) https://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/6809 --- test/functional/services/filter_bar.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/test/functional/services/filter_bar.ts b/test/functional/services/filter_bar.ts index be4abf4e0daf2..c508410739db0 100644 --- a/test/functional/services/filter_bar.ts +++ b/test/functional/services/filter_bar.ts @@ -133,10 +133,11 @@ export class FilterBarService extends FtrService { * @param key field name */ public async removeFilter(key: string): Promise { - await this.retry.try(async () => { + await this.retry.waitFor('filter pill context menu is open', async () => { await this.testSubjects.click(`~filter & ~filter-key-${key}`); - await this.testSubjects.click(`deleteFilter`); + return await this.testSubjects.exists('deleteFilter'); }); + await this.testSubjects.click(`deleteFilter`); await this.header.awaitGlobalLoadingIndicatorHidden(); }