Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix App status flaky test #72853

Merged
merged 4 commits into from
Jul 28, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ import {
CoreStart,
AppMountParameters,
} from 'kibana/public';
import { renderApp } from './application';
mshustov marked this conversation as resolved.
Show resolved Hide resolved
import './types';

export class CoreAppStatusPlugin implements Plugin<{}, CoreAppStatusPluginStart> {
Expand All @@ -36,7 +37,6 @@ export class CoreAppStatusPlugin implements Plugin<{}, CoreAppStatusPluginStart>
id: 'app_status_start',
title: 'App Status Start Page',
async mount(params: AppMountParameters) {
const { renderApp } = await import('./application');
return renderApp('app_status_start', params);
},
});
Expand All @@ -47,7 +47,6 @@ export class CoreAppStatusPlugin implements Plugin<{}, CoreAppStatusPluginStart>
euiIconType: 'snowflake',
updater$: this.appUpdater,
async mount(params: AppMountParameters) {
const { renderApp } = await import('./application');
return renderApp('app_status', params);
},
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ export default function ({ getService, getPageObjects }: PluginFunctionalProvide
const PageObjects = getPageObjects(['common']);
const browser = getService('browser');
const appsMenu = getService('appsMenu');
const retry = getService('retry');
const testSubjects = getService('testSubjects');

const setAppStatus = async (s: Partial<AppUpdatableFields>) => {
Expand All @@ -50,15 +51,14 @@ export default function ({ getService, getPageObjects }: PluginFunctionalProvide
}, s);
};

const navigateToApp = async (i: string) => {
const navigateToApp = async (id: string) => {
return await browser.executeAsync(async (appId, cb) => {
await window.__coreAppStatus.navigateToApp(appId);
cb();
}, i);
}, id);
};

// FLAKY: https://github.com/elastic/kibana/issues/65423
describe.skip('application status management', () => {
describe('application status management', () => {
beforeEach(async () => {
await PageObjects.common.navigateToApp('app_status_start');
});
Expand Down Expand Up @@ -101,15 +101,17 @@ export default function ({ getService, getPageObjects }: PluginFunctionalProvide
});

it('allows to change the defaultPath of an application', async () => {
let link = await appsMenu.getLink('App Status');
const link = await appsMenu.getLink('App Status');
expect(link!.href).to.eql(getKibanaUrl('/app/app_status'));

await setAppStatus({
defaultPath: '/arbitrary/path',
});

link = await appsMenu.getLink('App Status');
expect(link!.href).to.eql(getKibanaUrl('/app/app_status/arbitrary/path'));
await retry.waitFor('link url updated with "defaultPath"', async () => {
const updatedLink = await appsMenu.getLink('App Status');
return updatedLink?.href === getKibanaUrl('/app/app_status/arbitrary/path');
});

await navigateToApp('app_status');
expect(await testSubjects.exists('appStatusApp')).to.eql(true);
Expand Down