相关疑难解决方法(0)

Android Studio 仪器测试状态未显示,但测试确实有效

当我运行 UI 测试时,它们工作得很好,并且我可以看到测试已通过日志传递。但 Android Studio 面板上的测试状态从未更新。

有人遇到过同样的问题吗?

测试结果作为日志:

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] 
    ....
Run Code Online (Sandbox Code Playgroud)

测试

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 …
Run Code Online (Sandbox Code Playgroud)

android android-testing android-studio android-espresso android-studio-girafee

11
推荐指数
1
解决办法
1305
查看次数

Android Studio 测试显示测试结果 0/0。我怎样才能开始测试?

我正在 Android Studio 中学习 Kotlin 初学者课程 - 在测试阶段,测试结果始终为0/0。我怎样才能完成这些测试?

代码由 Google Android 开发人员编写,应该可以完美运行。(我用的是同样的)。应用程序编译没有错误。代码在这里: https ://github.com/google-developer-training/android-basics-kotlin-words-app

我尝试了各种解决方案:

这可能与 Android Studio 版本 Bumblebee 或模拟器中阻止测试的某些设置有关。我怀疑这一点,因为在创建以前的应用程序时,在测试阶段发生了同样的事情(测试结果0/0)

测试结果说:

05/04 21:06:18:在 Pixel 3 API 29 上启动“navigate_to_words_...()”。应用程序重新启动成功,无需重新安装。运行测试

$ adb shell am Instrument -w -m -e debug false -e class 'com.example.wordsapp.NavigationTests#navigate_to_words_nav_component' com.example.wordsapp.test/android.support.test.runner.AndroidJUnitRunner 连接到设备上的进程 10870 'Pixel_3_API_29 [模拟器-5556]'。>

您对此有何看法?感谢您的时间!

testing android kotlin android-studio

5
推荐指数
1
解决办法
1460
查看次数