diff --git a/test/functional/page_objects/dashboard_page.ts b/test/functional/page_objects/dashboard_page.ts index aceafe2d179c7..602f0f9d3fd92 100644 --- a/test/functional/page_objects/dashboard_page.ts +++ b/test/functional/page_objects/dashboard_page.ts @@ -472,11 +472,10 @@ export class DashboardPageObject extends FtrService { */ public async saveDashboard( dashboardName: string, - saveOptions: SaveDashboardOptions = { waitDialogIsClosed: true, exitFromEditMode: true }, - clickMenuItem = true + saveOptions: SaveDashboardOptions = { waitDialogIsClosed: true, exitFromEditMode: true } ) { await this.retry.try(async () => { - await this.enterDashboardTitleAndClickSave(dashboardName, saveOptions, clickMenuItem); + await this.enterDashboardTitleAndClickSave(dashboardName, saveOptions); if (saveOptions.needsConfirm) { await this.ensureDuplicateTitleCallout(); @@ -516,10 +515,12 @@ export class DashboardPageObject extends FtrService { */ public async enterDashboardTitleAndClickSave( dashboardTitle: string, - saveOptions: SaveDashboardOptions = { waitDialogIsClosed: true }, - clickMenuItem = true + saveOptions: SaveDashboardOptions = { waitDialogIsClosed: true } ) { - if (clickMenuItem) { + const isSaveModalOpen = await this.testSubjects.exists('savedObjectSaveModal', { + timeout: 2000, + }); + if (!isSaveModalOpen) { await this.testSubjects.click('dashboardSaveMenuItem'); } const modalDialog = await this.testSubjects.find('savedObjectSaveModal');