Search code examples
androidandroid-studioandroid-espressoandroid-testingandroid-studio-giraffe

Android Studio Instrument Test Status are not shown but Tests actually work


When I run my UI tests, they work perfectly fine and I can see tests are passed through logs. But Status of the Tests is never updated on Android Studio's panel.

Did anyone experience the same problem?

Test results as Logs:

Step2TableWithHeadersNextDirectionRow[SM-A505FN - 11] SUCCESS  
....
            2022-03-15T10:52:14.245+0100 [INFO] [com.android.build.gradle.internal.tasks.DeviceProviderInstrumentTestTask] [XmlResultReporter]: XML test result file generated at /Users/mySuperApp/app/build/outputs/androidTest-results/connected/flavors/superApp/TEST-SM-A505FN - 11-app-superApp.xml. Total tests 2, passed 2, 
            2022-03-15T10:52:14.247+0100 [QUIET] [system.out] 
    ....

test

Android Studio Bumblebee | 2021.1.1 Patch 2
Build #AI-211.7628.21.2111.8193401, built on February 17, 2022
Runtime version: 11.0.11+0-b60-7772763 aarch64
VM: OpenJDK 64-Bit Server VM by JetBrains s.r.o.
macOS 12.2.1
GC: G1 Young Generation, G1 Old Generation
Memory: 2048M
Cores: 10
Registry: external.system.auto.import.disabled=true, ide.images.show.chessboard=true
Non-Bundled Plugins: org.jetbrains.kotlin (211-1.6.10-release-923-AS7442.40)

Solution

  • I was facing this issue and tried so many ways. At last this solution works for me.

    1) Select File > Settings > Build, Execution, Deployment > Testing (or Android Studio > Preferences > Build, Execution, Deployment > Testing on MacOS.)

    2) Uncheck the box next to Run Android instrumented tests using Gradle and click OK.

    I am using below Android Studio version.

    Android Studio Hedgehog | 2023.1.1
    Build #AI-231.9392.1.2311.11076708, built on November 9, 2023
    Runtime version: 17.0.7+0-17.0.7b1000.6-10550314 amd64
    VM: OpenJDK 64-Bit Server VM by JetBrains s.r.o.