Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

IntelliJ Flutter test runner hangs when running "flutter test --platform chrome" #7628

Open
rich-j opened this issue Aug 24, 2024 · 0 comments

Comments

@rich-j
Copy link

rich-j commented Aug 24, 2024

The IntelliJ Flutter test runner succeeds when not specifying a platform (i.e. VM). Change the Flutter test runner configuration to specify additional args of --platform chrome and the test runner hangs. The terminal command flutter test --platform chrome succeeds.

We expect the IntelliJ test runner to succeed and display the results. This has worked in the past (last time I did this was at least a few years ago).

To test platform specific functionality (e.g. web storage) we need to run some tests on a given platform.

Steps to Reproduce

  • In a Flutter web project with tests (i.e. create the default Flutter project with web target), create a run configuration for "Flutter Test" (the default project has test/widget_test.dart).
  • Run the test in the IntelliJ test runner and confirm that the test results/errors are displayed.
  • Change the Flutter test run configuration Additional args: to include --platform chrome and save.
  • Run the test again, the IntelliJ test runner starts with Instantiating tests..., a chrome browser window opens with a tab Flutter Test Browser Host, and then hang...

You can verify that the tests can run by opening a terminal on the project and running the command flutter test --platform chrome.

Version info

`flutter doctor -v` output
flutter doctor -v
[✓] Flutter (Channel stable, 3.24.1, on macOS 14.6.1 23G93 darwin-arm64, locale en-US)
    • Flutter version 3.24.1 on channel stable at /Users/x/Library/flutter
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision 5874a72aa4 (3 days ago), 2024-08-20 16:46:00 -0500
    • Engine revision c9b9d5780d
    • Dart version 3.5.1
    • DevTools version 2.37.2

[✓] Android toolchain - develop for Android devices (Android SDK version 34.0.0)
    • Android SDK at /Users/x/Library/Android/sdk
    • Platform android-34, build-tools 34.0.0
    • Java binary at: /Applications/Android Studio.app/Contents/jbr/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build 17.0.11+0-17.0.11b1207.24-11852314)
    • All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS (Xcode 15.4)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Build 15F31d
    • CocoaPods version 1.13.0

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

[✓] Android Studio (version 2024.1)
    • 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 17.0.11+0-17.0.11b1207.24-11852314)

[✓] IntelliJ IDEA Ultimate Edition (version 2024.2.0.2)
    • IntelliJ at /Applications/IntelliJ IDEA.app
    • Flutter plugin version 81.1.3
    • Dart plugin version 242.20629

[✓] Connected device (4 available)
    • iPhone 15 (mobile)              • 26XXXX2D-XXXX-XXXX-XXXX-ED00XXXXXXXX • ios            • com.apple.CoreSimulator.SimRuntime.iOS-17-5 (simulator)
    • macOS (desktop)                 • macos                                • darwin-arm64   • macOS 14.6.1 23G93 darwin-arm64
    • Mac Designed for iPad (desktop) • mac-designed-for-ipad                • darwin         • macOS 14.6.1 23G93 darwin-arm64
    • Chrome (web)                    • chrome                               • web-javascript • Google Chrome 127.0.6533.120

[✓] Network resources
    • All expected network resources are available.

• No issues found!
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant