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

1

12

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

Swampy answered 2/1, 2017 at 10:29 Comment(0)
J
2

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

Joppa answered 8/1, 2017 at 1:59 Comment(1)
Well I'm subclassing runner which is delegating work to other test runners based on a parameter, so it's not an option for me.Swampy

© 2022 - 2024 — McMap. All rights reserved.