Search code examples
androidandroid-studiokotlintestinginstrumented-test

Running Tests doesn't work properly. Test Results 0/0 Android Instrumented Tests


After updating my project with following dependencies my tests stoped running.

    mockitoVersion = '5.3.0'
    dexMakerVersion = '2.28.3'
    espressoVersion = '3.5.1'

--

    androidTestImplementation "org.mockito:mockito-core:$mockitoVersion"

    androidTestImplementation "com.linkedin.dexmaker:dexmaker-mockito:$dexMakerVersion"

    androidTestImplementation "androidx.test.espresso:espresso-contrib:$espressoVersion"

I can click on button Run and it seems like running. But nothing happenned. Gradle build running endless and test results 0/0.

enter image description here

I have tried:

  1. update my studio (now it is Android Studio Flamingo | 2022.2.1)
  2. update Gradle (8.0.0)
  3. invalidate cash and restart (several times)
  4. clean and rebuild
  5. update libraries
  6. I have testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" already.

I don't understand where is a problem. Please help me to run my tests.

P.S it seems like unit tests work fine. So the problem is with Instrumented Tests

enter image description here


Solution

  • I found a working solution here: Android studio Instrumented Test stuck at: Task :app:connectedDebugAndroidTest

    So I changed mine:

        debugImplementation "androidx.fragment:fragment-testing:1.5.5"
    

    to

    
        debugImplementation("androidx.fragment:fragment-testing-manifest:1.6.0-alpha04")
        debugImplementation("androidx.fragment:fragment-testing:1.6.0-alpha04")