@@ -59,23 +59,31 @@ sentryTest('paint web vitals values are greater than TTFB', async ({ browserName
59
59
expect ( fpValue ) . toBeGreaterThanOrEqual ( ttfbValue ! ) ;
60
60
} ) ;
61
61
62
- sentryTest ( 'captures time origin as span attribute' , async ( { getLocalTestPath, page } ) => {
63
- // Only run in chromium to ensure all vitals are present
64
- if ( shouldSkipTracingTest ( ) ) {
65
- sentryTest . skip ( ) ;
66
- }
62
+ sentryTest (
63
+ 'captures time origin and navigation activationStart as span attributes' ,
64
+ async ( { getLocalTestPath, page } ) => {
65
+ // Only run in chromium to ensure all vitals are present
66
+ if ( shouldSkipTracingTest ( ) ) {
67
+ sentryTest . skip ( ) ;
68
+ }
67
69
68
- const url = await getLocalTestPath ( { testDir : __dirname } ) ;
69
- const [ eventData ] = await Promise . all ( [ getFirstSentryEnvelopeRequest < Event > ( page ) , page . goto ( url ) ] ) ;
70
+ const url = await getLocalTestPath ( { testDir : __dirname } ) ;
71
+ const [ eventData ] = await Promise . all ( [ getFirstSentryEnvelopeRequest < Event > ( page ) , page . goto ( url ) ] ) ;
70
72
71
- const timeOriginAttribute = eventData . contexts ?. trace ?. data ?. [ 'performance.timeOrigin' ] ;
72
- const transactionStartTimestamp = eventData . start_timestamp ;
73
+ const timeOriginAttribute = eventData . contexts ?. trace ?. data ?. [ 'performance.timeOrigin' ] ;
74
+ const activationStart = eventData . contexts ?. trace ?. data ?. [ 'performance.activationStart' ] ;
73
75
74
- expect ( timeOriginAttribute ) . toBeDefined ( ) ;
75
- expect ( transactionStartTimestamp ) . toBeDefined ( ) ;
76
+ const transactionStartTimestamp = eventData . start_timestamp ;
76
77
77
- const delta = Math . abs ( transactionStartTimestamp ! - timeOriginAttribute ) ;
78
+ expect ( timeOriginAttribute ) . toBeDefined ( ) ;
79
+ expect ( transactionStartTimestamp ) . toBeDefined ( ) ;
78
80
79
- // The delta should be less than 1ms if this flakes, we should increase the threshold
80
- expect ( delta ) . toBeLessThanOrEqual ( 1 ) ;
81
- } ) ;
81
+ const delta = Math . abs ( transactionStartTimestamp ! - timeOriginAttribute ) ;
82
+
83
+ // The delta should be less than 1ms if this flakes, we should increase the threshold
84
+ expect ( delta ) . toBeLessThanOrEqual ( 1 ) ;
85
+
86
+ expect ( activationStart ) . toBeDefined ( ) ;
87
+ expect ( activationStart ) . toBeGreaterThanOrEqual ( 0 ) ;
88
+ } ,
89
+ ) ;
0 commit comments