From 7b174cd0f29c05f1767399d29b9f95c7541f140f Mon Sep 17 00:00:00 2001 From: Ryan Rosello Date: Wed, 3 Jul 2024 20:52:30 +1000 Subject: [PATCH] feat(trace-viewer) add request urls for actions initiated via APIRequestContext --- packages/trace-viewer/src/ui/actionList.tsx | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/packages/trace-viewer/src/ui/actionList.tsx b/packages/trace-viewer/src/ui/actionList.tsx index 886df28a4c..edbec8b788 100644 --- a/packages/trace-viewer/src/ui/actionList.tsx +++ b/packages/trace-viewer/src/ui/actionList.tsx @@ -102,6 +102,7 @@ export const renderAction = ( {action.apiName} {locator &&
{locator}
} {action.method === 'goto' && action.params.url &&
{action.params.url}
} + {action.class === 'APIRequestContext' && action.params.url &&
{excludeBaseUrl(action.params.url)}
} {(showDuration || showBadges) &&
} {showDuration &&
{time || }
} @@ -111,3 +112,8 @@ export const renderAction = ( } ; }; + +function excludeBaseUrl(url: string): string { + const match = url.match(/^(https?:\/\/[^/]+)(.*)$/); + return match ? match[2] : url; +} \ No newline at end of file