You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am writing integration tests for my app
and within my cases, there are cases were a
A flushbar with title "Success" must appear and
A flushbar with title "Error" must appear
so my Finder instance is
Finder findSuccessMessage() {
return find.byWidgetPredicate(
(widget) => widget is Flushbar && widget.title == 'lb_success'.tr());
}
here is my integration test code
await tester.tap(find.byType(AppButton)); //press submit
await tester.pumpAndSettle(); //wait until the loader goes away
expect(findSuccessMessage(), findsOneWidget); //expect a successful result
the flushbar is indeed appear correctly, but the expect fails because it reaches that line of code when the flushbar goes away
Flushbar duration is 2 seconds
and when I try to remove the await tester.pumpAndSettle(); it checks for the success message immediately after pressing the button so the API did not yet return a response!
The text was updated successfully, but these errors were encountered:
I am writing integration tests for my app
and within my cases, there are cases were a
A flushbar with title "Success" must appear and
A flushbar with title "Error" must appear
so my Finder instance is
here is my integration test code
the flushbar is indeed appear correctly, but the expect fails because it reaches that line of code when the flushbar goes away
Flushbar duration is 2 seconds
and when I try to remove the
await tester.pumpAndSettle();
it checks for the success message immediately after pressing the button so the API did not yet return a response!The text was updated successfully, but these errors were encountered: