Reputation: 5867
I want to check if a Button
is disabled in my UI test.
In Android you would normally do something like this:
onView(withId(R.id.buttonId)).check(matches(not(isEnabled())));
What is the equivalent when writing a UI test for Flutter?
Upvotes: 15
Views: 6124
Reputation: 51692
Give your Button
a UniqueKey
and pump the Widget and perform other test clicks, etc. Then
expect(tester.widget<FlatButton>(find.byKey(buttonKey)).enabled, isFalse);
Upvotes: 27