简体   繁体   中英

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

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

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM