Skip to content

Commit

Permalink
Move toast handling to saveDashboard
Browse files Browse the repository at this point in the history
  • Loading branch information
pheyos committed Nov 13, 2019
1 parent 77354bf commit 89043cd
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
2 changes: 0 additions & 2 deletions test/functional/apps/dashboard/dashboard_snapshots.js
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand All @@ -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();
Expand Down
6 changes: 5 additions & 1 deletion test/functional/page_objects/dashboard_page.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Expand All @@ -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() {
Expand Down

0 comments on commit 89043cd

Please sign in to comment.