diff --git a/test/accessibility/apps/dashboard.ts b/test/accessibility/apps/dashboard.ts index 04a85f6fc5132..5eaf719c68a5a 100644 --- a/test/accessibility/apps/dashboard.ts +++ b/test/accessibility/apps/dashboard.ts @@ -35,10 +35,6 @@ export default function({ getService, getPageObjects }: FtrProviderContext) { const clonedDashboardName = 'Dashboard Listing A11y Copy'; before(async () => { - // await esArchiver.loadIfNeeded('logstash_functional'); - // await kibanaServer.uiSettings.update({ - // defaultIndex: 'logstash-*', - // }); await PageObjects.common.navigateToUrl('home', 'tutorial_directory/sampleData'); await PageObjects.home.addSampleDataSet('flights'); }); @@ -134,9 +130,7 @@ export default function({ getService, getPageObjects }: FtrProviderContext) { }); it('Exit out of full screen mode', async () => { - const logoButton = await PageObjects.dashboard.getExitFullScreenLogoButton(); - await logoButton.moveMouseTo(); - await PageObjects.dashboard.clickExitFullScreenTextButton(); + await PageObjects.dashboard.exitFullScreenMode(); await a11y.testAppSnapshot(); }); diff --git a/test/functional/apps/dashboard/full_screen_mode.js b/test/functional/apps/dashboard/full_screen_mode.js index 69c0a05b8413b..df00f64530ca0 100644 --- a/test/functional/apps/dashboard/full_screen_mode.js +++ b/test/functional/apps/dashboard/full_screen_mode.js @@ -75,9 +75,7 @@ export default function({ getService, getPageObjects }) { }); it('exits when the text button is clicked on', async () => { - const logoButton = await PageObjects.dashboard.getExitFullScreenLogoButton(); - await logoButton.moveMouseTo(); - await PageObjects.dashboard.clickExitFullScreenTextButton(); + await PageObjects.dashboard.exitFullScreenMode(); await retry.try(async () => { const isChromeVisible = await PageObjects.common.isChromeVisible(); expect(isChromeVisible).to.be(true); diff --git a/test/functional/page_objects/dashboard_page.ts b/test/functional/page_objects/dashboard_page.ts index 3fd7ce27e27d4..887f76bace40d 100644 --- a/test/functional/page_objects/dashboard_page.ts +++ b/test/functional/page_objects/dashboard_page.ts @@ -95,6 +95,12 @@ export function DashboardPageProvider({ getService, getPageObjects }: FtrProvide await this.waitForRenderComplete(); } + public async exitFullScreenMode() { + const logoButton = await this.getExitFullScreenLogoButton(); + await logoButton.moveMouseTo(); + await this.clickExitFullScreenTextButton(); + } + public async getDashboardIdFromCurrentUrl() { const currentUrl = await browser.getCurrentUrl(); const urlSubstring = 'kibana#/dashboard/';