I'm surprised no one seems to have asked this before, which means the answer might be obvious, but I have a screen with a text field and a button. The user enters their email in the text field. Then presses the button to see if the email is in the database. The program then displays a snackbar with 'success' text or 'fail' text (2 second duration).
Here is my code (5 lines):
await driver.enterText(field, 'wrongemail@email.com');
var btn = find.widgetWithText(RaisedButton, 'SEND MY PASSWORD');
await driver.tap(btn);
await driver.pump();
expect(find.text( 'E-mail address not found!'), findsOneWidget);
When I use the app in the emulator, everything is fine but in the test the last line throws an error saying that it cannot find the matching widget. What am I missing?