@@ -39,63 +39,67 @@ sentryTest('should mask input initial value and its changes', async ({ getLocalT
39
39
40
40
const text = 'test' ;
41
41
42
- await page . locator ( '#input' ) . type ( text ) ;
42
+ page . on ( 'console' , message => console . log ( message . text ( ) ) )
43
+ await page . locator ( '#input' ) . type ( text , { timeout : 5000 } ) ;
43
44
await forceFlushReplay ( ) ;
44
45
const snapshots = getIncrementalRecordingSnapshots ( await reqPromise1 ) . filter ( isInputMutation ) ;
45
46
const lastSnapshot = snapshots [ snapshots . length - 1 ] ;
46
47
expect ( lastSnapshot . text ) . toBe ( text ) ;
47
48
48
- await page . locator ( '#input-masked' ) . type ( text ) ;
49
+ await page . locator ( '#input-masked' ) . type ( text , { timeout : 5000 } ) ;
49
50
await forceFlushReplay ( ) ;
50
51
const snapshots2 = getIncrementalRecordingSnapshots ( await reqPromise2 ) . filter ( isInputMutation ) ;
51
52
const lastSnapshot2 = snapshots2 [ snapshots2 . length - 1 ] ;
52
53
expect ( lastSnapshot2 . text ) . toBe ( '*' . repeat ( text . length ) ) ;
53
54
54
- await page . locator ( '#input-ignore' ) . type ( text ) ;
55
+ await page . locator ( '#input-ignore' ) . type ( text , { timeout : 5000 } ) ;
55
56
await forceFlushReplay ( ) ;
56
57
const snapshots3 = getIncrementalRecordingSnapshots ( await reqPromise3 ) . filter ( isInputMutation ) ;
57
58
expect ( snapshots3 . length ) . toBe ( 0 ) ;
58
59
} ) ;
59
60
60
- sentryTest ( 'should mask textarea initial value and its changes' , async ( { getLocalTestPath, forceFlushReplay, page } ) => {
61
- if ( shouldSkipReplayTest ( ) ) {
62
- sentryTest . skip ( ) ;
63
- }
64
-
65
- const reqPromise0 = waitForReplayRequest ( page , 0 ) ;
66
- const reqPromise1 = waitForReplayRequest ( page , 1 ) ;
67
- const reqPromise2 = waitForReplayRequest ( page , 2 ) ;
68
- const reqPromise3 = waitForReplayRequest ( page , 3 ) ;
69
-
70
- await page . route ( 'https://dsn.ingest.sentry.io/**/*' , route => {
71
- return route . fulfill ( {
72
- status : 200 ,
73
- contentType : 'application/json' ,
74
- body : JSON . stringify ( { id : 'test-id' } ) ,
61
+ sentryTest (
62
+ 'should mask textarea initial value and its changes' ,
63
+ async ( { getLocalTestPath, forceFlushReplay, page } ) => {
64
+ if ( shouldSkipReplayTest ( ) ) {
65
+ sentryTest . skip ( ) ;
66
+ }
67
+
68
+ const reqPromise0 = waitForReplayRequest ( page , 0 ) ;
69
+ const reqPromise1 = waitForReplayRequest ( page , 1 ) ;
70
+ const reqPromise2 = waitForReplayRequest ( page , 2 ) ;
71
+ const reqPromise3 = waitForReplayRequest ( page , 3 ) ;
72
+
73
+ await page . route ( 'https://dsn.ingest.sentry.io/**/*' , route => {
74
+ return route . fulfill ( {
75
+ status : 200 ,
76
+ contentType : 'application/json' ,
77
+ body : JSON . stringify ( { id : 'test-id' } ) ,
78
+ } ) ;
75
79
} ) ;
76
- } ) ;
77
80
78
- const url = await getLocalTestPath ( { testDir : __dirname } ) ;
81
+ const url = await getLocalTestPath ( { testDir : __dirname } ) ;
79
82
80
- await page . goto ( url ) ;
83
+ await page . goto ( url ) ;
81
84
82
- await reqPromise0 ;
85
+ await reqPromise0 ;
83
86
84
- const text = 'test' ;
85
- await page . locator ( '#textarea' ) . type ( text ) ;
86
- await forceFlushReplay ( ) ;
87
- const snapshots = getIncrementalRecordingSnapshots ( await reqPromise1 ) . filter ( isInputMutation ) ;
88
- const lastSnapshot = snapshots [ snapshots . length - 1 ] ;
89
- expect ( lastSnapshot . text ) . toBe ( text ) ;
87
+ const text = 'test' ;
88
+ await page . locator ( '#textarea' ) . type ( text , { timeout : 5000 } ) ;
89
+ await forceFlushReplay ( ) ;
90
+ const snapshots = getIncrementalRecordingSnapshots ( await reqPromise1 ) . filter ( isInputMutation ) ;
91
+ const lastSnapshot = snapshots [ snapshots . length - 1 ] ;
92
+ expect ( lastSnapshot . text ) . toBe ( text ) ;
90
93
91
- await page . locator ( '#textarea-masked' ) . type ( text ) ;
92
- await forceFlushReplay ( ) ;
93
- const snapshots2 = getIncrementalRecordingSnapshots ( await reqPromise2 ) . filter ( isInputMutation ) ;
94
- const lastSnapshot2 = snapshots2 [ snapshots2 . length - 1 ] ;
95
- expect ( lastSnapshot2 . text ) . toBe ( '*' . repeat ( text . length ) ) ;
94
+ await page . locator ( '#textarea-masked' ) . type ( text , { timeout : 5000 } ) ;
95
+ await forceFlushReplay ( ) ;
96
+ const snapshots2 = getIncrementalRecordingSnapshots ( await reqPromise2 ) . filter ( isInputMutation ) ;
97
+ const lastSnapshot2 = snapshots2 [ snapshots2 . length - 1 ] ;
98
+ expect ( lastSnapshot2 . text ) . toBe ( '*' . repeat ( text . length ) ) ;
96
99
97
- await page . locator ( '#textarea-ignore' ) . type ( text ) ;
98
- await forceFlushReplay ( ) ;
99
- const snapshots3 = getIncrementalRecordingSnapshots ( await reqPromise3 ) . filter ( isInputMutation ) ;
100
- expect ( snapshots3 . length ) . toBe ( 0 ) ;
101
- } ) ;
100
+ await page . locator ( '#textarea-ignore' ) . type ( text , { timeout : 5000 } ) ;
101
+ await forceFlushReplay ( ) ;
102
+ const snapshots3 = getIncrementalRecordingSnapshots ( await reqPromise3 ) . filter ( isInputMutation ) ;
103
+ expect ( snapshots3 . length ) . toBe ( 0 ) ;
104
+ } ,
105
+ ) ;
0 commit comments