How do I structure project test directory in Android Studio?

前端 未结 4 2027
迷失自我
迷失自我 2021-01-30 22:15

There is no convention for this yet, but how do I structure the test directory for Android Studio, now that what\'s stated on the Android testing fundamentals page differs?

4条回答
  •  囚心锁ツ
    2021-01-30 22:26

    Now in Android Studio you can set up instrumentTests by simply following the convention of placing the tests in the instrumentDirectory. Gradle only needs to know of any depencies that you have, which in my case is Robotium:

    Android Studio Screenshot

    dependencies {
        androidTestCompile 'com.jayway.android.robotium:robotium-solo:5.0.+'
    }
    

    When the test is finished you will have the results displayed in the GUI, so you do not have to use any command line at all! You can also right click the module above the JUnit test to run all JUnit tests.

提交回复
热议问题