File tree Expand file tree Collapse file tree 2 files changed +13
-8
lines changed
packages/browser-integration-tests/suites/replay/largeMutations Expand file tree Collapse file tree 2 files changed +13
-8
lines changed Original file line number Diff line number Diff line change @@ -20,9 +20,12 @@ sentryTest(
2020
2121 const url = await getLocalTestPath ( { testDir : __dirname } ) ;
2222
23- const [ res0 ] = await Promise . all ( [ waitForReplayRequest ( page , 0 ) , page . goto ( url ) ] ) ;
24- // Ensure LCP is captured
25- await Promise . all ( [ waitForReplayRequest ( page ) , page . click ( '#noop' ) ] ) ;
23+ // We have to click in order to ensure the LCP is generated, leading to consistent results
24+ async function gotoPageAndClick ( ) {
25+ await page . goto ( url ) ;
26+ await page . click ( '#noop' ) ;
27+ }
28+ const [ res0 ] = await Promise . all ( [ waitForReplayRequest ( page , 0 ) , gotoPageAndClick ( ) ] ) ;
2629 await forceFlushReplay ( ) ;
2730
2831 const [ res1 ] = await Promise . all ( [ waitForReplayRequest ( page ) , page . click ( '#button-add' ) ] ) ;
@@ -40,7 +43,6 @@ sentryTest(
4043 const replayData3 = getReplayRecordingContent ( res3 ) ;
4144
4245 expect ( replayData0 . fullSnapshots . length ) . toBe ( 1 ) ;
43- expect ( replayData0 . incrementalSnapshots . length ) . toBe ( 0 ) ;
4446
4547 expect ( replayData1 . fullSnapshots . length ) . toBe ( 0 ) ;
4648 expect ( replayData1 . incrementalSnapshots . length ) . toBeGreaterThan ( 0 ) ;
Original file line number Diff line number Diff line change @@ -25,9 +25,13 @@ sentryTest(
2525
2626 const url = await getLocalTestPath ( { testDir : __dirname } ) ;
2727
28- const [ res0 ] = await Promise . all ( [ waitForReplayRequest ( page , 0 ) , page . goto ( url ) ] ) ;
29- // Ensure LCP is captured
30- await Promise . all ( [ waitForReplayRequest ( page ) , page . click ( '#noop' ) ] ) ;
28+ // We have to click in order to ensure the LCP is generated, leading to consistent results
29+ async function gotoPageAndClick ( ) {
30+ await page . goto ( url ) ;
31+ await page . click ( '#noop' ) ;
32+ }
33+
34+ const [ res0 ] = await Promise . all ( [ waitForReplayRequest ( page , 0 ) , gotoPageAndClick ( ) ] ) ;
3135 await forceFlushReplay ( ) ;
3236
3337 const [ res1 ] = await Promise . all ( [ waitForReplayRequest ( page ) , page . click ( '#button-add' ) ] ) ;
@@ -46,7 +50,6 @@ sentryTest(
4650
4751 const replayData0 = getReplayRecordingContent ( res0 ) ;
4852 expect ( replayData0 . fullSnapshots . length ) . toBe ( 1 ) ;
49- expect ( replayData0 . incrementalSnapshots . length ) . toBe ( 0 ) ;
5053
5154 // Breadcrumbs (click and mutation);
5255 const replayData1 = getReplayRecordingContent ( res1 ) ;
You can’t perform that action at this time.
0 commit comments