问题
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