-
Notifications
You must be signed in to change notification settings - Fork 69
feat: improve assertView command behavior #1112
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
commit: |
d8911a4 to
6b48ea1
Compare
d459a9e to
b68fa42
Compare
KuznetsovRoman
left a comment
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.
LGTM
Logic is hard, though, it is expected, when dealing with screenshot logic
|
|
||
| var interferingRects = []; | ||
|
|
||
| allElements.forEach(function (el) { |
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.
This operation looks very heavy
Did you check "how much time it takes" on page with large amount of nodes?
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.
Doesn't look too heavy to me... Average page has 5-10k elements, that's just 10k iterations with pretty cheap logic inside.
I've tried measuring how much time we spend on this on different pages and turns out it's between 20ms to 80ms.
But I think we can add an option to disable this logic in the future
| Math.min(nextNotCapturedArea.height, page.safeArea.height), | ||
| 2 * page.pixelRatio, | ||
| ); | ||
| const logicalScrollHeight = Math.ceil(physicalScrollHeight / page.pixelRatio) - 1; |
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.
why "-1"?
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.
Added a comment. That's to account for fractional top edge of scroll container. If it's fractional, without -1 we'd get 1px lines on resulting screenshot. But this way, we'll never accidentally capture that top fractional edge.
588cb86 to
adbeabc
Compare
✅ Testplane run succeed
|
No description provided.