File tree 1 file changed +17
-0
lines changed
packages/integration-tests/suites/tracing/browsertracing/source
1 file changed +17
-0
lines changed Original file line number Diff line number Diff line change
1
+ import { expect } from '@playwright/test' ;
2
+ import { Event } from '@sentry/types' ;
3
+
4
+ import { sentryTest } from '../../../../utils/fixtures' ;
5
+ import { getFirstSentryEnvelopeRequest } from '../../../../utils/helpers' ;
6
+
7
+ sentryTest ( 'transactions should contain transaction source' , async ( { getLocalTestPath, page } ) => {
8
+ const url = await getLocalTestPath ( { testDir : __dirname } ) ;
9
+
10
+ const pageloadRequest = await getFirstSentryEnvelopeRequest < Event > ( page , url ) ;
11
+ const navigationRequest = await getFirstSentryEnvelopeRequest < Event > ( page , `${ url } #foo` ) ;
12
+
13
+ expect ( pageloadRequest ) . toEqual ( { } ) ;
14
+
15
+ expect ( pageloadRequest . transaction_info ?. source ) . toEqual ( 'url' ) ;
16
+ expect ( navigationRequest . transaction_info ?. source ) . toEqual ( 'url' ) ;
17
+ } ) ;
You can’t perform that action at this time.
0 commit comments