@@ -262,4 +262,53 @@ test.describe('nested SSR routes (client, server, server request)', () => {
262262 request : { url : expect . stringContaining ( '/api/user/myUsername123.json' ) } ,
263263 } ) ;
264264 } ) ;
265+
266+ test ( 'sends parametrized pageload and server transaction names for catch-all routes' , async ( { page } ) => {
267+ const clientPageloadTxnPromise = waitForTransaction ( 'astro-5' , txnEvent => {
268+ return txnEvent ?. transaction ?. startsWith ( '/catchAll/' ) ?? false ;
269+ } ) ;
270+
271+ const serverPageRequestTxnPromise = waitForTransaction ( 'astro-5' , txnEvent => {
272+ return txnEvent ?. transaction ?. startsWith ( 'GET /catchAll/' ) ?? false ;
273+ } ) ;
274+
275+ await page . goto ( '/catchAll/hell0/whatever-do' ) ;
276+
277+ const clientPageloadTxn = await clientPageloadTxnPromise ;
278+ const serverPageRequestTxn = await serverPageRequestTxnPromise ;
279+
280+ expect ( clientPageloadTxn ) . toMatchObject ( {
281+ transaction : '/catchAll/hell0/whatever-do' , // todo: parametrize to '/catchAll/[...path]'
282+ transaction_info : { source : 'url' } ,
283+ contexts : {
284+ trace : {
285+ op : 'pageload' ,
286+ origin : 'auto.pageload.browser' ,
287+ data : {
288+ 'sentry.op' : 'pageload' ,
289+ 'sentry.origin' : 'auto.pageload.browser' ,
290+ 'sentry.source' : 'url' ,
291+ } ,
292+ } ,
293+ } ,
294+ } ) ;
295+
296+ expect ( serverPageRequestTxn ) . toMatchObject ( {
297+ transaction : 'GET /catchAll/[path]' ,
298+ transaction_info : { source : 'route' } ,
299+ contexts : {
300+ trace : {
301+ op : 'http.server' ,
302+ origin : 'auto.http.astro' ,
303+ data : {
304+ 'sentry.op' : 'http.server' ,
305+ 'sentry.origin' : 'auto.http.astro' ,
306+ 'sentry.source' : 'route' ,
307+ url : expect . stringContaining ( '/catchAll/hell0/whatever-do' ) ,
308+ } ,
309+ } ,
310+ } ,
311+ request : { url : expect . stringContaining ( '/catchAll/hell0/whatever-do' ) } ,
312+ } ) ;
313+ } ) ;
265314} ) ;
0 commit comments