Pesto demo for the Flutter Gallery app. (#4328)

* Pesto demo for the Flutter Gallery app.

* pesto.special.case
This commit is contained in:
Matt Perry
2016-06-03 17:05:01 -04:00
parent 8756a094a9
commit 60e7535b58
6 changed files with 781 additions and 4 deletions

View File

@@ -47,10 +47,18 @@ Future<Null> smokeDemo(WidgetTester tester, String routeName) async {
.pump(const Duration(seconds: 1)); // Wait until the demo has opened.
// Go back
Finder backButton = findBackButton(tester);
expect(backButton, findsOneWidget);
await tester.tap(backButton);
await tester.pump(); // Start the navigator pop "back" operation.
if (routeName == '/pesto') {
// TODO(mpcomplete): workaround for Pesto, which has a drawer instead of a
// back button. Figure out how to have both.
Finder drawer = find.byType(Scaffold); // get a Widget for the BuildContext
expect(drawer, findsOneWidget);
Navigator.pop(drawer.evaluate().first);
} else {
Finder backButton = findBackButton(tester);
expect(backButton, findsOneWidget);
await tester.tap(backButton);
await tester.pump(); // Start the pop "back" operation.
}
await tester.pump(const Duration(seconds: 1)); // Wait until it has finished.
return null;
}