Skip to content

Instantly share code, notes, and snippets.

@tianhaoz95
Created October 24, 2019 04:04
Show Gist options
  • Save tianhaoz95/1f79e69d6833ccfc91340552f3df2504 to your computer and use it in GitHub Desktop.
Save tianhaoz95/1f79e69d6833ccfc91340552f3df2504 to your computer and use it in GitHub Desktop.
Test unknown delay in widget test
testWidgets('Slow screen content shows up', (WidgetTester tester) async {
await tester.pumpWidget(MyApp());
await tester.tap(find.byKey(Key('slow_btn')));
await tester.pumpAndSettle(new Duration(seconds: 5));
expect(find.byKey(Key('slow_content')), findsOneWidget);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment