@@ -26,8 +26,6 @@ test('sends a pageload transaction', async ({ page }) => {
26
26
} ) ;
27
27
28
28
test ( 'captures a distributed pageload trace' , async ( { page } ) => {
29
- await page . goto ( '/users/123xyz' ) ;
30
-
31
29
const clientTxnEventPromise = waitForTransaction ( 'sveltekit' , txnEvent => {
32
30
return txnEvent ?. transaction === '/users/[id]' ;
33
31
} ) ;
@@ -36,6 +34,8 @@ test('captures a distributed pageload trace', async ({ page }) => {
36
34
return txnEvent ?. transaction === 'GET /users/[id]' ;
37
35
} ) ;
38
36
37
+ await page . goto ( '/users/123xyz' ) ;
38
+
39
39
const [ clientTxnEvent , serverTxnEvent ] = await Promise . all ( [ clientTxnEventPromise , serverTxnEventPromise ] ) ;
40
40
41
41
expect ( clientTxnEvent ) . toMatchObject ( {
@@ -71,8 +71,6 @@ test('captures a distributed pageload trace', async ({ page }) => {
71
71
} ) ;
72
72
73
73
test ( 'captures a distributed navigation trace' , async ( { page } ) => {
74
- await waitForInitialPageload ( page ) ;
75
-
76
74
const clientNavigationTxnEventPromise = waitForTransaction ( 'sveltekit' , txnEvent => {
77
75
return txnEvent ?. transaction === '/users/[id]' ;
78
76
} ) ;
@@ -81,6 +79,8 @@ test('captures a distributed navigation trace', async ({ page }) => {
81
79
return txnEvent ?. transaction === 'GET /users/[id]' ;
82
80
} ) ;
83
81
82
+ await waitForInitialPageload ( page ) ;
83
+
84
84
// navigation to page
85
85
const clickPromise = page . getByText ( 'Route with Params' ) . click ( ) ;
86
86
0 commit comments