I seen in Android Studio Bumblebee, we won’t Run Check anymore from the Android Studio UI. It looks as if is a recognized problem right here and supposes it must be mounted on this model already, however by some means I nonetheless have the difficulty?
Anticipated Habits
- From the supply code editor
- From proper click on folder / file
Android Studio Bumblebee
- From the supply code editor, it reveals Nothing right here
- From proper click on folder / file, Run Exams… menu is just not there
Workarounds
I am not a unit testing man. Possibly I am lacking one thing right here as a result of it looks as if nobody complains about this? Anyway, these are the workarounds based mostly on my restricted data in testing.
1. Use Totally different Android Studio Model
I suppose you possibly can roll again to earlier secure launch model Arctic Fox or improve to the most recent preview model. I personally strive Android Studio Dolphin (Canary construct preview model) and haven’t any points.
2. Manually Edit Run Configuration
To run unit take a look at in command line, you possibly can run the next command within the terminal
gradlew :app:testDebugUnitTest --tests "com.instance.myapplication.ExampleUnitTest"
To run particular unit take a look at operate (e.g.
ExampleUnitTest.addition_isCorrect
), you simply must replace the duty to
:app:testDebugUnitTest --tests "com.instance.myapplication.ExampleUnitTest.addition_isCorrect"
For instrument take a look at, you additionally must manually add it, much like the unit take a look at run configuration above.
- Go to app->Edit Configuration…
- Add Android Instrumented Exams
- Choose All in Bundle
- Choose Module and Bundle
- So it seems like this
- Run the instrumented take a look at (much like the unit take a look at above)
The above steps run all instrumented checks below the specify package deal. If you wish to run take a look at in specify class, simply select Class as an alternative of All in Bundle and specify the category title you wish to run.
To run instrumented take a look at in command line, you possibly can run the next command within the terminal
gradlew :app:connectedDebugAndroidTest
Conclusion
I really feel troublesome to manually add the run configuration, particularly I wish to run a single take a look at that’s newly added. Possibly I ought to simply transfer up my Android Studio model to the most recent preview construct to do away with this downside.