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?
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);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With