Skip to content

Commit

Permalink
stabilize dashboard snapshot toast closing (#58709) (#59272)
Browse files Browse the repository at this point in the history
  • Loading branch information
flash1293 committed Mar 4, 2020
1 parent 849015c commit b349ee3
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
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 @@ -370,6 +370,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

0 comments on commit b349ee3

Please sign in to comment.