@@ -57,22 +57,24 @@ sentryTest(
5757 const url = await getLocalTestPath ( { testDir : __dirname } ) ;
5858
5959 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 ) ;
6167 const stringifiedSnapshot = JSON . stringify ( fullSnapshot ) ;
6268 expect ( stringifiedSnapshot . includes ( 'Submit form' ) ) . toBe ( false ) ;
6369 expect ( stringifiedSnapshot . includes ( 'Unmasked button' ) ) . toBe ( true ) ;
6470
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 ) ] ) ;
6872 await forceFlushReplay ( ) ;
6973
70- const snapshots = getIncrementalRecordingSnapshots ( await reqPromise1 ) . filter ( isInputMutation ) ;
74+ const snapshots = getIncrementalRecordingSnapshots ( req1 ) . filter ( isInputMutation ) ;
7175 const lastSnapshot = snapshots [ snapshots . length - 1 ] ;
7276 expect ( lastSnapshot . data . text ) . toBe ( '*' . repeat ( text . length ) ) ;
7377
74- await page . locator ( '#input-unmasked' ) . fill ( text ) ;
75- await forceFlushReplay ( ) ;
7678 const snapshots2 = getIncrementalRecordingSnapshots ( await reqPromise2 ) . filter ( isInputMutation ) ;
7779 const lastSnapshot2 = snapshots2 [ snapshots2 . length - 1 ] ;
7880 expect ( lastSnapshot2 . data . text ) . toBe ( text ) ;
@@ -120,18 +122,18 @@ sentryTest(
120122
121123 await page . goto ( url ) ;
122124
123- await reqPromise0 ;
124-
125125 const text = 'test' ;
126126
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 ) ] ) ;
128131 await forceFlushReplay ( ) ;
129- const snapshots = getIncrementalRecordingSnapshots ( await reqPromise1 ) . filter ( isInputMutation ) ;
132+
133+ const snapshots = getIncrementalRecordingSnapshots ( req1 ) . filter ( isInputMutation ) ;
130134 const lastSnapshot = snapshots [ snapshots . length - 1 ] ;
131135 expect ( lastSnapshot . data . text ) . toBe ( '*' . repeat ( text . length ) ) ;
132136
133- await page . locator ( '#textarea-unmasked' ) . fill ( text ) ;
134- await forceFlushReplay ( ) ;
135137 const snapshots2 = getIncrementalRecordingSnapshots ( await reqPromise2 ) . filter ( isInputMutation ) ;
136138 const lastSnapshot2 = snapshots2 [ snapshots2 . length - 1 ] ;
137139 expect ( lastSnapshot2 . data . text ) . toBe ( text ) ;
0 commit comments