@@ -21,16 +21,6 @@ import {
2121} from '@sentry-internal/rrweb-types' ;
2222import { visitSnapshot , NodeType } from '@sentry-internal/rrweb-snapshot' ;
2323
24- /**
25- * Used to filter scroll events out of snapshots as they are flakey
26- */
27- function isNotScroll ( snapshot : eventWithTime ) {
28- return ! (
29- snapshot . type === EventType . IncrementalSnapshot &&
30- snapshot . data . source === IncrementalSource . Scroll
31- ) ;
32- }
33-
3424describe ( 'record integration tests' , function ( this : ISuite ) {
3525 jest . setTimeout ( 10_000 ) ;
3626
@@ -256,7 +246,7 @@ describe('record integration tests', function (this: ISuite) {
256246 const snapshots = ( await page . evaluate (
257247 'window.snapshots' ,
258248 ) ) as eventWithTime [ ] ;
259- assertSnapshot ( snapshots . filter ( isNotScroll ) ) ;
249+ assertSnapshot ( snapshots ) ;
260250 } ) ;
261251
262252 it ( 'can record style changes compactly and preserve css var() functions' , async ( ) => {
@@ -331,8 +321,7 @@ describe('record integration tests', function (this: ISuite) {
331321 }
332322 } ) ;
333323
334- const snapshots = await page . evaluate ( 'window.snapshots' ) ;
335- assertSnapshot ( snapshots ) ;
324+ await assertSnapshot ( page ) ;
336325
337326 const lastMutationsLength = await page . evaluate (
338327 'window.lastMutationsLength' ,
@@ -573,7 +562,6 @@ describe('record integration tests', function (this: ISuite) {
573562
574563 it ( 'should record unblocked elements that are also blocked more generically' , async ( ) => {
575564 const page : puppeteer . Page = await browser . newPage ( ) ;
576- page . on ( 'console' , ( msg ) => console . log ( msg . text ( ) ) ) ;
577565 await page . goto ( 'about:blank' ) ;
578566 const html = getHtml . call ( this , 'unblock.html' , {
579567 blockSelector : 'div' ,
@@ -610,7 +598,7 @@ describe('record integration tests', function (this: ISuite) {
610598 const snapshots = ( await page . evaluate (
611599 'window.snapshots' ,
612600 ) ) as eventWithTime [ ] ;
613- assertSnapshot ( snapshots . filter ( isNotScroll ) ) ;
601+ assertSnapshot ( snapshots ) ;
614602 } ) ;
615603
616604 it ( 'mutations should work when blocked class is unblocked' , async ( ) => {
@@ -689,7 +677,7 @@ describe('record integration tests', function (this: ISuite) {
689677 const snapshots = ( await page . evaluate (
690678 'window.snapshots' ,
691679 ) ) as eventWithTime [ ] ;
692- assertSnapshot ( snapshots . filter ( isNotScroll ) ) ;
680+ assertSnapshot ( snapshots ) ;
693681 } ) ;
694682
695683 it ( 'should record canvas mutations' , async ( ) => {
@@ -738,7 +726,7 @@ describe('record integration tests', function (this: ISuite) {
738726 const snapshots = ( await page . evaluate (
739727 'window.snapshots' ,
740728 ) ) as eventWithTime [ ] ;
741- assertSnapshot ( snapshots . filter ( isNotScroll ) ) ;
729+ assertSnapshot ( snapshots ) ;
742730 } ) ;
743731
744732 it ( 'should record textarea values if dynamically added and maskAllInputs is false' , async ( ) => {
@@ -763,7 +751,7 @@ describe('record integration tests', function (this: ISuite) {
763751 const snapshots = ( await page . evaluate (
764752 'window.snapshots' ,
765753 ) ) as eventWithTime [ ] ;
766- assertSnapshot ( snapshots . filter ( isNotScroll ) ) ;
754+ assertSnapshot ( snapshots ) ;
767755 } ) ;
768756
769757 it ( 'should not record input values if dynamically added, maskAllInputs is false, and mask selector is used' , async ( ) => {
@@ -791,7 +779,7 @@ describe('record integration tests', function (this: ISuite) {
791779 const snapshots = ( await page . evaluate (
792780 'window.snapshots' ,
793781 ) ) as eventWithTime [ ] ;
794- assertSnapshot ( snapshots . filter ( isNotScroll ) ) ;
782+ assertSnapshot ( snapshots ) ;
795783 } ) ;
796784
797785 it ( 'should not record input values if dynamically added and maskAllInputs is true' , async ( ) => {
@@ -837,7 +825,7 @@ describe('record integration tests', function (this: ISuite) {
837825 const snapshots = ( await page . evaluate (
838826 'window.snapshots' ,
839827 ) ) as eventWithTime [ ] ;
840- assertSnapshot ( snapshots . filter ( isNotScroll ) ) ;
828+ assertSnapshot ( snapshots ) ;
841829 } ) ;
842830
843831 it ( 'should record input values if dynamically added, maskAllInputs is true, and unmask selector is used' , async ( ) => {
@@ -865,7 +853,7 @@ describe('record integration tests', function (this: ISuite) {
865853 const snapshots = ( await page . evaluate (
866854 'window.snapshots' ,
867855 ) ) as eventWithTime [ ] ;
868- assertSnapshot ( snapshots . filter ( isNotScroll ) ) ;
856+ assertSnapshot ( snapshots ) ;
869857 } ) ;
870858
871859 it ( 'should record webgl canvas mutations' , async ( ) => {
@@ -1050,7 +1038,6 @@ describe('record integration tests', function (this: ISuite) {
10501038
10511039 it ( 'should record images with blob url' , async ( ) => {
10521040 const page : puppeteer . Page = await browser . newPage ( ) ;
1053- page . on ( 'console' , ( msg ) => console . log ( msg . text ( ) ) ) ;
10541041 await page . goto ( `${ serverURL } /html` ) ;
10551042 page . setContent (
10561043 getHtml . call ( this , 'image-blob-url.html' , { inlineImages : true } ) ,
@@ -1067,7 +1054,6 @@ describe('record integration tests', function (this: ISuite) {
10671054
10681055 it ( 'should record images inside iframe with blob url' , async ( ) => {
10691056 const page : puppeteer . Page = await browser . newPage ( ) ;
1070- page . on ( 'console' , ( msg ) => console . log ( msg . text ( ) ) ) ;
10711057 await page . goto ( `${ serverURL } /html` ) ;
10721058 await page . setContent (
10731059 getHtml . call ( this , 'frame-image-blob-url.html' , { inlineImages : true } ) ,
@@ -1084,7 +1070,6 @@ describe('record integration tests', function (this: ISuite) {
10841070
10851071 it ( 'should record images inside iframe with blob url after iframe was reloaded' , async ( ) => {
10861072 const page : puppeteer . Page = await browser . newPage ( ) ;
1087- page . on ( 'console' , ( msg ) => console . log ( msg . text ( ) ) ) ;
10881073 await page . goto ( `${ serverURL } /html` ) ;
10891074 await page . setContent (
10901075 getHtml . call ( this , 'frame2.html' , { inlineImages : true } ) ,
@@ -1310,13 +1295,12 @@ describe('record integration tests', function (this: ISuite) {
13101295 const snapshots = ( await page . evaluate (
13111296 'window.snapshots' ,
13121297 ) ) as eventWithTime [ ] ;
1313- assertSnapshot ( snapshots . filter ( isNotScroll ) ) ;
1298+ assertSnapshot ( snapshots ) ;
13141299 } ) ;
13151300
1316- it ( 'should record mutations in iframes accross pages' , async ( ) => {
1301+ it ( 'should record mutations in iframes across pages' , async ( ) => {
13171302 const page : puppeteer . Page = await browser . newPage ( ) ;
13181303 await page . goto ( `${ serverURL } /html` ) ;
1319- page . on ( 'console' , ( msg ) => console . log ( msg . text ( ) ) ) ;
13201304 await page . setContent ( getHtml . call ( this , 'frame2.html' ) ) ;
13211305
13221306 await page . waitForSelector ( 'iframe' ) ; // wait for iframe to get added
@@ -1475,7 +1459,9 @@ describe('record integration tests', function (this: ISuite) {
14751459 } ) ,
14761460 ) ;
14771461
1478- const snapshots = await page . evaluate ( 'window.snapshots' ) ;
1462+ const snapshots = ( await page . evaluate (
1463+ 'window.snapshots' ,
1464+ ) ) as eventWithTime [ ] ;
14791465 assertSnapshot ( snapshots ) ;
14801466 } ) ;
14811467
0 commit comments