11import { expect } from '@playwright/test' ;
22
33import { sentryTest } from '../../../utils/fixtures' ;
4+ import { envelopeRequestParser } from '../../../utils/helpers' ;
45import { expectedFetchPerformanceSpan , expectedXHRPerformanceSpan } from '../../../utils/replayEventTemplates' ;
56import { getReplayRecordingContent , shouldSkipReplayTest , waitForReplayRequest } from '../../../utils/replayHelpers' ;
67
@@ -14,6 +15,9 @@ for (let i = 0; i < 25; i++) {
1415 const reqPromise1 = waitForReplayRequest ( page , 1 ) ;
1516
1617 await page . route ( 'https://dsn.ingest.sentry.io/**/*' , route => {
18+ // eslint-disable-next-line no-console
19+ console . log ( '>>>got request' , envelopeRequestParser ( route . request ( ) ) ?. type ) ;
20+
1721 return route . fulfill ( {
1822 status : 200 ,
1923 contentType : 'application/json' ,
@@ -22,6 +26,8 @@ for (let i = 0; i < 25; i++) {
2226 } ) ;
2327
2428 await page . route ( 'https://example.com' , route => {
29+ // eslint-disable-next-line no-console
30+ console . log ( '>>>got request call' ) ;
2531 return route . fulfill ( {
2632 status : 200 ,
2733 contentType : 'application/json' ,
@@ -52,6 +58,8 @@ for (let i = 0; i < 25; i++) {
5258 const reqPromise1 = waitForReplayRequest ( page , 1 ) ;
5359
5460 await page . route ( 'https://dsn.ingest.sentry.io/**/*' , route => {
61+ // eslint-disable-next-line no-console
62+ console . log ( '>>>got request' , envelopeRequestParser ( route . request ( ) ) ?. type ) ;
5563 return route . fulfill ( {
5664 status : 200 ,
5765 contentType : 'application/json' ,
@@ -60,6 +68,8 @@ for (let i = 0; i < 25; i++) {
6068 } ) ;
6169
6270 await page . route ( 'https://example.com' , route => {
71+ // eslint-disable-next-line no-console
72+ console . log ( '>>>got request call' ) ;
6373 return route . fulfill ( {
6474 status : 200 ,
6575 contentType : 'application/json' ,
@@ -69,17 +79,13 @@ for (let i = 0; i < 25; i++) {
6979
7080 const url = await getLocalTestPath ( { testDir : __dirname } ) ;
7181
72- const [ , , { performanceSpans : spans0 } ] = await Promise . all ( [
73- page . goto ( url ) ,
74- page . click ( '#go-background' ) ,
75- getReplayRecordingContent ( await reqPromise0 ) ,
76- ] ) ;
77-
78- const [ , , { performanceSpans : spans1 } ] = await Promise . all ( [
79- page . click ( '#xhr' ) ,
80- page . click ( '#go-background' ) ,
81- getReplayRecordingContent ( await reqPromise1 ) ,
82- ] ) ;
82+ await page . goto ( url ) ;
83+ await page . click ( '#go-background' ) ;
84+ const { performanceSpans : spans0 } = getReplayRecordingContent ( await reqPromise0 ) ;
85+
86+ await page . click ( '#xhr' ) ;
87+ await page . click ( '#go-background' ) ;
88+ const { performanceSpans : spans1 } = getReplayRecordingContent ( await reqPromise1 ) ;
8389
8490 const performanceSpans = [ ...spans0 , ...spans1 ] ;
8591
0 commit comments