-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
test(replay): Test that blocking elements works as expected #7201
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add a .gitginore to ensure this is not accidentally checked in.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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... |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
m/h: Two things here:
replayHelpers.ts
has 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 usegetFullRecordingSnapshot
orgetReplayRecordingContent
here.- Let's use the
normalize
helper 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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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 📦
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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
head
tag.(Note that it does, this is just to ensure it stays that way).
See #7184