@@ -2,15 +2,20 @@ import { expect } from '@playwright/test';
2
2
import type { Event } from '@sentry/types' ;
3
3
4
4
import { sentryTest } from '../../../../utils/fixtures' ;
5
- import { getFirstSentryEnvelopeRequest , shouldSkipTracingTest } from '../../../../utils/helpers' ;
5
+ import {
6
+ envelopeRequestParser ,
7
+ shouldSkipTracingTest ,
8
+ waitForTransactionRequestOnUrl ,
9
+ } from '../../../../utils/helpers' ;
6
10
7
11
sentryTest ( 'should send a transaction in an envelope' , async ( { getLocalTestPath, page } ) => {
8
12
if ( shouldSkipTracingTest ( ) ) {
9
13
sentryTest . skip ( ) ;
10
14
}
11
15
12
16
const url = await getLocalTestPath ( { testDir : __dirname } ) ;
13
- const transaction = await getFirstSentryEnvelopeRequest < Event > ( page , url ) ;
17
+ const req = await waitForTransactionRequestOnUrl ( page , url ) ;
18
+ const transaction = envelopeRequestParser ( req ) ;
14
19
15
20
expect ( transaction . transaction ) . toBe ( 'parent_span' ) ;
16
21
expect ( transaction . spans ) . toBeDefined ( ) ;
@@ -22,7 +27,8 @@ sentryTest('should report finished spans as children of the root transaction', a
22
27
}
23
28
24
29
const url = await getLocalTestPath ( { testDir : __dirname } ) ;
25
- const transaction = await getFirstSentryEnvelopeRequest < Event > ( page , url ) ;
30
+ const req = await waitForTransactionRequestOnUrl ( page , url ) ;
31
+ const transaction = envelopeRequestParser ( req ) ;
26
32
27
33
expect ( transaction . spans ) . toHaveLength ( 1 ) ;
28
34
0 commit comments