Android Studio Arctic Fox Set testRunner as GRADLE instead of PLATFORM

210 Views Asked by At

My JUnit 4 tests are failing after updating to Android Studio Arctic Fox | 2020.3.1 Patch 3.

I noticed that it is creating a JUnit test configuration instead of Gradle test configuration when a test is run using the play button/icon near the test class or @Test method.

How to set the testRunner as GRADLE instead of PLATFORM in Android Studio Arctic Fox? There is no runner configuration found in Build, Execution, Deployment -> Build Tools -> Gradle.

Or is there any way we can set this in the build.gradle file?

P.S. This is only for unit-tests and NOT for instrumentation tests.

1

There are 1 best solutions below

0
On

The GUI where to select the default runner isn't there anymore ..and I'm not sure if Android Studio would pick up idea.properties, but maybe in gradle.properties - or elsewhere, if it still exists:

idea.gradle.prefer.idea_test_runner=true