Skip to content

Commit

Permalink
fix dashboard tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Michail Yasonik committed Feb 18, 2021
1 parent df7dc21 commit c9084c0
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions test/functional/services/toasts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
/**
Expand Down Expand Up @@ -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();
}
}
}

Expand Down

0 comments on commit c9084c0

Please sign in to comment.