From 89043cd3e1c019edf9894dfc3d3d4d198cbf2a18 Mon Sep 17 00:00:00 2001 From: Robert Oskamp Date: Wed, 13 Nov 2019 10:27:15 +0100 Subject: [PATCH] Move toast handling to saveDashboard --- test/functional/apps/dashboard/dashboard_snapshots.js | 2 -- test/functional/page_objects/dashboard_page.js | 6 +++++- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/test/functional/apps/dashboard/dashboard_snapshots.js b/test/functional/apps/dashboard/dashboard_snapshots.js index e98c4afc443f8a..698f4d1de6d57f 100644 --- a/test/functional/apps/dashboard/dashboard_snapshots.js +++ b/test/functional/apps/dashboard/dashboard_snapshots.js @@ -53,7 +53,6 @@ export default function ({ getService, getPageObjects, updateBaselines }) { await PageObjects.common.closeToast(); await PageObjects.dashboard.saveDashboard('tsvb'); - await PageObjects.common.closeToast(); await PageObjects.dashboard.clickFullScreenMode(); await dashboardPanelActions.openContextMenu(); await dashboardPanelActions.clickExpandPanelToggle(); @@ -74,7 +73,6 @@ export default function ({ getService, getPageObjects, updateBaselines }) { await PageObjects.common.closeToast(); await PageObjects.dashboard.saveDashboard('area'); - await PageObjects.common.closeToast(); await PageObjects.dashboard.clickFullScreenMode(); await dashboardPanelActions.openContextMenu(); await dashboardPanelActions.clickExpandPanelToggle(); diff --git a/test/functional/page_objects/dashboard_page.js b/test/functional/page_objects/dashboard_page.js index ca141114f976dc..ffbbcdf3026223 100644 --- a/test/functional/page_objects/dashboard_page.js +++ b/test/functional/page_objects/dashboard_page.js @@ -305,7 +305,8 @@ export function DashboardPageProvider({ getService, getPageObjects }) { /** * Save the current dashboard with the specified name and options and - * verify that the save was successful + * verify that the save was successful, close the toast and return the + * toast message * * @param dashName {String} * @param saveOptions {{storeTimeWithDashboard: boolean, saveAsNew: boolean, needsConfirm: false, waitDialogIsClosed: boolean }} @@ -319,8 +320,11 @@ export function DashboardPageProvider({ getService, getPageObjects }) { // Confirm that the Dashboard has actually been saved await testSubjects.existOrFail('saveDashboardSuccess'); + const message = await PageObjects.common.closeToast(); await PageObjects.header.waitUntilLoadingHasFinished(); await this.waitForSaveModalToClose(); + + return message; } async waitForSaveModalToClose() {