✅ [PANA-6831] Support the Change data format in E2E tests#4447
Open
Conversation
|
✨ Fix all issues with BitsAI or with Cursor
|
Bundles Sizes Evolution
🚀 CPU Performance
🧠 Memory Performance
|
5 tasks
5 tasks
85031ef to
3ac1d97
Compare
5 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation
As we transition away from the old V1 session replay data format and to the new Change format, we need to update all tests to support both formats. (Eventually, we'll remove the V1 tests, but we're not quite there yet.) The E2E tests currently don't support the Change data format, so we need to update them.
Changes
This PR updates all recording E2E tests that involve DOM mutations to support both the V1 and Change data formats.
I used one of two strategies.
For tests which involve nothing but full or incremental DOM mutations, I split the test into two totally separate implementations, one for the V1 format and one for the Change format. I switched to a snapshot testing model for the Change format implementation; my experience is that for these kinds of data format tests, this approach is the most effective at catching bugs and makes maintenance easy.
Some tests involve a mix of DOM mutations and other kinds of incremental mutations. Because only DOM mutations have been converted to use the new Change format, these tests mix together records with very different formats. This makes snapshot testing a bit awkward for now; it's easier to write specific assertions. For these tests, I used a unified implementation for both the V1 and Change formats, and relied on helpers that have different code paths internally to support both cases.
Checklist