test(replay): Test that blocking elements works as expected#7201
test(replay): Test that blocking elements works as expected#7201
Conversation
Replay SDK metrics 🚀
develop |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Revision | LCP | CLS | CPU | JS heap avg | JS heap max | netTx | netRx | netCount | netTime |
|---|---|---|---|---|---|---|---|---|---|
| 79babe9 | +58.69 ms | -0.00 ms | +4.40 pp | +927.46 kB | +1.06 MB | +2.23 kB | +41 B | +1 | +103.20 ms |
| 5359ba9 | +55.62 ms | -0.00 ms | +4.29 pp | +935.26 kB | +1.05 MB | +2.2 kB | +41 B | +1 | +79.05 ms |
Last updated: Thu, 16 Feb 2023 12:21:31 GMT
|
@mydea FWIW I just ran |
|
OK, now I re-ran it and it is correct again. Maybe a chrome update or something like this... |
146a0ca to
6bf9653
Compare
| @@ -0,0 +1 @@ | |||
| test-results | |||
There was a problem hiding this comment.
Add a .gitginore to ensure this is not accidentally checked in.
There was a problem hiding this comment.
Good idea, also saw this folder floating around recently
|
Hmm, now I get some other failures due to different value rounding of attributes 😬 TBH not quite sure how to make this more robust... |
Lms24
left a comment
There was a problem hiding this comment.
Generally this looks good to me but I have some thoughts around getting the snapshot and normalizing it.
| @@ -0,0 +1 @@ | |||
| test-results | |||
There was a problem hiding this comment.
Good idea, also saw this folder floating around recently
| const replayPayload = envelopeRequestParser<RecordingEvent[]>(await reqPromise0, 5); | ||
| const checkoutEvent = replayPayload.find(({ type }) => type === EventType.FullSnapshot); | ||
|
|
||
| expect(JSON.stringify(checkoutEvent?.data, null, 2)).toMatchSnapshot('privacy.json'); |
There was a problem hiding this comment.
m/h: Two things here:
replayHelpers.tshas two functions, we can use to obtain the snapshot without having to manually call the envelope parser. This will also ensure that getting the snapshot works if we enabled compression ininit.js. Let's either usegetFullRecordingSnapshotorgetReplayRecordingContenthere.- Let's use the
normalizehelper function I added to stringify the snapshot. I suggest we update the normalize function to treat the pixel/size values as they're apparently flakey. Maybe, it's enough to round them to the closes integer or we might even need to hard-redact them (like the time offset in incremental snapshots).
I've been meaning to go over the tests we added before we merged all these helpers and adjust them but didn't get to it yet. Would be great if we could adjust these two tests.
There was a problem hiding this comment.
ah, thats great! I'll look into this then, thanks a lot.
WIP ? WIP? add .gitginore
Allow to normalize number attributes to make it a bit less flaky
6bf9653 to
a8c3c1b
Compare
|
So I've updated this to use |
size-limit report 📦
|
Lms24
left a comment
There was a problem hiding this comment.
Nice, let's go with this number normalization approach. LGTM!
This adds a test to verify that blocking elements manually works as expected. Esp. also blocking stuff in the
headtag.(Note that it does, this is just to ensure it stays that way).
See #7184