flutter-intellij icon indicating copy to clipboard operation
flutter-intellij copied to clipboard

Flutter test run history not working

Open lhimo opened this issue 3 years ago • 2 comments

Steps to Reproduce

  1. Run a set of integration tests with Flutter app
  2. On the Run tab, click on the History icon (clock)
  3. Click on any element in the dropdown menu

➡️ This error is shown:

Error running 'Test name': class com.intellij.execution.testframework.sm.runner.history.ImportedTestRunnableState 
cannot be cast to class io.flutter.run.test.TestLaunchState 
(com.intellij.execution.testframework.sm.runner.history.ImportedTestRunnableState is in unnamed module of loader 
com.intellij.util.lang.PathClassLoader @74294adb; io.flutter.run.test.TestLaunchState is in unnamed module of loader 
com.intellij.ide.plugins.cl.PluginClassLoader @232848ee)

Version info

[✓] Flutter (Channel stable, 2.5.3, on macOS 11.6.6 20G624 darwin-arm, locale it-IT)
    • Flutter version 2.5.3 at /Users/leonardoproperzi/fvm/versions/2.5.3
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision 18116933e7 (8 months ago), 2021-10-15 10:46:35 -0700
    • Engine revision d3ea636dc5
    • Dart version 2.14.4

[✓] Android toolchain - develop for Android devices (Android SDK version 31.0.0)
    • Android SDK at /Users/leonardoproperzi/Library/Android/sdk
    • Platform android-31, build-tools 31.0.0
    • ANDROID_HOME = /Users/leonardoproperzi/Library/Android/sdk
    • Java binary at: /Applications/Android Studio.app/Contents/jre/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build 11.0.12+0-b1504.28-7817840)
    • All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Xcode 13.2.1, Build version 13C100
    • CocoaPods version 1.11.2

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

[✓] Android Studio (version 2021.2)
    • 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.12+0-b1504.28-7817840)

[✓] Android Studio (version 2021.2)
    • Android Studio at /Volumes/Macintosh HD/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.12+0-b1504.28-7817840)

[✓] IntelliJ IDEA Community Edition (version 2021.3.2)
    • IntelliJ at /Applications/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.67.1)
    • VS Code at /Applications/Visual Studio Code.app/Contents
    • Flutter extension version 3.40.0

[✓] Connected device (4 available)
    • sdk gphone64 arm64 (mobile)         • emulator-5554                        • android-arm64  • Android 12 (API 31) (emulator)
    • iPhone SE (2nd generation) (mobile) • 84698E3A-3A1A-4DB2-93A9-B09696065ACD • ios            • com.apple.CoreSimulator.SimRuntime.iOS-15-2
      (simulator)
    • iPhone 13 (mobile)                  • BADFEB9C-A7F9-4EEF-8D31-0358E9319BA7 • ios            • com.apple.CoreSimulator.SimRuntime.iOS-15-2
      (simulator)
    • Chrome (web)                        • chrome                               • web-javascript • Google Chrome 102.0.5005.61
    ! Error: iPhone is not connected. Xcode will continue when iPhone is connected. (code -13)
    ! Error: iPad (2) is not connected. Xcode will continue when iPad (2) is connected. (code -13)
    ! Error: iPhone is not connected. Xcode will continue when iPhone is connected. (code -13)

• No issues found!

lhimo avatar Jun 08 '22 11:06 lhimo

By "Run tab" do you mean the Run tool window? I don't see a clock icon there, in either Android Studio or IntelliJ. Which are you using? A screen shot might help.

The Run menu does have a history submenu. Screen Shot 2022-06-10 at 9 13 36 AM

Those two work fine for me in IntelliJ. I do, however, see an error like you mentioned when using Android Studio.

stevemessick avatar Jun 10 '22 16:06 stevemessick

Thanks @stevemessick, I believe the error you got is the one I am referring to.

I am using Android Studio, and whenever you run integration tests on a device/emulator, a Run bottom tab opens up. I think the test history can be accessed also like you did, so i reckon we are getting the same error.

lhimo avatar Jun 10 '22 17:06 lhimo