From 1cba67305d7c09f545da6eb606dedebb066f8149 Mon Sep 17 00:00:00 2001 From: Matthias Wilhelm Date: Tue, 17 Aug 2021 11:04:01 +0200 Subject: [PATCH] Improve isFieldSelected function to fix tests --- test/functional/page_objects/discover_page.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/test/functional/page_objects/discover_page.ts b/test/functional/page_objects/discover_page.ts index 9ce54c86ee229..ae1b4fbf3179a 100644 --- a/test/functional/page_objects/discover_page.ts +++ b/test/functional/page_objects/discover_page.ts @@ -370,6 +370,9 @@ export class DiscoverPageObject extends FtrService { } public async isFieldSelected(field: string) { + if (!(await this.testSubjects.exists('fieldList-selected'))) { + return false; + } const selectedList = await this.testSubjects.find('fieldList-selected'); return await this.testSubjects.descendantExists(`field-${field}`, selectedList); }