@@ -76,7 +76,7 @@ sentryTest('error during navigation has new navigation traceId', async ({ getLoc
76
76
77
77
const url = await getLocalTestPath ( { testDir : __dirname } ) ;
78
78
79
- // ensure navigation transaction is finished
79
+ // ensure pageload transaction is finished
80
80
await getFirstSentryEnvelopeRequest < Event > ( page , url ) ;
81
81
82
82
const envelopeRequestsPromise = getMultipleSentryEnvelopeRequests < Event > ( page , 2 ) ;
@@ -112,7 +112,7 @@ sentryTest(
112
112
113
113
const url = await getLocalTestPath ( { testDir : __dirname } ) ;
114
114
115
- // ensure navigation transaction is finished
115
+ // ensure pageload transaction is finished
116
116
await getFirstSentryEnvelopeRequest < Event > ( page , url ) ;
117
117
118
118
const navigationEvent = await getFirstSentryEnvelopeRequest < Event > ( page , `${ url } #foo` ) ;
@@ -148,7 +148,7 @@ sentryTest(
148
148
149
149
const url = await getLocalTestPath ( { testDir : __dirname } ) ;
150
150
151
- // ensure navigation transaction is finished
151
+ // ensure pageload transaction is finished
152
152
await getFirstSentryEnvelopeRequest < Event > ( page , url ) ;
153
153
154
154
const navigationEventPromise = getFirstSentryEnvelopeRequest < Event > ( page ) ;
@@ -185,7 +185,7 @@ sentryTest(
185
185
186
186
const url = await getLocalTestPath ( { testDir : __dirname } ) ;
187
187
188
- // ensure navigation transaction is finished
188
+ // ensure pageload transaction is finished
189
189
await getFirstSentryEnvelopeRequest < Event > ( page , url ) ;
190
190
191
191
const navigationEvent = await getFirstSentryEnvelopeRequest < Event > ( page , `${ url } #foo` ) ;
@@ -221,7 +221,7 @@ sentryTest(
221
221
222
222
const url = await getLocalTestPath ( { testDir : __dirname } ) ;
223
223
224
- // ensure navigation transaction is finished
224
+ // ensure pageload transaction is finished
225
225
await getFirstSentryEnvelopeRequest < Event > ( page , url ) ;
226
226
227
227
const navigationEventPromise = getFirstSentryEnvelopeRequest < Event > ( page ) ;
@@ -247,3 +247,45 @@ sentryTest(
247
247
) ;
248
248
} ,
249
249
) ;
250
+
251
+ sentryTest (
252
+ 'user feedback event after navigation has navigation traceId in headers' ,
253
+ async ( { getLocalTestPath, page } ) => {
254
+ if ( shouldSkipTracingTest ( ) ) {
255
+ sentryTest . skip ( ) ;
256
+ }
257
+
258
+ const url = await getLocalTestPath ( { testDir : __dirname } ) ;
259
+
260
+ // ensure pageload transaction is finished
261
+ await getFirstSentryEnvelopeRequest < Event > ( page , url ) ;
262
+
263
+ const navigationEvent = await getFirstSentryEnvelopeRequest < Event > ( page , `${ url } #foo` ) ;
264
+
265
+ const navigationTraceContext = navigationEvent . contexts ?. trace ;
266
+ expect ( navigationTraceContext ) . toMatchObject ( {
267
+ op : 'navigation' ,
268
+ trace_id : expect . stringMatching ( / ^ [ 0 - 9 a - f ] { 32 } $ / ) ,
269
+ span_id : expect . stringMatching ( / ^ [ 0 - 9 a - f ] { 16 } $ / ) ,
270
+ } ) ;
271
+ expect ( navigationTraceContext ) . not . toHaveProperty ( 'parent_span_id' ) ;
272
+
273
+ const feedbackEventPromise = getFirstSentryEnvelopeRequest < Event > ( page ) ;
274
+
275
+ await page . getByText ( 'Report a Bug' ) . click ( ) ;
276
+ expect ( await page . locator ( ':visible:text-is("Report a Bug")' ) . count ( ) ) . toEqual ( 1 ) ;
277
+ await page . locator ( '[name="name"]' ) . fill ( 'Jane Doe' ) ;
278
+ await page . locator ( '[name="email"]' ) . fill ( '[email protected] ' ) ;
279
+ await page . locator ( '[name="message"]' ) . fill ( 'my example feedback' ) ;
280
+ await page . locator ( '[data-sentry-feedback] .btn--primary' ) . click ( ) ;
281
+
282
+ const feedbackEvent = await feedbackEventPromise ;
283
+ const feedbackTraceContext = feedbackEvent . contexts ?. trace ;
284
+
285
+ expect ( feedbackTraceContext ) . toMatchObject ( {
286
+ op : 'navigation' ,
287
+ trace_id : navigationTraceContext ?. trace_id ,
288
+ span_id : expect . stringMatching ( / ^ [ 0 - 9 a - f ] { 16 } $ / ) ,
289
+ } ) ;
290
+ } ,
291
+ ) ;
0 commit comments