Repository navigation
Wait for the horizontal ScrollView to start scrolling before its visual screenshots - #60001
Merged
Merged
Conversation
…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
|
@lenaic has exported this pull request. If you are a Meta employee, you can view the originating Diff in D131824504. |
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? |
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
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary:
The
scroll-view/horizontal-scroll-tovisual test taps a button that scrolls with an animation, then runswaitForAnimationToEndand takes a screenshot.waitForAnimationToEndreturns 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 astartscreenshot that is identical to theendone, andendscreenshots 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 11at the end,Item 0at 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-toandsticky-headersteps 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