From 46c546684f903315dc77332d51b94c6d3c9a0fc1 Mon Sep 17 00:00:00 2001 From: Dan Field Date: Mon, 21 Jun 2021 12:04:43 -0700 Subject: [PATCH] Dump the app if we cannot tap the demo (#84996) To help deflake https://github.com/flutter/flutter/issues/83298 --- .../flutter_gallery/test_driver/run_demos.dart | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/dev/integration_tests/flutter_gallery/test_driver/run_demos.dart b/dev/integration_tests/flutter_gallery/test_driver/run_demos.dart index 6f49b028ef..d58ee781f0 100644 --- a/dev/integration_tests/flutter_gallery/test_driver/run_demos.dart +++ b/dev/integration_tests/flutter_gallery/test_driver/run_demos.dart @@ -61,7 +61,16 @@ Future runDemos(List 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.