Accessing all attributes of found widgets possible? #1544
Unanswered
pandoras-toolbox
asked this question in
Q&A
Replies: 2 comments
-
Check out these two solutions: final appBarWidget = $(Key('appBar')).evaluate().single.widget as AppBar;
final appBarWidgetBackgroundColor = appBarWidget.backgroundColor;
print(appBarWidgetBackgroundColor); final appBarWidgetWithBlackBackground =
$(Key('appBar')).which<AppBar>((appBar) {
return appBar.backgroundColor == Colors.black;
});
await $.tap(appBarWidgetWithBlackBackgroundColor); |
Beta Was this translation helpful? Give feedback.
0 replies
-
Thank you! I will try that. Was busy the other days setting up a MacBook to try Patrol with the app on an iPhone. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Coming from a Selenium background I am a bit confused of the automation API of Patrol and of the native Flutter tools.
What I am missing in the API is to receive a widget object from a finder and then to access all the found widgets attributes.
I can access the text attribute for example, but not the key attribute. And I think there are many more attributes of widgets, like location, size etc. I would like to be able to access these attributes. Like if the widget is an AppBar, I would like to access its specific attributes like backgroundColor (maybe not the best example).
In Patrol and Flutter native tooling the finder returns a finder and not the found widget. I am not sure how good that is, because I would like to access all the attributes of the found widget. Can I do that like in Selenium?
Beta Was this translation helpful? Give feedback.
All reactions