Skip to content

[Flutter Driver] tap on a Sliver throws an exception #67743

Closed

Description

@Xavjer

Flutter driver throwing the error:
await driver.tap(find.byType('RenderSliverStickyHeader'));

Error thrown:

DriverError: Error in Flutter application: Uncaught extension error while executing tap: type 'RenderSliverStickyHeader' is not a subtype of type 'RenderBox' in type cast
  #0      _HitTestableFinder.filter.<anonymous closure> (package:flutter_test/src/finders.dart:504:52)
  #1      _SyncIterator.moveNext (dart:core-patch/core_patch.dart:165:25)
  #2      Iterable.isEmpty (dart:core/iterable.dart:440:33)
  #3      Iterable.isNotEmpty (dart:core/iterable.dart:447:27)
  #4      FlutterDriverExtension._waitForElement.<anonymous closure> (package:flutter_driver/src/extension/extension.dart:278:51)
  #5      FlutterDriverExtension._waitUntilFrame (package:flutter_driver/src/extension/extension.dart:263:19)
  #6      FlutterDriverExtension._waitForElement (package:flutter_driver/src/extension/extension.dart:278:11)
  <asynchronous suspension>
  #7      FlutterDriverExtension._tap (package:flutter_driver/src/extension/extension.dart:385:41)
  #8      FlutterDriverExtension.call (package:flutter_driver/src/extension/extension.dart:216:53)
  #9      BindingBase.registerServiceExtension.<anonymous closure> (package:flutter/src/foundation/binding.dart:547:32)
  <asynchronous suspension>
  #10     BindingBase.registerServiceExtension.<anonymous closure> (package:flutter/src/foundation/binding.dart)
  #11     _runExtension (dart:developer-patch/developer.dart:84:23)

The code from package:flutter_test/src/finders.dart that results in the error:

@override
  Iterable<Element> filter(Iterable<Element> parentCandidates) sync* {
    for (final Element candidate in parentCandidates) {
      final RenderBox box = candidate.renderObject as RenderBox;
      assert(box != null);
      final Offset absoluteOffset = box.localToGlobal(alignment.alongSize(box.size));
      final HitTestResult hitResult = HitTestResult();
      WidgetsBinding.instance!.hitTest(hitResult, absoluteOffset);
      for (final HitTestEntry entry in hitResult.path) {
        if (entry.target == candidate.renderObject) {
          yield candidate;
          break;
        }
      }
    }
  }

As this Widget is a Sliver, it cannot be cast to a RenderBox. I did not work much with Slivers, I am therefore unsure how this is correctly implemented for them. I know that they work with geometry, but I don't know how to get the absoluteOffset for the calculation.

If someone could point me to the right direction, I would create a PR for this

Activity

  1. added
    P2Important issues not at the top of the work list
    c: crashStack traces logged to the console
    t: flutter driver"flutter driver", flutter_drive, or a driver test
    toolAffects the "flutter" command-line tool. See also t: labels.
    and removed
    team-infraOwned by Infrastructure team
    on Oct 9, 2020
  2. pedromassangocode commented on Nov 10, 2020

    @pedromassangocode

    Hi @Xavjer
    Can you please provide your flutter doctor -v, your pubspec.yaml and a minimal reproducible code sample?
    Thank you

  3. added
    waiting for responseThe Flutter team cannot make further progress on this issue until the original reporter responds
    on Nov 10, 2020
  4. Xavjer commented on Nov 10, 2020

    @Xavjer
    ContributorAuthor

    Hi @pedromassangocode I just pushed a sample of this issue here:
    https://github.com/Xavjer/slivertaptest
    Run driver like in the official example:
    flutter drive --target=test_driver/app.dart

    I am currently working with 1.21.0-9.1.pre, but I also tried this with never versions and the issue is happening there too.

    [✓] Flutter (Channel unknown, 1.21.0-9.1.pre, on Mac OS X 10.14.5 18F132, locale en-CH)
    • Flutter version 1.21.0-9.1.pre at /Users/xxx/Documents/Projects/flutter
    • Framework revision be9bc8c (3 months ago), 2020-08-18 09:46:08 -0700
    • Engine revision 267070c17a
    • Dart version 2.10.0 (build 2.10.0-7.2.beta)

    [✓] Android toolchain - develop for Android devices (Android SDK version 28.0.3)
    • Android SDK at /Users/xxx/Library/Android/sdk
    • Platform android-30, build-tools 28.0.3
    • ANDROID_HOME = /Users/xxx/Library/Android/sdk
    • ANDROID_SDK_ROOT = /Users/xxx/Library/Android/sdk
    • Java binary at: /Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build 1.8.0_152-release-1248-b01)
    • All Android licenses accepted.

    [✓] Xcode - develop for iOS and macOS (Xcode 11.3.1)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Xcode 11.3.1, Build version 11C504
    • CocoaPods version 1.9.3

    [✓] Chrome - develop for the web
    • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome

    [✓] Android Studio (version 3.3)
    • Android Studio at /Applications/Android Studio.app/Contents
    • Flutter plugin version 32.0.1
    • Dart plugin version 182.5124
    • Java version OpenJDK Runtime Environment (build 1.8.0_152-release-1248-b01)

    [!] IntelliJ IDEA Ultimate Edition (version 2020.1.1 Preview)
    • IntelliJ at /Users/xxx/Applications/JetBrains Toolbox/IntelliJ IDEA Ultimate.app
    ✗ Flutter plugin not installed; this adds Flutter specific functionality.
    ✗ Dart plugin not installed; this adds Dart specific functionality.
    • For information about installing plugins, see
    https://flutter.dev/intellij-setup/#installing-the-plugins

    [✓] Connected device (3 available)
    • Android SDK built for x86 (mobile) • emulator-5554 • android-x86 • Android 10 (API 29) (emulator)
    • Web Server (web) • web-server • web-javascript • Flutter Tools
    • Chrome (web) • chrome • web-javascript • Google Chrome 86.0.4240.183

    ! Doctor found issues in 1 category.

  5. removed
    waiting for responseThe Flutter team cannot make further progress on this issue until the original reporter responds
    on Nov 10, 2020
  6. pedromassangocode commented on Nov 11, 2020

    @pedromassangocode

    Reproducible on master as well.

    Logs
    00:04 +1 -1: slivertaptest Test Tap SliverToBoxAdapter [E]
    
      DriverError: Error in Flutter application: Uncaught extension error while executing tap: type 'RenderSliverToBoxAdapter' is not a subtype of type 'RenderBox' in type cast
      #0      _HitTestableFinder.filter.<anonymous closure> (package:flutter_test/src/finders.dart:504:52)
      #1      _SyncIterator.moveNext (dart:core-patch/core_patch.dart:165:25)
      #2      Iterable.isEmpty (dart:core/iterable.dart:440:33)
      #3      Iterable.isNotEmpty (dart:core/iterable.dart:447:27)
      #4      FlutterDriverExtension._waitForElement.<anonymous closure> (package:flutter_driver/src/extension/extension.dart:332:51)
      #5      FlutterDriverExtension._waitUntilFrame (package:flutter_driver/src/extension/extension.dart:317:19)
      #6      FlutterDriverExtension._waitForElement (package:flutter_driver/src/extension/extension.dart:332:11)
      <asynchronous suspension>
      #7      FlutterDriverExtension._tap (package:flutter_driver/src/extension/extension.dart:457:41)
      #8      FlutterDriverExtension.call (package:flutter_driver/src/extension/extension.dart:270:53)
      #9      BindingBase.registerServiceExtension.<anonymous closure> (package:flutter/src/foundation/binding.dart:547:32)
      <asynchronous suspension>
      #10     BindingBase.registerServiceExtension.<anonymous closure> (package:flutter/src/foundation/binding.dart)
      #11     _runExtension (dart:developer-patch/developer.dart:84:23)
    
    
    flutter doctor -v
    [✓] Flutter (Channel master, 1.24.0-8.0.pre.194, on Mac OS X 10.15.7 19H2 darwin-x64, locale en)
        • Flutter version 1.24.0-8.0.pre.194 at /Users/pedromassango/dev/SDKs/flutter_master
        • Framework revision 018467cdb1 (43 minutes ago), 2020-11-11 02:04:03 -0500
        • Engine revision 81f219c59c
        • Dart version 2.12.0 (build 2.12.0-31.0.dev)
    
    [✓] Android toolchain - develop for Android devices (Android SDK version 30.0.2)
        • Android SDK at /Users/pedromassango/Library/Android/sdk
        • Platform android-30, build-tools 30.0.2
        • Java binary at: /Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/bin/java
        • Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b3-6222593)
        • All Android licenses accepted.
    
    [✓] Xcode - develop for iOS and macOS (Xcode 12.1)
        • Xcode at /Applications/Xcode.app/Contents/Developer
        • Xcode 12.1, Build version 12A7403
        • CocoaPods version 1.9.3
    
    [✓] Chrome - develop for the web
        • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome
    
    [✓] Android Studio (version 4.0)
        • Android Studio at /Applications/Android Studio.app/Contents
        • Flutter plugin can be installed from:
          🔨 https://plugins.jetbrains.com/plugin/9212-flutter
        • Dart plugin can be installed from:
          🔨 https://plugins.jetbrains.com/plugin/6351-dart
        • Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b3-6222593)
    
    [✓] IntelliJ IDEA Community Edition (version 2020.2.3)
        • IntelliJ at /Applications/IntelliJ IDEA CE.app
        • Flutter plugin version 51.0.3
        • Dart plugin version 202.8070
    
    [✓] VS Code (version 1.51.0)
        • VS Code at /Applications/Visual Studio Code.app/Contents
        • Flutter extension version 3.16.0
    
    [✓] Connected device (4 available)
        • iPhone 12 Pro Max (mobile) • ECCF5C4A-8BEC-411D-B23E-85A836C3847E • ios            • com.apple.CoreSimulator.SimRuntime.iOS-14-1 (simulator)
        • macOS (desktop)            • macos                                • darwin-x64     • Mac OS X 10.15.7 19H2 darwin-x64
        • Web Server (web)           • web-server                           • web-javascript • Flutter Tools
        • Chrome (web)               • chrome                               • web-javascript • Google Chrome 86.0.4240.183
    
    • No issues found!
    
    
  7. huycozy commented on Nov 24, 2022

    @huycozy
    Member

    This issue is reproducible on the latest stable and master channels with provided sample code.

    Logs
    00:07 +1: slivertaptest Test Tap SliverToBoxAdapter
    
    00:07 +1 -1: slivertaptest Test Tap SliverToBoxAdapter [E]
    
      DriverError: Error in Flutter application: Uncaught extension error while executing tap: type 'RenderSliverToBoxAdapter' is not a subtype of type 'RenderBox' in type cast
      #0      _HitTestableFinder.filter (package:flutter_test/src/finders.dart:639:53)
      #1      _SyncStarIterator.moveNext (dart:async-patch/async_patch.dart:528:14)
      #2      Iterable.isEmpty (dart:core/iterable.dart:513:33)
      #3      Iterable.isNotEmpty (dart:core/iterable.dart:525:27)
      #4      CommandHandlerFactory.waitForElement.<anonymous closure> (package:flutter_driver/src/common/handler_factory.dart:485:51)
      #5      CommandHandlerFactory._waitUntilFrame (package:flutter_driver/src/common/handler_factory.dart:512:19)
      #6      CommandHandlerFactory.waitForElement (package:flutter_driver/src/common/handler_factory.dart:485:11)
      <asynchronous suspension>
      #7      CommandHandlerFactory._tap (package:flutter_driver/src/common/handler_factory.dart:235:35)
      <asynchronous suspension>
      #8      FlutterDriverExtension.call (package:flutter_driver/src/extension/extension.dart:372:31)
      <asynchronous suspension>
      #9      BindingBase.registerServiceExtension.<anonymous closure> (package:flutter/src/foundation/binding.dart:856:18)
      <asynchronous suspension>
    
    
    
      package:flutter_driver/src/driver/vmservice_driver.dart 341:7  VMServiceFlutterDriver.sendCommand
      ===== asynchronous gap ===========================
      package:flutter_driver/src/driver/driver.dart 212:5            FlutterDriver.tap
      ===== asynchronous gap ===========================
      test_driver/app_test.dart 39:9                                 main.<fn>.<fn>.<fn>
      ===== asynchronous gap ===========================
      package:test_api/src/backend/declarer.dart 215:9               Declarer.test.<fn>.<fn>
      ===== asynchronous gap ===========================
      package:test_api/src/backend/declarer.dart 213:7               Declarer.test.<fn>
      ===== asynchronous gap ===========================
      package:test_api/src/backend/invoker.dart 257:7                Invoker._waitForOutstandingCallbacks.<fn>
    
    
    00:07 +1 -1: slivertaptest Test Tap SliverFixedExtentList
    
    00:07 +1 -2: slivertaptest Test Tap SliverFixedExtentList [E]
    
      DriverError: Error in Flutter application: Uncaught extension error while executing tap: type 'RenderSliverFixedExtentList' is not a subtype of type 'RenderBox' in type cast
      #0      _HitTestableFinder.filter (package:flutter_test/src/finders.dart:639:53)
      #1      _SyncStarIterator.moveNext (dart:async-patch/async_patch.dart:528:14)
      #2      Iterable.isEmpty (dart:core/iterable.dart:513:33)
      #3      Iterable.isNotEmpty (dart:core/iterable.dart:525:27)
      #4      CommandHandlerFactory.waitForElement.<anonymous closure> (package:flutter_driver/src/common/handler_factory.dart:485:51)
      #5      CommandHandlerFactory._waitUntilFrame (package:flutter_driver/src/common/handler_factory.dart:512:19)
      #6      CommandHandlerFactory.waitForElement (package:flutter_driver/src/common/handler_factory.dart:485:11)
      <asynchronous suspension>
      #7      CommandHandlerFactory._tap (package:flutter_driver/src/common/handler_factory.dart:235:35)
      <asynchronous suspension>
      #8      FlutterDriverExtension.call (package:flutter_driver/src/extension/extension.dart:372:31)
      <asynchronous suspension>
      #9      BindingBase.registerServiceExtension.<anonymous closure> (package:flutter/src/foundation/binding.dart:856:18)
      <asynchronous suspension>
    
    
    
      package:flutter_driver/src/driver/vmservice_driver.dart 341:7  VMServiceFlutterDriver.sendCommand
      ===== asynchronous gap ===========================
      package:flutter_driver/src/driver/driver.dart 212:5            FlutterDriver.tap
      ===== asynchronous gap ===========================
      test_driver/app_test.dart 42:9                                 main.<fn>.<fn>.<fn>
      ===== asynchronous gap ===========================
      package:test_api/src/backend/declarer.dart 215:9               Declarer.test.<fn>.<fn>
      ===== asynchronous gap ===========================
      package:test_api/src/backend/declarer.dart 213:7               Declarer.test.<fn>
      ===== asynchronous gap ===========================
      package:test_api/src/backend/invoker.dart 257:7                Invoker._waitForOutstandingCallbacks.<fn>
    
    
    00:07 +1 -2: slivertaptest Test Tap SliverChildListDelegate
    
    VMServiceFlutterDriver: tap message is taking a long time to complete...
    00:37 +1 -3: slivertaptest Test Tap SliverChildListDelegate [E]
    
      TimeoutException after 0:00:30.000000: Test timed out after 30 seconds. See https://pub.dev/packages/test#timeouts
    
      package:test_api/src/backend/invoker.dart 334:28  Invoker._handleError.<fn>
      dart:async/zone.dart 1390:47                      _rootRun
      dart:async/zone.dart 1300:19                      _CustomZone.run
      package:test_api/src/backend/invoker.dart 332:10  Invoker._handleError
      package:test_api/src/backend/invoker.dart 288:9   Invoker.heartbeat.<fn>.<fn>
      dart:async/zone.dart 1398:13                      _rootRun
      dart:async/zone.dart 1300:19                      _CustomZone.run
      package:test_api/src/backend/invoker.dart 287:38  Invoker.heartbeat.<fn>
      dart:async-patch/timer_patch.dart 18:15           Timer._createTimer.<fn>
      dart:isolate-patch/timer_impl.dart 398:19         _Timer._runTimers
      dart:isolate-patch/timer_impl.dart 429:5          _Timer._handleMessage
      dart:isolate-patch/isolate_patch.dart 192:26      _RawReceivePort._handleMessage
    
    
    00:37 +1 -3: slivertaptest Test Tap Container
    
    I/flutter (23432): Tapped
    00:37 +2 -3: slivertaptest Test Tap GestureDetector
    
    I/flutter (23432): Tapped
    00:37 +3 -3: slivertaptest (tearDownAll)
    
    00:37 +3 -3: slivertaptest Test Tap SliverChildListDelegate [E]
    
      DriverError: Failed to fulfill Tap due to remote error
      Original error: ext.flutter.driver: (-32000) Service connection disposed
      Original stack trace:
    
    
    
      package:flutter_driver/src/driver/vmservice_driver.dart 334:7  VMServiceFlutterDriver.sendCommand
      ===== asynchronous gap ===========================
      package:flutter_driver/src/driver/driver.dart 212:5            FlutterDriver.tap
      ===== asynchronous gap ===========================
      test_driver/app_test.dart 45:9                                 main.<fn>.<fn>.<fn>
      ===== asynchronous gap ===========================
      package:test_api/src/backend/declarer.dart 215:9               Declarer.test.<fn>.<fn>
      ===== asynchronous gap ===========================
      package:test_api/src/backend/declarer.dart 213:7               Declarer.test.<fn>
      ===== asynchronous gap ===========================
      package:test_api/src/backend/invoker.dart 257:7                Invoker._waitForOutstandingCallbacks.<fn>
    
    
    00:37 +3 -3: Some tests failed.
    
    
    
    Consider enabling the flag chain-stack-traces to receive more detailed exceptions.
    For example, 'dart test --chain-stack-traces'.
    
    
    Unhandled exception:
    Dummy exception to set exit code.
    ➜  slivertaptest git:(master) ✗ 
    flutter doctor -v (stable and master)
    [✓] Flutter (Channel stable, 3.3.9, on macOS 13.0 22A380 darwin-x64, locale en-VN)
        • Flutter version 3.3.9 on channel stable at /Users/huynq/Documents/GitHub/flutter
        • Upstream repository https://github.com/flutter/flutter.git
        • Framework revision b8f7f1f986 (31 hours ago), 2022-11-23 06:43:51 +0900
        • Engine revision 8f2221fbef
        • Dart version 2.18.5
        • DevTools version 2.15.0
    
    [✓] Android toolchain - develop for Android devices (Android SDK version 31.0.0)
        • Android SDK at /Users/huynq/Library/Android/sdk
        • Platform android-33, build-tools 31.0.0
        • ANDROID_HOME = /Users/huynq/Library/Android/sdk
        • Java binary at: /Applications/Android Studio.app/Contents/jre/Contents/Home/bin/java
        • Java version OpenJDK Runtime Environment (build 11.0.13+0-b1751.21-8125866)
        • All Android licenses accepted.
    
    [✓] Xcode - develop for iOS and macOS (Xcode 14.0.1)
        • Xcode at /Applications/Xcode.app/Contents/Developer
        • Build 14A400
        • CocoaPods version 1.11.3
    
    [✓] Chrome - develop for the web
        • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome
    
    [✓] Android Studio (version 2021.3)
        • Android Studio at /Applications/Android Studio.app/Contents
        • Flutter plugin can be installed from:
          🔨 https://plugins.jetbrains.com/plugin/9212-flutter
        • Dart plugin can be installed from:
          🔨 https://plugins.jetbrains.com/plugin/6351-dart
        • Java version OpenJDK Runtime Environment (build 11.0.13+0-b1751.21-8125866)
    
    [✓] IntelliJ IDEA Community Edition (version 2022.2.2)
        • IntelliJ at /Applications/IntelliJ IDEA CE.app
        • Flutter plugin version 70.0.5
        • Dart plugin version 222.4167.21
    
    [✓] IntelliJ IDEA Community Edition (version 2022.1.1)
        • IntelliJ at /Users/huynq/Library/Application Support/JetBrains/Toolbox/apps/IDEA-C/ch-0/221.5591.52/IntelliJ IDEA CE.app
        • Flutter plugin can be installed from:
          🔨 https://plugins.jetbrains.com/plugin/9212-flutter
        • Dart plugin can be installed from:
          🔨 https://plugins.jetbrains.com/plugin/6351-dart
    
    [✓] VS Code (version 1.73.1)
        • VS Code at /Applications/Visual Studio Code.app/Contents
        • Flutter extension version 3.52.0
    
    [✓] Connected device (3 available)
        • SM T225 (mobile) • R9JT3004VRJ • android-arm64  • Android 12 (API 31)
        • macOS (desktop)  • macos       • darwin-x64     • macOS 13.0 22A380 darwin-x64
        • Chrome (web)     • chrome      • web-javascript • Google Chrome 107.0.5304.110
    
    [✓] HTTP Host Availability
        • All required HTTP hosts are available
    
    • No issues found!
    
    [!] Flutter (Channel master, 3.6.0-7.0.pre.45, on macOS 13.0 22A380 darwin-x64, locale en-VN)
        • Flutter version 3.6.0-7.0.pre.45 on channel master at /Users/huynq/Documents/GitHub/flutter_master
        ! Warning: `flutter` on your path resolves to /Users/huynq/Documents/GitHub/flutter/bin/flutter, which is not inside your current Flutter SDK checkout at /Users/huynq/Documents/GitHub/flutter_master. Consider adding /Users/huynq/Documents/GitHub/flutter_master/bin to the front of your path.
        ! Warning: `dart` on your path resolves to /Users/huynq/Documents/GitHub/flutter/bin/dart, which is not inside your current Flutter SDK checkout at /Users/huynq/Documents/GitHub/flutter_master. Consider adding /Users/huynq/Documents/GitHub/flutter_master/bin to the front of your path.
        • Upstream repository https://github.com/flutter/flutter.git
        • Framework revision d0352f55db (3 hours ago), 2022-11-23 20:01:26 -0500
        • Engine revision 9b2895724c
        • Dart version 2.19.0 (build 2.19.0-424.0.dev)
        • DevTools version 2.19.0
        • If those were intentional, you can disregard the above warnings; however it is recommended to use "git" directly to perform update checks and upgrades.
    
    [✓] Android toolchain - develop for Android devices (Android SDK version 31.0.0)
        • Android SDK at /Users/huynq/Library/Android/sdk
        • Platform android-33, build-tools 31.0.0
        • ANDROID_HOME = /Users/huynq/Library/Android/sdk
        • Java binary at: /Applications/Android Studio.app/Contents/jre/Contents/Home/bin/java
        • Java version OpenJDK Runtime Environment (build 11.0.13+0-b1751.21-8125866)
        • All Android licenses accepted.
    
    [✓] Xcode - develop for iOS and macOS (Xcode 14.0.1)
        • Xcode at /Applications/Xcode.app/Contents/Developer
        • Build 14A400
        • CocoaPods version 1.11.3
    
    [✓] Chrome - develop for the web
        • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome
    
    [✓] Android Studio (version 2021.3)
        • Android Studio at /Applications/Android Studio.app/Contents
        • Flutter plugin can be installed from:
          🔨 https://plugins.jetbrains.com/plugin/9212-flutter
        • Dart plugin can be installed from:
          🔨 https://plugins.jetbrains.com/plugin/6351-dart
        • Java version OpenJDK Runtime Environment (build 11.0.13+0-b1751.21-8125866)
    
    [✓] IntelliJ IDEA Community Edition (version 2022.2.2)
        • IntelliJ at /Applications/IntelliJ IDEA CE.app
        • Flutter plugin version 70.0.5
        • Dart plugin version 222.4167.21
    
    [✓] IntelliJ IDEA Community Edition (version 2022.1.1)
        • IntelliJ at /Users/huynq/Library/Application Support/JetBrains/Toolbox/apps/IDEA-C/ch-0/221.5591.52/IntelliJ IDEA CE.app
        • Flutter plugin can be installed from:
          🔨 https://plugins.jetbrains.com/plugin/9212-flutter
        • Dart plugin can be installed from:
          🔨 https://plugins.jetbrains.com/plugin/6351-dart
    
    [✓] VS Code (version 1.73.1)
        • VS Code at /Applications/Visual Studio Code.app/Contents
        • Flutter extension version 3.52.0
    
    [✓] Connected device (3 available)
        • SM T225 (mobile) • R9JT3004VRJ • android-arm64  • Android 12 (API 31)
        • macOS (desktop)  • macos       • darwin-x64     • macOS 13.0 22A380 darwin-x64
        • Chrome (web)     • chrome      • web-javascript • Google Chrome 107.0.5304.110
    
    [✓] HTTP Host Availability
        • All required HTTP hosts are available
    
    ! Doctor found issues in 1 category.
    
  8. 4 remaining items

  9. artemperegut commented on Dec 27, 2023

    @artemperegut

    Still reproducible on 3.7.12.

    Logs
    ══╡ EXCEPTION CAUGHT BY FLUTTER TEST FRAMEWORK ╞═════════════════
    The following _CastError was thrown running a test:
    type 'RenderSliverToBoxAdapter' is not a subtype of type
    'RenderBox' in type cast
    
    When the exception was thrown, this was the stack:
    #0      _HitTestableFinder.filter (package:flutter_test/src/finders.dart:639:53)
    #2      Iterable.isEmpty (dart:core/iterable.dart:513:33)
    #3      PatrolTester.waitUntilVisible.<anonymous closure> (package:patrol_finders/src/custom_finders/patrol_tester.dart:379:43)
    #6      TestAsyncUtils.guard (package:flutter_test/src/test_async_utils.dart:71:41)
    #7      PatrolTester.waitUntilVisible (package:patrol_finders/src/custom_finders/patrol_tester.dart:375:27)
    #8      PatrolFinder.waitUntilVisible (package:patrol_finders/src/custom_finders/patrol_finder.dart:315:19)
    ...
    <asynchronous suspension>
    <asynchronous suspension>
    (elided 4 frames from dart:async and dart:async-patch)
    
  10. self-assigned this
    on Jul 9, 2025
  11. added
    tool-still-validIssues that have been deemed still valid as part of the Flutter Tools issue cleanup initiative.
    on Jul 9, 2025
  12. matanlurey commented on Jul 10, 2025

    @matanlurey
    Contributor

    This isn't a bug - tap can only be used on widgets that correspond to a RenderBox.

    In the examples above, you'd tap an element in the *Sliver, instead of the *Sliver itself.

    That being said - it should not crash, there are error messages in other cases in flutter_test, but the _HitTestable* class casts eagerly without checking - we should fix that by considering objects that are not hit-testable (i.e. Slivers) false instead of crashing.

  13. github-actions commented on Jul 24, 2025

    @github-actions

    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 -v and a minimal reproduction of the issue.

  14. locked as resolved and limited conversation to collaborators on Jul 24, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

P2Important issues not at the top of the work listc: crashStack traces logged to the consolef: scrollingViewports, list views, slivers, etc.found in release: 3.3Found to occur in 3.3found in release: 3.6Found to occur in 3.6has reproducible stepsThe issue has been confirmed reproducible and is ready to work ont: flutter driver"flutter driver", flutter_drive, or a driver testteam-toolOwned by Flutter Tool teamtoolAffects the "flutter" command-line tool. See also t: labels.tool-still-validIssues that have been deemed still valid as part of the Flutter Tools issue cleanup initiative.triaged-toolTriaged by Flutter Tool team

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions