Skip to content

Wait for the horizontal ScrollView to start scrolling before its visual screenshots - #60001

Merged
meta-codesync[bot] merged 1 commit into
react:mainfrom
lenaic:export-D131824504
Nov 13, 2026
Merged

meta-codesync[bot] merged 1 commit into
react:mainfrom
lenaic:export-D131824504

Conversation

@lenaic

@lenaic lenaic commented Nov 13, 2026

Copy link
Copy Markdown
Contributor

Summary:
The scroll-view/horizontal-scroll-to visual test taps a button that scrolls with an animation, then runs waitForAnimationToEnd and takes a screenshot. waitForAnimationToEnd returns as soon as two consecutive frames are the same, so if the animated scroll hasn't started yet when it first looks, it returns at once and the screenshot catches the position from before the tap. On iOS this has produced a start screenshot that is identical to the end one, and end screenshots taken at the start position or mid-scroll.

After each tap, wait for an item that is only on screen once the scroll has moved there (Item 11 at the end, Item 0 at the start), then wait for the animation to end as before. The horizontal ScrollView spans the screen, so the other end's items are off screen and the wait can't pass before the scroll moves.

The vertical scroll-to and sticky-header steps are left as they are: their items below the 200pt ScrollView are still on screen, and Maestro only drops elements that are outside the screen, not ones clipped by a parent, so the same wait would pass immediately there.

Changelog: [Internal]

Differential Revision: D131824504

…al screenshots

Summary:
The `scroll-view/horizontal-scroll-to` visual test taps a button that scrolls with an animation, then runs `waitForAnimationToEnd` and takes a screenshot. `waitForAnimationToEnd` returns as soon as two consecutive frames are the same, so if the animated scroll hasn't started yet when it first looks, it returns at once and the screenshot catches the position from before the tap. On iOS this has produced a `start` screenshot that is identical to the `end` one, and `end` screenshots taken at the start position or mid-scroll.

After each tap, wait for an item that is only on screen once the scroll has moved there (`Item 11` at the end, `Item 0` at the start), then wait for the animation to end as before. The horizontal ScrollView spans the screen, so the other end's items are off screen and the wait can't pass before the scroll moves.

The vertical `scroll-to` and `sticky-header` steps are left as they are: their items below the 200pt ScrollView are still on screen, and Maestro only drops elements that are outside the screen, not ones clipped by a parent, so the same wait would pass immediately there.

Changelog: [Internal]

Differential Revision: D131824504
@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Nov 13, 2026
@meta-codesync

meta-codesync Bot commented Nov 13, 2026

Copy link
Copy Markdown

@lenaic has exported this pull request. If you are a Meta employee, you can view the originating Diff in D131824504.

@meta-codesync
meta-codesync Bot merged commit ef56dce into react:main Nov 13, 2026
66 checks passed
@react-native-bot

Copy link
Copy Markdown
Collaborator

This pull request was successfully merged by @lenaic in ef56dce

When will my fix make it into a release? | How to file a pick request?

@react-native-bot react-native-bot added the Merged This PR has been merged. label Nov 13, 2026
usama-liaqat pushed a commit to usama-liaqat/react-native that referenced this pull request Nov 14, 2026
…al screenshots

Summary:
The `scroll-view/horizontal-scroll-to` visual test taps a button that scrolls with an animation, then runs `waitForAnimationToEnd` and takes a screenshot. `waitForAnimationToEnd` returns as soon as two consecutive frames are the same, so if the animated scroll hasn't started yet when it first looks, it returns at once and the screenshot catches the position from before the tap. On iOS this has produced a `start` screenshot that is identical to the `end` one, and `end` screenshots taken at the start position or mid-scroll.

After each tap, wait for an item that is only on screen once the scroll has moved there (`Item 11` at the end, `Item 0` at the start), then wait for the animation to end as before. The horizontal ScrollView spans the screen, so the other end's items are off screen and the wait can't pass before the scroll moves.

The vertical `scroll-to` and `sticky-header` steps are left as they are: their items below the 200pt ScrollView are still on screen, and Maestro only drops elements that are outside the screen, not ones clipped by a parent, so the same wait would pass immediately there.

Changelog: [Internal]

Differential Revision: D131824504

Pull Request resolved: react#60001
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. Merged This PR has been merged. meta-exported p: Facebook Partner: Facebook Partner

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants