1
1
import { expect } from '@playwright/test' ;
2
2
3
3
import { sentryTest } from '../../../utils/fixtures' ;
4
+ import { envelopeRequestParser } from '../../../utils/helpers' ;
4
5
import { expectedFetchPerformanceSpan , expectedXHRPerformanceSpan } from '../../../utils/replayEventTemplates' ;
5
6
import { getReplayRecordingContent , shouldSkipReplayTest , waitForReplayRequest } from '../../../utils/replayHelpers' ;
6
7
@@ -14,6 +15,9 @@ for (let i = 0; i < 25; i++) {
14
15
const reqPromise1 = waitForReplayRequest ( page , 1 ) ;
15
16
16
17
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
+
17
21
return route . fulfill ( {
18
22
status : 200 ,
19
23
contentType : 'application/json' ,
@@ -22,6 +26,8 @@ for (let i = 0; i < 25; i++) {
22
26
} ) ;
23
27
24
28
await page . route ( 'https://example.com' , route => {
29
+ // eslint-disable-next-line no-console
30
+ console . log ( '>>>got request call' ) ;
25
31
return route . fulfill ( {
26
32
status : 200 ,
27
33
contentType : 'application/json' ,
@@ -52,6 +58,8 @@ for (let i = 0; i < 25; i++) {
52
58
const reqPromise1 = waitForReplayRequest ( page , 1 ) ;
53
59
54
60
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 ) ;
55
63
return route . fulfill ( {
56
64
status : 200 ,
57
65
contentType : 'application/json' ,
@@ -60,6 +68,8 @@ for (let i = 0; i < 25; i++) {
60
68
} ) ;
61
69
62
70
await page . route ( 'https://example.com' , route => {
71
+ // eslint-disable-next-line no-console
72
+ console . log ( '>>>got request call' ) ;
63
73
return route . fulfill ( {
64
74
status : 200 ,
65
75
contentType : 'application/json' ,
@@ -69,17 +79,13 @@ for (let i = 0; i < 25; i++) {
69
79
70
80
const url = await getLocalTestPath ( { testDir : __dirname } ) ;
71
81
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 ) ;
83
89
84
90
const performanceSpans = [ ...spans0 , ...spans1 ] ;
85
91
0 commit comments