@@ -2,15 +2,20 @@ import { expect } from '@playwright/test';
22import type { Event } from '@sentry/types' ;
33
44import { sentryTest } from '../../../../utils/fixtures' ;
5- import { getFirstSentryEnvelopeRequest , shouldSkipTracingTest } from '../../../../utils/helpers' ;
5+ import {
6+ envelopeRequestParser ,
7+ shouldSkipTracingTest ,
8+ waitForTransactionRequestOnUrl ,
9+ } from '../../../../utils/helpers' ;
610
711sentryTest ( 'should send a transaction in an envelope' , async ( { getLocalTestPath, page } ) => {
812 if ( shouldSkipTracingTest ( ) ) {
913 sentryTest . skip ( ) ;
1014 }
1115
1216 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 ) ;
1419
1520 expect ( transaction . transaction ) . toBe ( 'parent_span' ) ;
1621 expect ( transaction . spans ) . toBeDefined ( ) ;
@@ -22,7 +27,8 @@ sentryTest('should report finished spans as children of the root transaction', a
2227 }
2328
2429 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 ) ;
2632
2733 expect ( transaction . spans ) . toHaveLength ( 1 ) ;
2834
0 commit comments