From 88aeb484af46bba109480e882a72fbb63634271a Mon Sep 17 00:00:00 2001 From: kevinlog Date: Thu, 2 Jan 2020 13:20:26 -0500 Subject: [PATCH] add comments to test framework, change function name to include browserHistory --- test/functional/page_objects/common_page.ts | 6 ++++-- .../apps/endpoint/feature_controls/endpoint_spaces.ts | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/test/functional/page_objects/common_page.ts b/test/functional/page_objects/common_page.ts index cb37f2b6066eda..75a15cc16db2eb 100644 --- a/test/functional/page_objects/common_page.ts +++ b/test/functional/page_objects/common_page.ts @@ -183,12 +183,13 @@ export function CommonPageProvider({ getService, getPageObjects }: FtrProviderCo } /** - * Navigates browser using the pathname from the appConfig and subUrl as the extended path + * Navigates browser using the pathname from the appConfig and subUrl as the extended path. + * This was added to be able to test an application that uses browser history over hash history. * @param appName As defined in the apps config, e.g. 'home' * @param subUrl The route after the appUrl, e.g. 'tutorial_directory/sampleData' * @param args additional arguments */ - public async navigateToRealUrl( + public async navigateToUrlWithBrowserHistory( appName: string, subUrl?: string, { @@ -200,6 +201,7 @@ export function CommonPageProvider({ getService, getPageObjects }: FtrProviderCo } = {} ) { const appConfig = { + // subUrl following the basePath, assumes no hashes. Ex: 'app/endpoint/management' pathname: `${basePath}${config.get(['apps', appName]).pathname}${subUrl}`, }; diff --git a/x-pack/test/functional/apps/endpoint/feature_controls/endpoint_spaces.ts b/x-pack/test/functional/apps/endpoint/feature_controls/endpoint_spaces.ts index 360846e79f1a47..1d1fb566eb075f 100644 --- a/x-pack/test/functional/apps/endpoint/feature_controls/endpoint_spaces.ts +++ b/x-pack/test/functional/apps/endpoint/feature_controls/endpoint_spaces.ts @@ -44,7 +44,7 @@ export default function({ getPageObjects, getService }: FtrProviderContext) { }); it(`endpoint management shows 'Manage Endpoints'`, async () => { - await pageObjects.common.navigateToRealUrl('endpoint', '/management', { + await pageObjects.common.navigateToUrlWithBrowserHistory('endpoint', '/management', { basePath: '/s/custom_space', ensureCurrentUrl: false, shouldLoginIfPrompted: false,