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(
20
20
21
21
const url = await getLocalTestPath ( { testDir : __dirname } ) ;
22
22
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 ( ) ] ) ;
26
29
await forceFlushReplay ( ) ;
27
30
28
31
const [ res1 ] = await Promise . all ( [ waitForReplayRequest ( page ) , page . click ( '#button-add' ) ] ) ;
@@ -40,7 +43,6 @@ sentryTest(
40
43
const replayData3 = getReplayRecordingContent ( res3 ) ;
41
44
42
45
expect ( replayData0 . fullSnapshots . length ) . toBe ( 1 ) ;
43
- expect ( replayData0 . incrementalSnapshots . length ) . toBe ( 0 ) ;
44
46
45
47
expect ( replayData1 . fullSnapshots . length ) . toBe ( 0 ) ;
46
48
expect ( replayData1 . incrementalSnapshots . length ) . toBeGreaterThan ( 0 ) ;
Original file line number Diff line number Diff line change @@ -25,9 +25,13 @@ sentryTest(
25
25
26
26
const url = await getLocalTestPath ( { testDir : __dirname } ) ;
27
27
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 ( ) ] ) ;
31
35
await forceFlushReplay ( ) ;
32
36
33
37
const [ res1 ] = await Promise . all ( [ waitForReplayRequest ( page ) , page . click ( '#button-add' ) ] ) ;
@@ -46,7 +50,6 @@ sentryTest(
46
50
47
51
const replayData0 = getReplayRecordingContent ( res0 ) ;
48
52
expect ( replayData0 . fullSnapshots . length ) . toBe ( 1 ) ;
49
- expect ( replayData0 . incrementalSnapshots . length ) . toBe ( 0 ) ;
50
53
51
54
// Breadcrumbs (click and mutation);
52
55
const replayData1 = getReplayRecordingContent ( res1 ) ;
You can’t perform that action at this time.
0 commit comments