Skip to content

Commit

Permalink
fix url formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
dmlemeshko committed Jun 5, 2020
1 parent db8dc24 commit 9402cfa
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions packages/kbn-test/src/page_load_metrics/navigation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,11 +46,13 @@ function joinPath(pathA: string, pathB: string) {

export function createUrl(path: string, url: string) {
const baseUrl = Url.parse(url);

return Url.format({
protocol: baseUrl.protocol,
hostname: baseUrl.hostname,
port: baseUrl.port,
pathname: joinPath(baseUrl.pathname || '', path),
pathname: joinPath(baseUrl.pathname || '', path.includes('#') ? path.split('#')[0] : path),
hash: path.includes('#') ? path.split('#')[1] : undefined,
});
}

Expand All @@ -77,7 +79,7 @@ export async function navigateToApps(log: ToolingLog, options: NavigationOptions
const devToolsResponses: NavigationResults = new Map();
const apps = [
{ path: 'app/kibana#/discover', locator: '[data-test-subj="discover-sidebar"]' },
{ path: '/app/home', locator: '[data-test-subj="homeApp"]' },
{ path: '/app/kibana#/home', locator: '[data-test-subj="homeApp"]' },
{ path: '/app/canvas', locator: '[data-test-subj="create-workpad-button"]' },
{ path: '/app/maps', locator: '[title="Maps"]' },
{ path: '/app/apm', locator: '[data-test-subj="apmMainContainer"]' },
Expand Down

0 comments on commit 9402cfa

Please sign in to comment.