Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions test/functional/apps/dashboard/dashboard_snapshots.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ export default function({ getService, getPageObjects, updateBaselines }) {
await PageObjects.dashboard.clickNewDashboard();
await PageObjects.timePicker.setLogstashDataRange();
await dashboardAddPanel.addVisualization('Rendering Test: tsvb-ts');
await PageObjects.common.closeToast();
await PageObjects.common.closeToastIfExists();

await PageObjects.dashboard.saveDashboard('tsvb');
await PageObjects.dashboard.clickFullScreenMode();
Expand All @@ -73,7 +73,7 @@ export default function({ getService, getPageObjects, updateBaselines }) {
await PageObjects.dashboard.clickNewDashboard();
await PageObjects.timePicker.setLogstashDataRange();
await dashboardAddPanel.addVisualization('Rendering Test: area with not filter');
await PageObjects.common.closeToast();
await PageObjects.common.closeToastIfExists();

await PageObjects.dashboard.saveDashboard('area');
await PageObjects.dashboard.clickFullScreenMode();
Expand Down
7 changes: 7 additions & 0 deletions test/functional/page_objects/common_page.ts
Original file line number Diff line number Diff line change
Expand Up @@ -435,6 +435,13 @@ export function CommonPageProvider({ getService, getPageObjects }: FtrProviderCo
return title;
}

async closeToastIfExists() {
const toastShown = await find.existsByCssSelector('.euiToast');
if (toastShown) {
await this.closeToast();
}
}

async clearAllToasts() {
const toasts = await find.allByCssSelector('.euiToast');
for (const toastElement of toasts) {
Expand Down