lundi 25 avril 2016

How to run Unit Tests through Android Studio?

I am trying to enable Unit Tests in Android Studio through native support.

Android Studio 1.1+ and Android Gradle plugin version 1.1.0+ added unit test support.

The project I am currently working on used JCandKSolutions android unit test plugin, since it started off before native unit test support was available.

I have updated my current project to Android Studio 2.1 RC and Android Gradle Plugin Version 2.1.0-rc1.

I have included the following testing dependencies:

testCompile 'junit:junit:4.12' testCompile 'org.mockito:mockito-core:1.10.8'

However, I still can't run Unit Tests from Android Studio.

I am going through the following step by step tutorial for adding unit tests: http://ift.tt/1Hti5J1

Here is a picture taken from the tutorial posted above: [Test Artifacts: Unit Tests][1]

The Build Variants box in my Android Studio does not have the "Test Artifacts" section at all. It only shows Module and Build Variant columns and Build Variant only has flavors mentioned in build.gradle

Am I missing something? Any help is much appreciated. Thanks!

Aucun commentaire:

Enregistrer un commentaire