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
Stay organized with collections Save and categorize content based on your preferences. The AndroidJUnitRunner class is a JUnit test runner that lets you run instrumented JUnit 4 tests on Android devices, including those using the Espresso, UI Automator, and Compose testing frameworks.
Create an Instrumented Unit Test Class To create an instrumented JUnit 4 test class, add the @RunWith(AndroidJUnit4. class) annotation at the beginning of your test class definition. You also need to specify the AndroidJUnitRunner class provided in the Android Testing Support Library as your default test runner.
Instrumented tests run on Android devices, whether physical or emulated. As such, they can take advantage of the Android framework APIs. Instrumented tests therefore provide more fidelity than local tests, though they run much more slowly.
To add a testing source set for your build variant in Android Studio, follow these steps: In the Project window on the left, click the drop-down menu and select the Project view. Within the appropriate module folder, right-click the src folder and click New > Directory.
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
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With