Skip to content

Conversation

@shadowusr
Copy link
Member

No description provided.

@pkg-pr-new
Copy link

pkg-pr-new bot commented Jul 19, 2025

Open in StackBlitz

npm i https://pkg.pr.new/gemini-testing/testplane@1112

commit: 020fe34

@shadowusr shadowusr force-pushed the users/shadowusr/TESTPLANE-632 branch from d8911a4 to 6b48ea1 Compare August 12, 2025 21:58
@shadowusr shadowusr marked this pull request as draft August 12, 2025 21:58
@shadowusr shadowusr force-pushed the users/shadowusr/TESTPLANE-632 branch from d459a9e to b68fa42 Compare August 18, 2025 07:13
@shadowusr shadowusr changed the base branch from master to testplane@9 August 18, 2025 07:13
@shadowusr shadowusr marked this pull request as ready for review August 18, 2025 08:43
Copy link
Member

@KuznetsovRoman KuznetsovRoman left a 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) {
Copy link
Member

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?

Copy link
Member Author

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;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why "-1"?

Copy link
Member Author

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.

@shadowusr shadowusr force-pushed the users/shadowusr/TESTPLANE-632 branch from 588cb86 to adbeabc Compare August 18, 2025 23:26
@github-actions
Copy link

github-actions bot commented Aug 19, 2025

✅ Testplane run succeed

Report

@shadowusr shadowusr merged commit 853686c into testplane@9 Aug 20, 2025
6 checks passed
@shadowusr shadowusr deleted the users/shadowusr/TESTPLANE-632 branch August 20, 2025 12:26
@shadowusr shadowusr changed the title chore: re-write screenshots logic to typescript feat: improve assertView command behavior Aug 20, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants