-
Notifications
You must be signed in to change notification settings - Fork 26.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add find.backButton
finder and StandardComponentType
enum to find components in tests.
#149349
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks good to me😄! There seems some test failures. Also just thinking whether we should name it more specifically, something like materialIconButton
? Because from Material Design, the standard buttons also include other types of button, like ElevatedButton
, OutlinedButton
etc but MaterialButtonType
seems don't have them:)
@goderbauer and I spoke about this, and decided that it's too Material specific, and not extensible enough. Instead, I'm going to change this to use a well-known set of |
This pull request has been changed to a draft. The currently pending flutter-gold status will not be able to resolve until a new commit is pushed or the change is marked ready for review again. For more guidance, visit Writing a golden file test for Reviewers: Read the Tree Hygiene page and make sure this patch meets those guidelines before LGTMing. |
b833228
to
986668a
Compare
70b3408
to
3955350
Compare
find.materialButton
finder to find "standard" Material buttons.find.backButton
finder and StandardComponentType
enum to find components.
find.backButton
finder and StandardComponentType
enum to find components.find.backButton
finder and StandardComponentType
enum to find components in tests.
2494d45
to
95cbb00
Compare
Description
This adds
find.backButton()
in the Common Finders to allow finding different types of standard UI elements. It works by attaching a key made from an enum value in a new enum calledStandardComponentType
to all of the standard widgets that perform the associated function.I also substituted the finder in several places where it is useful in tests.
This allows writing tests that want to find the "back" button without having to know exactly which icon the back button uses under what circumstances. To do it correctly is actually quite complicated, since there are several adaptations that occur (based on platform, and whether it is web or not).
Tests