@@ -57,22 +57,24 @@ sentryTest(
57
57
const url = await getLocalTestPath ( { testDir : __dirname } ) ;
58
58
59
59
await page . goto ( url ) ;
60
- const fullSnapshot = getFullRecordingSnapshots ( await reqPromise0 ) ;
60
+
61
+ const text = 'test' ;
62
+
63
+ const [ req0 ] = await Promise . all ( [ reqPromise0 , page . locator ( '#input' ) . fill ( text ) ] ) ;
64
+ await forceFlushReplay ( ) ;
65
+
66
+ const fullSnapshot = getFullRecordingSnapshots ( req0 ) ;
61
67
const stringifiedSnapshot = JSON . stringify ( fullSnapshot ) ;
62
68
expect ( stringifiedSnapshot . includes ( 'Submit form' ) ) . toBe ( false ) ;
63
69
expect ( stringifiedSnapshot . includes ( 'Unmasked button' ) ) . toBe ( true ) ;
64
70
65
- const text = 'test' ;
66
-
67
- await page . locator ( '#input' ) . fill ( text ) ;
71
+ const [ req1 ] = await Promise . all ( [ reqPromise1 , page . locator ( '#input-unmasked' ) . fill ( text ) ] ) ;
68
72
await forceFlushReplay ( ) ;
69
73
70
- const snapshots = getIncrementalRecordingSnapshots ( await reqPromise1 ) . filter ( isInputMutation ) ;
74
+ const snapshots = getIncrementalRecordingSnapshots ( req1 ) . filter ( isInputMutation ) ;
71
75
const lastSnapshot = snapshots [ snapshots . length - 1 ] ;
72
76
expect ( lastSnapshot . data . text ) . toBe ( '*' . repeat ( text . length ) ) ;
73
77
74
- await page . locator ( '#input-unmasked' ) . fill ( text ) ;
75
- await forceFlushReplay ( ) ;
76
78
const snapshots2 = getIncrementalRecordingSnapshots ( await reqPromise2 ) . filter ( isInputMutation ) ;
77
79
const lastSnapshot2 = snapshots2 [ snapshots2 . length - 1 ] ;
78
80
expect ( lastSnapshot2 . data . text ) . toBe ( text ) ;
@@ -120,18 +122,18 @@ sentryTest(
120
122
121
123
await page . goto ( url ) ;
122
124
123
- await reqPromise0 ;
124
-
125
125
const text = 'test' ;
126
126
127
- await page . locator ( '#textarea' ) . fill ( text ) ;
127
+ await Promise . all ( [ reqPromise0 , page . locator ( '#textarea' ) . fill ( text ) ] ) ;
128
+ await forceFlushReplay ( ) ;
129
+
130
+ const [ req1 ] = await Promise . all ( [ reqPromise1 , page . locator ( '#textarea-unmasked' ) . fill ( text ) ] ) ;
128
131
await forceFlushReplay ( ) ;
129
- const snapshots = getIncrementalRecordingSnapshots ( await reqPromise1 ) . filter ( isInputMutation ) ;
132
+
133
+ const snapshots = getIncrementalRecordingSnapshots ( req1 ) . filter ( isInputMutation ) ;
130
134
const lastSnapshot = snapshots [ snapshots . length - 1 ] ;
131
135
expect ( lastSnapshot . data . text ) . toBe ( '*' . repeat ( text . length ) ) ;
132
136
133
- await page . locator ( '#textarea-unmasked' ) . fill ( text ) ;
134
- await forceFlushReplay ( ) ;
135
137
const snapshots2 = getIncrementalRecordingSnapshots ( await reqPromise2 ) . filter ( isInputMutation ) ;
136
138
const lastSnapshot2 = snapshots2 [ snapshots2 . length - 1 ] ;
137
139
expect ( lastSnapshot2 . data . text ) . toBe ( text ) ;
0 commit comments