From 7027ba6c3b176321867ceebcba658b2ae536f149 Mon Sep 17 00:00:00 2001 From: Eli Perelman Date: Thu, 23 Jan 2020 17:15:51 -0600 Subject: [PATCH] Fixing flaky CI tests for custom appRoutes --- .../test_suites/core_plugins/rendering.ts | 34 ++++++++++--------- 1 file changed, 18 insertions(+), 16 deletions(-) diff --git a/test/plugin_functional/test_suites/core_plugins/rendering.ts b/test/plugin_functional/test_suites/core_plugins/rendering.ts index 643964999017f..91495c4024f3a 100644 --- a/test/plugin_functional/test_suites/core_plugins/rendering.ts +++ b/test/plugin_functional/test_suites/core_plugins/rendering.ts @@ -62,8 +62,12 @@ export default function({ getService, getPageObjects }: PluginFunctionalProvider return JSON.parse(document.querySelector('kbn-injected-metadata')!.getAttribute('data')!) .legacyMetadata.uiSettings.user; }); - const exists = (selector: string) => testSubjects.exists(selector, { timeout: 2000 }); + const exists = (selector: string) => testSubjects.exists(selector, { timeout: 5000 }); const findLoadingMessage = () => testSubjects.find('kbnLoadingMessage', 5000); + const getRenderingSession = () => + browser.execute(() => { + return window.__RENDERING_SESSION__; + }); describe('rendering service', () => { it('renders "core" application', async () => { @@ -136,8 +140,7 @@ export default function({ getService, getPageObjects }: PluginFunctionalProvider expect(await exists('renderingHeader')).to.be(false); }); - // Flaky: https://github.com/elastic/kibana/issues/55750 - it.skip('navigates between standard application and one with custom appRoute', async () => { + it('navigates between standard application and one with custom appRoute', async () => { await navigateTo('/'); await find.waitForElementStale(await findLoadingMessage()); @@ -153,15 +156,14 @@ export default function({ getService, getPageObjects }: PluginFunctionalProvider expect(await exists('appStatusApp')).to.be(true); expect(await exists('renderingHeader')).to.be(false); - expect( - await browser.execute(() => { - return window.__RENDERING_SESSION__; - }) - ).to.eql(['/app/app_status', '/render/core', '/app/app_status']); + expect(await getRenderingSession()).to.eql([ + '/app/app_status', + '/render/core', + '/app/app_status', + ]); }); - // Flaky: https://github.com/elastic/kibana/issues/55736 - it.skip('navigates between applications with custom appRoutes', async () => { + it('navigates between applications with custom appRoutes', async () => { await navigateTo('/'); await find.waitForElementStale(await findLoadingMessage()); @@ -170,18 +172,18 @@ export default function({ getService, getPageObjects }: PluginFunctionalProvider expect(await exists('customAppRouteHeader')).to.be(false); await navigateToApp('Custom App Route'); - expect(await exists('renderingHeader')).to.be(false); expect(await exists('customAppRouteHeader')).to.be(true); + expect(await exists('renderingHeader')).to.be(false); await navigateToApp('Rendering'); expect(await exists('renderingHeader')).to.be(true); expect(await exists('customAppRouteHeader')).to.be(false); - expect( - await browser.execute(() => { - return window.__RENDERING_SESSION__; - }) - ).to.eql(['/render/core', '/custom/appRoute', '/render/core']); + expect(await getRenderingSession()).to.eql([ + '/render/core', + '/custom/appRoute', + '/render/core', + ]); }); }); }