Robotium - testing specific flavors in Android Studio with Gradle

≡放荡痞女 提交于 2019-12-04 06:26:56

问题


So... i'm trying to make some tests for my application. I have several flavors in my application, and I want to build individual tests for each flavor. From the Robotium documentation I used the "androidTest/java" folder with a package inside... I event tried after some suggestions to input a flavor's .test. Another suggestion from here: http://tools.android.com/tech-docs/new-build-system/user-guide was to make several folders named "androidTest", but it didn't worked.

I have the latest Android Studio with Gradle 2.2.1.

I want to start 1 test to run for a single flavor. Currently in all the configurations I tried all the tests in the "androidTest" folder are running.. no mater what.

So, having flav1, flav2, flav3, etc.. How can I write and run a test just for flav2. Currently, running "connectedAndroidTestFlav3" for example runs all the tests in "androidTest"

Thanks in advance!


回答1:


Just tried again, and this time it worked: The correct folder strucure is:

Hope It's clear... It works as expected now..

List item



来源:https://stackoverflow.com/questions/28091912/robotium-testing-specific-flavors-in-android-studio-with-gradle

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!