I am trying to add some unit tests to my app. I am developing my app in Android Studio
This is what I did.
Added a new package
Created a class in new package which extends
TestCaseAdded following method to created class
@SmallTest public void basicTest() { assertEquals("abc", "abc"); }
- Added following to
defaultConfigsection inbuild.gradle
testApplicationId "newly.added.package.name" testInstrumentationRunner "android.test.InstrumentationTestRunner"
- Executed following command in Android Studio Terminal
gradlew.bat connectedAndroidTest
But, when I checked the generated html report, it shows that 0 tests were run.
I tried following, but none of them made a difference to the output of gradlew.bat connectedAndroidTest command.
- Added an incorrect package name to
testApplicationIdinbuild.gradle. - Disconnected device
Why doesn't my test case get executed? What have I missed?
Aucun commentaire:
Enregistrer un commentaire