Fix scroll and scrollUntilVisible on Android#28
Fix scroll and scrollUntilVisible on Android#28maggialejandro wants to merge 1 commit intodevicelab-dev:mainfrom
Conversation
omnarayan
left a comment
There was a problem hiding this comment.
Hey! Thanks for the PR — the ADB swipe fix makes sense and the before/after videos are great.
A couple things before we merge:
Too much formatting noise — most of the diff is gofumpt reformatting (octal literals, alignment) across files that have nothing to do with scrolling. Can you pull those out into a separate commit or PR? It makes the actual fix really hard to review.
Errors getting swallowed — in scrollUntilVisible, when findElement fails we just keep scrolling. That's fine if the element isn't found yet, but if the driver connection dies or the session crashes, we'd silently loop through all scrolls and report "element not found" instead of the real error. Worth distinguishing "not found" from actual failures.
Silent fallback to Appium — the whole point of this PR is that Appium scroll doesn't work, but scrollBySwipe quietly falls back to it when there's no ADB. Should at least log a warning there so we know when we're hitting the broken path.
Minor — in scroll(), the error shows up twice in the return (err + fmt.Sprintf("Failed to scroll: %v", err)).
The core fix is solid, just needs a cleanup pass!
4ec7fa6 to
b32f2e3
Compare
|
@maggialejandro we are also working on new driver and it might do better that adb, please try out I have created an interim build curl -fsSL https://open.devicelab.dev/install/maestro-runner | bash -s -- --version 1.0.8-rc4To use it with the new driver: maestro-runner --driver devicelab --device <DEVICE_SERIAL> test <flow.yaml> |
b32f2e3 to
03d1105
Compare
Thanks for the thorough review! All addressed:
Also squashed the scroll fix into a single commit to keep history clean. Let me know if anything else needs adjusting! |
Use ADB input swipe for reliable scrolling instead of Appium gestures, which are unreliable on many Android devices/emulators. Log a warning when falling back to the Appium scroll path due to missing ADB. Also distinguish "element not found" errors from infrastructure failures in scrollUntilVisible so connection errors are propagated immediately instead of being silently swallowed until all scrolls are exhausted. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
03d1105 to
73a08cd
Compare
Welcome to Codecov 🎉Once you merge this PR into your default branch, you're all set! Codecov will compare coverage reports and display results in all future pull requests. ℹ️ You can also turn on project coverage checks and project coverage reporting on Pull Request comment Thanks for integrating Codecov - We've got you covered ☂️ |
73a08cd
Android 1.0.8-rc4
iOS 1.0.8-rc4
|



Summary
input swipefor reliable scrolling instead of Appium gestures, which are unreliable on many Android devices/emulatorsscrollUntilVisible— connection errors are now propagated immediately instead of being silently swallowederrorResultcallsTest plan
TestScrollUntilVisible*tests passTestScrollUntilVisibleConnectionErrorverifies early bail-out on connection errorsTestIsElementNotFoundErrorcovers the not-found error allowlist🤖 Generated with Claude Code