Skip to content

test(playground): expect element screenshots to cover the element's rounded edges - #298

Merged
V3RON merged 1 commit into
mainfrom
fix/android-element-screenshot-size
Oct 27, 2026
Merged

V3RON merged 1 commit into
mainfrom
fix/android-element-screenshot-size

Conversation

@V3RON

@V3RON V3RON commented Oct 27, 2026

Copy link
Copy Markdown
Contributor

What is this?

The playground's E2E Android suite fails should screenshot specific element only on every pull request since Oct 22: the element screenshot is 262×262 px, and the test expects 263×263. This fixes the test, which was wrong. The capture is correct.

Fixes #297.

How does it work?

Android region captures round each edge of the region to a whole pixel (#289), so they cover exactly the pixels the element covers on screen. The assertion rounded the size instead: on the CI emulator (PixelRatio 2.625) a 100 dp element is 262.5 px, which rounds to 263, but its edges at 408.75 px and 671.25 px round to 409 and 671, so it covers 262 px.

The test now measures the element with measureInWindow and expects the size its rounded edges span. Where the pixel ratio makes element edges whole pixels, as on the iOS simulator and in Chromium, this is the same size as before.

Why is this useful?

E2E Android goes green again on pull requests, so it can catch real regressions again, starting with #249 and #257, which are blocked on this failure today.

@vercel

vercel Bot commented Oct 27, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
react-native-harness Ready Ready Preview Oct 27, 2026 3:56pm UTC

Request Review

@V3RON
V3RON marked this pull request as ready for review October 27, 2026 15:56
@V3RON
V3RON merged commit 26b67ea into main Oct 27, 2026
15 checks passed
@V3RON
V3RON deleted the fix/android-element-screenshot-size branch October 27, 2026 16:20

This branch was successfully deployed

1 active deployment
Preview — d709aa47 Deployed Oct 27, 2026 by vercel[bot]
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.

Android E2E fails on main: element screenshot is 262 px, test expects 263 px

1 participant