1

I have been following this Flutter doc: https://flutter.dev/docs/cookbook/testing/unit/introduction

And I can run the test in Android Studio if I open the file and run it by tapping the run button.

Thing is I want to run all tests with the push of one button, like in Xcode.

How to do that in Android Studio?

What I did:

Created two dumb tests, just for the sake of having them.

enter image description here

Created test configuration with All in Directory option and pointed to test directory:

enter image description here

And after hitting Play button I get:

Failed to load "/Users/martinberger/Dev/flutter_apps/iCash/icash/test/second_test.dart":
Test never connected to test harness.
Test: /Users/martinberger/Dev/flutter_apps/iCash/icash/test/second_test.dart
Shell: /Users/martinberger/Dev/flutter/bin/cache/artifacts/engine/darwin-x64/flutter_tester

So the first test complete, but next one, do not even start.

Of the dozen or so tutorials/blogs/docs I have read about this, they all focus on writing one test and running it by right-clicking or by having it open and clicking Play button.

I am coming from iOS/Xcode background so is there something I should know about running a simple test suite in Android Studio?

1 Answer 1

1

You can type flutter test and then the directory you want in the terminal.

So in your case: flutter test test/

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.