@@ -4,17 +4,24 @@ import type { Event } from '@sentry/types';
4
4
import { sentryTest } from '../../../../utils/fixtures' ;
5
5
import { getFirstSentryEnvelopeRequest } from '../../../../utils/helpers' ;
6
6
7
- sentryTest ( 'should finish pageload transaction when the page goes background' , async ( { getLocalTestPath, page } ) => {
8
- const url = await getLocalTestPath ( { testDir : __dirname } ) ;
7
+ sentryTest (
8
+ 'should finish pageload transaction when the page goes background' ,
9
+ async ( { browserName, getLocalTestPath, page } ) => {
10
+ // TODO: This is flakey on firefox... trace.status is sometimes undefined
11
+ if ( [ 'firefox' ] . includes ( browserName ) ) {
12
+ sentryTest . skip ( ) ;
13
+ }
14
+ const url = await getLocalTestPath ( { testDir : __dirname } ) ;
9
15
10
- await page . goto ( url ) ;
11
- await page . click ( '#go-background' ) ;
16
+ await page . goto ( url ) ;
17
+ await page . click ( '#go-background' ) ;
12
18
13
- const pageloadTransaction = await getFirstSentryEnvelopeRequest < Event > ( page ) ;
19
+ const pageloadTransaction = await getFirstSentryEnvelopeRequest < Event > ( page ) ;
14
20
15
- expect ( pageloadTransaction . contexts ?. trace ?. op ) . toBe ( 'pageload' ) ;
16
- expect ( pageloadTransaction . contexts ?. trace ?. status ) . toBe ( 'cancelled' ) ;
17
- expect ( pageloadTransaction . contexts ?. trace ?. tags ) . toMatchObject ( {
18
- visibilitychange : 'document.hidden' ,
19
- } ) ;
20
- } ) ;
21
+ expect ( pageloadTransaction . contexts ?. trace ?. op ) . toBe ( 'pageload' ) ;
22
+ expect ( pageloadTransaction . contexts ?. trace ?. status ) . toBe ( 'cancelled' ) ;
23
+ expect ( pageloadTransaction . contexts ?. trace ?. tags ) . toMatchObject ( {
24
+ visibilitychange : 'document.hidden' ,
25
+ } ) ;
26
+ } ,
27
+ ) ;
0 commit comments