【问题标题】:How to add extra test runner parameter in Android Studio 2.3 instrumented tests如何在 Android Studio 2.3 检测测试中添加额外的测试运行器参数
【发布时间】:2017-05-16 10:57:30
【问题描述】:

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

在新 AS 中是否有任何其他方式(从命令行手动运行测试除外)向 espresso 测试添加额外的运行器参数?

编辑:

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

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

【问题讨论】:

    标签: android android-studio android-studio-2.2 android-studio-2.3


    【解决方案1】:

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

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

    【讨论】:

    • 好吧,我正在继承 runner,它根据参数将工作委派给其他测试 runner,所以这不是我的选择。
    猜你喜欢
    • 2017-03-30
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2020-12-10
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多