Repository navigation
fix(flutter): accept a FlutterFinder as scrollView in scroll_till_visible - #1352
Merged
Merged
Conversation
…ible The scroll_till_visible docstring described scrollView as a string with the default 'Scrollable', but the Flutter integration server parses scrollView as a finder map (FindElementModel), so a string fails on the server. Passing a FlutterFinder, which is what the other Flutter commands take, failed on the client with "Object of type FlutterFinder is not JSON serializable"; only a hand-built dict from FlutterFinder.to_dict() worked. Convert a FlutterFinder scrollView to its dict form, keep accepting dicts, and document the argument correctly. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
KazuCocoa
approved these changes
Nov 2, 2026
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.
Problem
The
scroll_till_visibledocstring describes thescrollViewkeyword argument asscrollView (str): The view of the scroll. Default value is 'Scrollable'. The client sends whatever it is given unchanged:scrollViewwithFindElementModel.fromJson(json['scrollView'] as Map<String, dynamic>), so it must be a finder map.FlutterFinder, the type the other Flutter commands take. It fails on the client withTypeError: Object of type FlutterFinder is not JSON serializable.FlutterFinder.to_dict(). This is the only form that works, which is what the existing unit test uses.Fix
scrollViewis aFlutterFinder, convert it with.to_dict(), the same way the target finder is converted.scrollView (FlutterFinder | dict). WhenscrollViewis omitted, the server uses the firstScrollablewidget (find.byType(Scrollable)).Tests
scrollView=FlutterFinder.by_key(...)and checks the finder map that is sent. Without the fix it fails withTypeError: Object of type FlutterFinder is not JSON serializable.ruff check,ruff format --check,mypy appiumand the full unit test suite pass. Merged together with the horizontal-scroll fix (fix(flutter): support horizontal scrolling in scroll_till_visible #1351) it also merges cleanly and passes.🤖 Generated with Claude Code