问题描述
所以...我正在尝试为我的应用程序进行一些测试.我的应用程序中有几种风格,我想为每种风格构建单独的测试.从 Robotium 文档中,我使用了androidTest/java"文件夹,里面有一个包......我在一些建议后尝试输入一个风味的 .test.来自这里的另一个建议:http://tools.android.com/tech-docs/new-build-system/user-guide 是为了创建几个名为androidTest"的文件夹,但没有奏效.
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.
我有最新的带有 Gradle 2.2.1 的 Android Studio.
I have the latest Android Studio with Gradle 2.2.1.
我想开始 1 个测试来运行单一风味.目前在我尝试的所有配置中,androidTest"文件夹中的所有测试都在运行..无论如何.
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.
所以,有 flav1、flav2、flav3 等等.我该如何编写和运行只为 flav2 的测试.当前,例如运行connectedAndroidTestFlav3"会运行androidTest"中的所有测试
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"
提前致谢!
推荐答案
刚刚又试了一次,这次成功了:正确的文件夹结构是:
Just tried again, and this time it worked:The correct folder strucure is:
希望很清楚...它现在按预期工作...
Hope It's clear... It works as expected now..
列表项
这篇关于Robotium - 在 Android Studio 中使用 Gradle 测试特定风格的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!