Repository navigation
Commit 3c504a7
Wait for vertical scroll endpoints before visual captures (#60417)
Summary:
The vertical scroll-to visual test can capture the previous scroll position instead of the requested one.
1. A button requests an animated scroll.
2. `waitForAnimationToEnd` can observe unchanged frames before that scroll starts and return immediately.
3. The screenshot is then taken at the old endpoint, without checking whether the scroll reached its destination.
What changes
The RNTester example exposes its current endpoint through a nonvisual `testID` on its existing outer container. The marker starts at top, matching the initial zero offset. Requests for a different endpoint clear it to pending; requests at an already-acknowledged endpoint preserve it, since a no-op scroll need not emit another event. Native scroll offsets update the marker, including the final momentum event when intermediate scroll events are throttled. The flow waits for the requested endpoint before its existing animation-settling check and screenshot.
The list content, styles, animated scroll commands, screenshot IDs, and crops are unchanged. The horizontal and sticky-header flows are unchanged.
Changelog: [Internal]
Differential Revision: D134586364
Co-authored-by: David Alves <da@meta.com>1 parent fa1dc61 commit 3c504a7
2 files changed
Lines changed: 36 additions & 2 deletions
File tree
- packages/rn-tester
- js/examples/ScrollView
- visual-tests/flows
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
| 12 | + | |
12 | 13 | | |
13 | 14 | | |
14 | 15 | | |
| |||
238 | 239 | | |
239 | 240 | | |
240 | 241 | | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
241 | 259 | | |
242 | 260 | | |
243 | | - | |
| 261 | + | |
244 | 262 | | |
245 | 263 | | |
246 | 264 | | |
| |||
253 | 271 | | |
254 | 272 | | |
255 | 273 | | |
256 | | - | |
| 274 | + | |
257 | 275 | | |
258 | 276 | | |
| 277 | + | |
259 | 278 | | |
| 279 | + | |
260 | 280 | | |
261 | 281 | | |
262 | 282 | | |
| |||
268 | 288 | | |
269 | 289 | | |
270 | 290 | | |
| 291 | + | |
| 292 | + | |
| 293 | + | |
271 | 294 | | |
272 | 295 | | |
273 | 296 | | |
274 | 297 | | |
275 | 298 | | |
276 | 299 | | |
277 | 300 | | |
| 301 | + | |
| 302 | + | |
| 303 | + | |
278 | 304 | | |
279 | 305 | | |
280 | 306 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
13 | 17 | | |
14 | 18 | | |
15 | 19 | | |
| |||
18 | 22 | | |
19 | 23 | | |
20 | 24 | | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
21 | 29 | | |
22 | 30 | | |
23 | 31 | | |
| |||
0 commit comments