Repository navigation
Closed
flutter/packages
#12492Labels
P2Important issues not at the top of the work listImportant issues not at the top of the work lista: tests"flutter test", flutter_test, or one of our tests"flutter test", flutter_test, or one of our testsframeworkflutter/packages/flutter repository. See also f: labels.flutter/packages/flutter repository. See also f: labels.team-frameworkOwned by Framework teamOwned by Framework teamtriaged-frameworkTriaged by Framework teamTriaged by Framework team
Description
Steps to reproduce
- Ensure you are using Flutter 3.47 with the material_ui package
- Create a widget that exposes a Tooltip widget from the material_ui package
- Write a test to ensure the Tooltip is visible by using
find.byTooltip
Expected results
Tests should pass
Actual results
Tests fail
Code sample
Code sample
testWidgets("Custom tooltips in NavigationBarDestination",
(WidgetTester tester) async {
await tester.pumpWidget(
MaterialApp(
home: Scaffold(
bottomNavigationBar: NavigationBar(
destinations: const <NavigationDestination>[
NavigationDestination(
label: "A",
tooltip: "A tooltip",
icon: Icon(Icons.ac_unit),
),
NavigationDestination(
label: "B",
icon: Icon(Icons.battery_alert),
),
NavigationDestination(
label: "C",
icon: Icon(Icons.cake),
tooltip: "",
),
],
),
),
),
);
expect(find.text("A"), findsOneWidget);
await tester.longPress(find.text("A"));
expect(find.byTooltip("A tooltip"), findsOneWidget);
expect(find.text("B"), findsOneWidget);
await tester.longPress(find.text("B"));
expect(find.byTooltip("B"), findsOneWidget);
expect(find.text("C"), findsOneWidget);
await tester.longPress(find.text("C"));
expect(find.byTooltip("C"), findsNothing);
});Screenshots or Video
Logs
Logs
══╡ EXCEPTION CAUGHT BY FLUTTER TEST FRAMEWORK ╞════════════════════════════════════════════════════
The following TestFailure was thrown running a test:
Expected: exactly one matching candidate
Actual: _WidgetPredicateWidgetFinder:<Found 0 widgets with widget matching predicate: []>
Which: means none were found but one was expected
When the exception was thrown, this was the stack:
#4 main.<anonymous closure> (file:///Users/hans/Projects/custom_adaptive_scaffold/test/framework_mirror/navigation_bar_test.dart:549:5)
<asynchronous suspension>
#5 testWidgets.<anonymous closure>.<anonymous closure> (package:flutter_test/src/widget_tester.dart:192:15)
<asynchronous suspension>
#6 TestWidgetsFlutterBinding._runTestBody (package:flutter_test/src/binding.dart:1953:5)
<asynchronous suspension>
<asynchronous suspension>
(elided one frame from package:stack_trace)
This was caught by the test expectation on the following line:
file:///Users/hans/Projects/custom_adaptive_scaffold/test/framework_mirror/navigation_bar_test.dart line 549
The test description was:
Custom tooltips in NavigationBarDestination
════════════════════════════════════════════════════════════════════════════════════════════════════Analysis
The bug appears to be in flutter_test/lib/src/finders.dart on line 13:
import 'package:flutter/material.dart' show Tooltip;Rather than referencing the new material_ui package, it's expecting a Tooltip rom the old flutter/material.dart.
Flutter Doctor output
Doctor output
[✓] Flutter (Channel stable, 3.47.0, on macOS 26.5.2 25F84 darwin-arm64, locale en-US) [196ms]
• Flutter version 3.47.0 on channel stable at /Users/hans/flutter
• Upstream repository https://github.com/flutter/flutter.git
• Framework revision 4cf2416426 (2 days ago), 2026-08-11 11:53:49 -0700
• Engine revision 5f77625673
• Dart version 3.13.0
• DevTools version 2.60.0
• Feature flags: enable-web, enable-linux-desktop, enable-macos-desktop, enable-windows-desktop, enable-android, enable-ios, cli-animations, enable-native-assets,
enable-record-use, enable-swift-package-manager, omit-legacy-version-file, enable-lldb-debugging, enable-uiscene-migration
[✓] Android toolchain - develop for Android devices (Android SDK version 37.0.0) [852ms]
• Android SDK at /Users/hans/Library/Android/sdk
• Emulator version 37.1.11.0 (build_id 15917651) (CL:N/A)
• Platform android-37.1, build-tools 37.0.0
• ANDROID_SDK_ROOT = /Users/hans/Library/Android/sdk
• Java binary at: /Applications/Android Studio.app/Contents/jbr/Contents/Home/bin/java
This is the JDK bundled with the latest Android Studio installation on this machine.
To manually set the JDK path, use: `flutter config --jdk-dir="path/to/jdk"`.
• Java version OpenJDK Runtime Environment (build 25.0.2+-15348964-b329.117)
• All Android licenses accepted.
[✓] Xcode - develop for iOS and macOS (Xcode 26.6) [458ms]
• Xcode at /Applications/Xcode.app/Contents/Developer
• Build 17F113
• CocoaPods version 1.16.2
[✓] Chrome - develop for the web [3ms]
• CHROME_EXECUTABLE = /Applications/Google Chrome.app/Contents/MacOS/Google Chrome
[✓] Connected device (2 available) [5.7s]
• macOS (desktop) • macos • darwin-arm64 • macOS 26.5.2 25F84 darwin-arm64
• Chrome (web) • chrome • web-javascript • Google Chrome 151.0.7922.137
! Error: Browsing on the local area network for Hackberry Hans iPhone. Ensure the device is unlocked and attached with a cable or associated with the same local area
network as this Mac.
The device must be opted into Developer Mode to connect wirelessly. (code -27)
[✓] Network resources [249ms]
• All expected network resources are available.
• No issues found!Metadata
Metadata
Assignees
Labels
P2Important issues not at the top of the work listImportant issues not at the top of the work lista: tests"flutter test", flutter_test, or one of our tests"flutter test", flutter_test, or one of our testsframeworkflutter/packages/flutter repository. See also f: labels.flutter/packages/flutter repository. See also f: labels.team-frameworkOwned by Framework teamOwned by Framework teamtriaged-frameworkTriaged by Framework teamTriaged by Framework team
Type
Projects
- StatusShow more project fieldsDone
Activity
suryaKommana2662 commentedon Aug 13, 2026
@hanskokx Thanks for the report. I tried reproducing the issue using the provided test case on Flutter 3.47.0, but the test passes successfully with:
I have attached my t
est/tooltip_test.dartfile for reference. Could you please provide a minimal reproducible project and including the pubspec.yaml.tooltip_test.dart file
Flutter Doctor Output
hanskokx commentedon Aug 13, 2026
@suryaKommana2662 Feel free to pull down my repo -> https://github.com/hanskokx/custom_adaptive_scaffold/tree/6.0.0-dev
suryaKommana2662 commentedon Aug 13, 2026
@hanskokx Thanks for providing the repository. I pulled the custom_adaptive_scaffold/tree/6.0.0-dev branch and was able to reproduce the issue locally on Flutter 3.47.0. I ran the specific test with:
The test fails with:
The failure occurs at
navigation_bar_test.dart:575,matching the reported behavior. Routing to theteam-frameworkfor further investigation.6 remaining items
hanskokx commentedon Aug 21, 2026
I've introduced the
findByTooltipmethod directly in my test (see this commit), as it did not appear to be exported via thematerial_uipackage. The test now passes, however I had expected the method to be exported frommaterial_uiand it was a bit odd to me that it wasn't.[material_ui] Migrate off of flutter_test's find.byTooltip and on to …
[material_ui] Migrate off of flutter_test's find.byTooltip and on to …
[material_ui] Migrate off of flutter_test's find.byTooltip and on to …
github-actions commentedon Sep 16, 2026
This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of
flutter doctor -vand a minimal reproduction of the issue.