How to run JUnit tests on Android Studio Arctic Fox | 2020.3.1?

Viewed 579

I have run configuration at .idea/workspace.xml:

<configuration name="appTests" type="AndroidJUnit" factoryName="Android JUnit">
      <module name="myproject-android.app" />
      <option name="PACKAGE_NAME" value="" />
      <option name="MAIN_CLASS_NAME" value="" />
      <option name="METHOD_NAME" value="" />
      <option name="TEST_OBJECT" value="package" />
      <option name="PARAMETERS" value="" />
      <option name="WORKING_DIRECTORY" value="$MODULE_DIR$" />
      <method v="2">
        <option name="Android.Gradle.BeforeRunTask" enabled="true" />
      </method>
    </configuration>

But I can't run it on new version of Android Studio due to error:

Run Configuration Error:  Android JUnit test configurations are no longer supported: You should instead use the Gradle run configuration for your unit tests. You can find your existing configurations at <my-app>/.idea/workspace.xml.

enter image description here

1 Answers

You can run directly by using gradlew .. ./gradlew clean allTests

Related