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

3

12

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)
Marine answered 15/3, 2022 at 10:5 Comment(6)
Did you find a solution for this?Viddah
Wondering: 1. Does that happen with any type of tests? 2. How could a one reproduce that? 3. Did you try to upgrade to the recent Android Studio version?Intratelluric
What's your Android Studio and Android Gradle Plugin version?Haematinic
Do you use testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" (#52873673, commonsware.com/Jetpack/pages/chap-testing-005.html)? Are there any problems in LogCat?Bisector
could you make a minimal viable GitHub Project where you can make it to "not work" so we can clone it and reproduce it?Interlanguage
It's also in issue tracker: issuetracker.google.com/issues/295509079Marine
E
2

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.
Exegetic answered 19/12, 2023 at 11:1 Comment(0)
G
1

Please check with the latest android studio,

Android Studio Electric Eel | 2022.1.1

Build #AI-221.6008.13.2211.9477386, built on January 11, 2023

Runtime version: 11.0.15+0-b2043.56-8887301 x86_64

VM: OpenJDK 64-Bit Server VM by JetBrains s.r.o.

Below image is my flutter project testCase

Below image is my flutter project testCase

Gangling answered 18/1, 2023 at 9:30 Comment(0)
J
0

Removing the Run configuration of the tests, solved the issue. Maybe it had some invalid configurations.

If not!! Try this flow. I hope it will help.

Jordison answered 20/1, 2023 at 5:17 Comment(1)
What do you mean Removing the Run configuration?Marine

© 2022 - 2024 — McMap. All rights reserved.