Skip to content

Commit

Permalink
add comments to test framework, change function name to include brows…
Browse files Browse the repository at this point in the history
…erHistory
  • Loading branch information
kevinlog committed Jan 2, 2020
1 parent 899b9cf commit 88aeb48
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
6 changes: 4 additions & 2 deletions test/functional/page_objects/common_page.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
{
Expand All @@ -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}`,
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 88aeb48

Please sign in to comment.