Dump the app if we cannot tap the demo (#84996)

To help deflake https://github.com/flutter/flutter/issues/83298
This commit is contained in:
Dan Field 2021-06-21 12:04:43 -07:00 committed by GitHub
parent 16c0a3d700
commit 46c546684f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -61,7 +61,16 @@ Future<void> runDemos(List<String> demos, WidgetController controller) async {
final Finder demoItem = find.text(demoName);
await controller.scrollUntilVisible(demoItem, 48.0);
await controller.pumpAndSettle();
await controller.tap(demoItem); // Launch the demo
try {
await controller.tap(demoItem); // Launch the demo
} catch (e) {
print('Failed to find $demoItem');
print('All available elements:');
print(controller.allElements.toList());
print('App structure:');
debugDumpApp();
rethrow;
}
if (kUnsynchronizedDemos.contains(demo)) {
// These tests have animation, pumpAndSettle cannot be used.