How to add extra test runner parameter in Android Studio 2.3 instrumented tests

半城伤御伤魂 提交于 2019-12-23 07:11:07

问题


In Android Studio 2.3 there is no field that allows user to setup additional test runner parameters in Edit configuration window for Android Instrumented Tests, however this option was present in 2.2.x version.

Is there any other way in new AS (except from running test manually from command line) to add extra runner parameters to espresso tests?

edit:

I've filled an issue on bug tracker:

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


回答1:


There is no way to do this via that window, because it no longer exists.

An alternative is to subclass the Test Runner, and pass params there. Here is an example using Robolectric: https://www.snip2code.com/Snippet/90320/An-extension-of-RobolectricTestRunner-th



来源:https://stackoverflow.com/questions/41425067/how-to-add-extra-test-runner-parameter-in-android-studio-2-3-instrumented-tests

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