@@ -4,8 +4,6 @@ import { waitForInitialPageload } from './utils';
4
4
5
5
test . describe ( 'performance events' , ( ) => {
6
6
test ( 'capture a distributed pageload trace' , async ( { page } ) => {
7
- await page . goto ( '/users/123xyz' ) ;
8
-
9
7
const clientTxnEventPromise = waitForTransaction ( 'sveltekit-2' , txnEvent => {
10
8
return txnEvent ?. transaction === '/users/[id]' ;
11
9
} ) ;
@@ -14,7 +12,8 @@ test.describe('performance events', () => {
14
12
return txnEvent ?. transaction === 'GET /users/[id]' ;
15
13
} ) ;
16
14
17
- const [ clientTxnEvent , serverTxnEvent , _ ] = await Promise . all ( [
15
+ const [ _ , clientTxnEvent , serverTxnEvent ] = await Promise . all ( [
16
+ page . goto ( '/users/123xyz' ) ,
18
17
clientTxnEventPromise ,
19
18
serverTxnEventPromise ,
20
19
expect ( page . getByText ( 'User id: 123xyz' ) ) . toBeVisible ( ) ,
@@ -56,8 +55,6 @@ test.describe('performance events', () => {
56
55
} ) ;
57
56
58
57
test ( 'capture a distributed navigation trace' , async ( { page } ) => {
59
- await waitForInitialPageload ( page ) ;
60
-
61
58
const clientNavigationTxnEventPromise = waitForTransaction ( 'sveltekit-2' , txnEvent => {
62
59
return txnEvent ?. transaction === '/users' && txnEvent . contexts ?. trace ?. op === 'navigation' ;
63
60
} ) ;
@@ -66,6 +63,8 @@ test.describe('performance events', () => {
66
63
return txnEvent ?. transaction === 'GET /users' ;
67
64
} ) ;
68
65
66
+ await waitForInitialPageload ( page ) ;
67
+
69
68
// navigation to page
70
69
const clickPromise = page . getByText ( 'Route with Server Load' ) . click ( ) ;
71
70
0 commit comments