如何在Android Studio 2.3检测测试中添加额外的测试运行器参数

Tha*_*han 12 android android-studio android-studio-2.2 android-studio-2.3

在Android Studio 2.3中,没有允许用户在Edit configuration窗口中设置其他测试运行器参数的字段Android Instrumented Tests,但是此选项在2.2.x版本中存在.

新AS中是否还有其他方法(从命令行手动运行测试除外)为espresso测试添加额外的转轮参数?

编辑:

我在bug跟踪器上填写了一个问题:

https://code.google.com/p/android/issues/detail?id=231797&q=instrumentation&sort=-opened&colspec=ID%20Status%20Priority%20Owner%20Summary%20Stars%20Reporter%20Opened

Far*_*raz 2

无法通过该窗口执行此操作,因为它不再存在。

另一种方法是子类化测试运行器,并在那里传递参数。以下是使用 Robolectric 的示例:https://www.snip2code.com/Snippet/90320/An-extension-of-RobolectricTestRunner-th