From c9084c031b0cd634adb6d80df37a0c04eb628a9c Mon Sep 17 00:00:00 2001 From: Michail Yasonik Date: Thu, 18 Feb 2021 14:37:19 -0500 Subject: [PATCH] fix dashboard tests --- test/functional/services/toasts.ts | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/test/functional/services/toasts.ts b/test/functional/services/toasts.ts index f6a83abc0c4d8..e8e788fc96f84 100644 --- a/test/functional/services/toasts.ts +++ b/test/functional/services/toasts.ts @@ -10,6 +10,7 @@ import { FtrProviderContext } from '../ftr_provider_context'; export function ToastsProvider({ getService }: FtrProviderContext) { const testSubjects = getService('testSubjects'); + const retry = getService('retry'); class Toasts { /** @@ -50,8 +51,11 @@ export function ToastsProvider({ getService }: FtrProviderContext) { for (const toast of toasts) { await toast.moveMouseTo(); - const dismissButton = await testSubjects.findDescendant('toastCloseButton', toast); - if (dismissButton) await dismissButton.click(); + + if (await testSubjects.descendantExists('toastCloseButton', toast)) { + const dismissButton = await testSubjects.findDescendant('toastCloseButton', toast); + await dismissButton.click(); + } } }