appium-flutter-driver
appium-flutter-driver copied to clipboard
Help determining checkbox widget state
We have these Flutter checkboxes in our AUT, but I can't see any programmatic way from the appium-flutter-driver to be able to determine its checked property - any suggestions on how I could make that happen? Here's a screenshot from the widget inspector:
Hello! I've been facing with the same problem multiple times (retrieve state of element somehow) - and the solution was to expose something from widget's state to widget's ValueKey.
For example, you can add ValueKey('CheckboxIsChecked: $isChecked') to key of Checkbox widget. Then, in test - use waitFor method with finder byValueKey('CheckboxIsChecked: false') (for example).
If state correct - waitFor method passes. If not - fails with look up error.
I found it more efficient to query elements by ancestor and descendant finder, but this up to end developer.