I'm testing my Flutter app. I have a widget drawer. I am doing a test for this widget. I need to open the box and click on the items. I use this code:
final drawer = find.byTooltip('Open navigation menu');
expect(drawer, findsWidgets);
tester.tap(drawer) ;
It is work. But I don't know how finds items in my drawer anb tap to them. This is code for drawer:
drawer: Drawer(
key: Key("Drawer"),
child: ListView(
children: <Widget>[
drawerItem(context, 'Login', Icons.account_circle, 'login'),
drawerItem(context, 'Users', Icons.person, 'users'),
drawerItem(context, 'Log Out', Icons.exit_to_app, 'logout')
],
),
)
.....
ListTile drawerItem(BuildContext context, String title, IconData icon,
[String route]) {
return new ListTile(
key: Key(title),
title: Text(title),
leading: Icon(icon)
);
How do I click on these items?