-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Chore: Make tests less flakey & upgrade puppeteer to rrweb-snapshot test suite to run #1084
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
Merged
Merged
Changes from all commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
d3bb6fb
Upgrade puppeteer to 17.1.3 in rrweb-snapshot
Juice10 05587c1
Apply formatting changes
Juice10 483e0bb
Add ?
Juice10 2b9842d
Make tests less flakey
Juice10 39821ae
Make attribute-setting more explicit
Juice10 d6b2374
Make test less flakey
Juice10 de74a19
Make test less flakey
Juice10 c8b2da4
Upgrade puppeteer for rrdom
Juice10 875b3dc
Use wait for request animation frame instead of timeout
Juice10 7ce90b3
Force append to happen in second event
Juice10 18fec80
Wait till iframe was loaded (now 100ms)
Juice10 0ce9db9
Round the currentTime to 1 decimal place
Juice10 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
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
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
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -13,6 +13,6 @@ | |
| iframe5.id = 'five'; | ||
| setTimeout(() => { | ||
| document.body.appendChild(iframe5); | ||
| }, 10); | ||
| }, 100); | ||
| </script> | ||
| </html> | ||
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
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
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
Oops, something went wrong.
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.
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.
These Transitional DOCTYPE here were added deliberately in #697
Uh oh!
There was an error while loading. Please reload this page.
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.
Newer versions of Chrome strip them out if they aren’t in standards mode I thinkThere 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.
I had a moment to dig into what is going on. Newer versions of chrome don't add a transitional doctype if you never specified one to begin with. Chrome just leaves it empty.
iframe-inner.html:

what chrome renders:

I went through each of the changes in this PR and compared them to their source document and this does seem correct.
Example of the

compat-mode.htmlfile:How chrome renders it:

(consistent with the snapshot)
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.
I'm not understanding!
The transitional doctypes are there in the source test files in order to test that the resultant replay also replays with compatMode=true
Maybe ye guys are one step ahead of me?
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.
There where never any doctypes in the source files. Not having doctypes also triggers compat-mode. Check this out:
https://github.com/rrweb-io/rrweb/blob/master/packages/rrweb-snapshot/test/html/compat-mode.html
https://github.com/rrweb-io/rrweb/blob/master/packages/rrweb-snapshot/test/html/iframe-inner.html
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 okay got it now!
Only problem I can think of is if future versions of Chrome decide that lack of a doctype should imply HTML5 ... but happy to defer worrying about that to the future.