Fix for broken eval_and_browse (#6545)
diff --git a/packages/devtools_app/integration_test/run_tests.dart b/packages/devtools_app/integration_test/run_tests.dart index 23705b0..41692a8 100644 --- a/packages/devtools_app/integration_test/run_tests.dart +++ b/packages/devtools_app/integration_test/run_tests.dart
@@ -21,10 +21,9 @@ /// /// This list should be empty most of the time, but may contain a broken test /// while a fix being worked on. -const _skipTests = <String>[ - // TODO(https://github.com/flutter/devtools/issues/6541): re-enable once fixed. - 'eval_and_browse_test.dart', -]; +/// +/// Format: `'my_example_test.dart'`. +const _skipTests = <String>[]; void main(List<String> args) async { final testRunnerArgs = DevToolsAppTestRunnerArgs(
diff --git a/packages/devtools_app/integration_test/test/live_connection/eval_and_browse_test.dart b/packages/devtools_app/integration_test/test/live_connection/eval_and_browse_test.dart index 1f7c44c..1c087fb 100644 --- a/packages/devtools_app/integration_test/test/live_connection/eval_and_browse_test.dart +++ b/packages/devtools_app/integration_test/test/live_connection/eval_and_browse_test.dart
@@ -101,21 +101,22 @@ await tester.tapAndPump(find.textContaining('one instance')); await tester.tapAndPump(find.text('Any'), duration: longPumpDuration); - Widget? next = await tester.tapAndPump( + Finder? next = await tester.tapAndPump( find.textContaining('MyApp, retained size '), next: find.text('references'), ); next = await tester.tapAndPump( - find.byWidget(next!), + next!, next: find.textContaining('static ('), ); next = await tester.tapAndPump( - find.byWidget(next!), + next!, + description: 'text containing "static ("', next: find.text('inbound'), ); next = await tester.tapAndPump( - find.byWidget(next!), - next: find.text('Context'), + next!, + next: find.text('View'), ); } @@ -198,14 +199,16 @@ /// Taps and settles. /// /// If [next] is provided, will repeat the tap untill [next] returns results. - /// If [next] is not null returns [next]. - Future<Widget?> tapAndPump( + /// Returns [next]. + Future<Finder?> tapAndPump( Finder finder, { Duration? duration, Finder? next, + String? description, }) async { Future<void> action(int tryNumber) async { - logStatus('attempt #$tryNumber, tapping \n[$finder]\n'); + logStatus('\nattempt #$tryNumber, tapping'); + logStatus(description ?? finder.toString()); tryNumber++; await tester.tap(finder); await tester.pump(duration); @@ -220,7 +223,7 @@ for (var tryNumber = 1; tryNumber < 10; tryNumber++) { try { final items = tester.widgetList(next); - if (items.isNotEmpty) return items.first; + if (items.isNotEmpty) return next; await action(tryNumber); } on StateError { // tester.widgetList throws StateError if no widgets found.