stabilize dashboard snapshot toast closing (#58709)

This commit is contained in:
Joe Reuter 2020-03-03 21:39:22 +01:00 committed by GitHub
parent 5d6248d9d9
commit e4f4ac7cfa
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 9 additions and 2 deletions

View file

@ -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();
@ -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();

View file

@ -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) {