In flutter integration test, if we want to tap on a button that is built by ourselves, we can easily do it by:
await driver.tap(find.byValueKey("my_lovely_button_key"));
However, if a widget is not built by us, for example, a date picker, an image picker, etc., how do we tap on any of the buttons there?
Regarding the date picker, what I found to be useful is that you can click on any button using:
await driver.tap(find.text('btn_name'));
For example, if you need the date 11 June 2020
, you need to do these steps:
await driver.tap(find.text('11'));
await Future.delayed(const Duration(seconds: 1));
await driver.tap(find.text('OK'));
What these steps will do is:
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