@@ -69,49 +69,51 @@ sentryTest(
6969 } ,
7070) ;
7171
72- sentryTest (
73- '[session-mode] replay event should not contain an error id of a dropped error while recording' ,
74- async ( { getLocalTestPath, page } ) => {
75- if ( shouldSkipReplayTest ( ) ) {
76- sentryTest . skip ( ) ;
77- }
72+ for ( let i = 0 ; i < 100 ; i ++ ) {
73+ sentryTest (
74+ `[session-mode] replay event should not contain an error id of a dropped error while recording RUN ${ i } ` ,
75+ async ( { getLocalTestPath, page } ) => {
76+ if ( shouldSkipReplayTest ( ) ) {
77+ sentryTest . skip ( ) ;
78+ }
7879
79- const reqPromise0 = waitForReplayRequest ( page , 0 ) ;
80- const reqPromise1 = waitForReplayRequest ( page , 1 ) ;
80+ const reqPromise0 = waitForReplayRequest ( page , 0 ) ;
81+ const reqPromise1 = waitForReplayRequest ( page , 1 ) ;
8182
82- await page . route ( 'https://dsn.ingest.sentry.io/**/*' , route => {
83- return route . fulfill ( {
84- status : 200 ,
85- contentType : 'application/json' ,
86- body : JSON . stringify ( { id : 'test-id' } ) ,
83+ await page . route ( 'https://dsn.ingest.sentry.io/**/*' , route => {
84+ return route . fulfill ( {
85+ status : 200 ,
86+ contentType : 'application/json' ,
87+ body : JSON . stringify ( { id : 'test-id' } ) ,
88+ } ) ;
8789 } ) ;
88- } ) ;
89-
90- const url = await getLocalTestPath ( { testDir : __dirname } ) ;
91-
92- await page . goto ( url ) ;
93- await page . click ( '#go-background' ) ;
94- await reqPromise0 ;
9590
96- await page . click ( '#drop' ) ;
97- await page . click ( '#go-background' ) ;
98- const req1 = await reqPromise1 ;
99-
100- const event1 = getReplayEvent ( req1 ) ;
101- const content1 = getReplayRecordingContent ( req1 ) ;
102-
103- expect ( event1 ) . toEqual (
104- getExpectedReplayEvent ( {
105- replay_start_timestamp : undefined ,
106- segment_id : 1 ,
107- error_ids : [ ] , // <-- no error id
108- urls : [ ] ,
109- } ) ,
110- ) ;
111-
112- // The button click that triggered the error should still be recorded
113- expect ( content1 . breadcrumbs ) . toEqual (
114- expect . arrayContaining ( [ { ...expectedClickBreadcrumb , message : 'body > button#drop' } ] ) ,
115- ) ;
116- } ,
117- ) ;
91+ const url = await getLocalTestPath ( { testDir : __dirname } ) ;
92+
93+ await page . goto ( url ) ;
94+ await page . click ( '#go-background' ) ;
95+ await reqPromise0 ;
96+
97+ await page . click ( '#drop' ) ;
98+ await page . click ( '#go-background' ) ;
99+ const req1 = await reqPromise1 ;
100+
101+ const event1 = getReplayEvent ( req1 ) ;
102+ const content1 = getReplayRecordingContent ( req1 ) ;
103+
104+ expect ( event1 ) . toEqual (
105+ getExpectedReplayEvent ( {
106+ replay_start_timestamp : undefined ,
107+ segment_id : 1 ,
108+ error_ids : [ ] , // <-- no error id
109+ urls : [ ] ,
110+ } ) ,
111+ ) ;
112+
113+ // The button click that triggered the error should still be recorded
114+ expect ( content1 . breadcrumbs ) . toEqual (
115+ expect . arrayContaining ( [ { ...expectedClickBreadcrumb , message : 'body > button#drop' } ] ) ,
116+ ) ;
117+ } ,
118+ ) ;
119+ }
0 commit comments