【发布时间】:2023-01-13 06:36:53
【问题描述】:
我正在 Android Studio 中学习 Kotlin 初学者课程 - 在测试阶段,试验结果总是0/0.我怎样才能完成这些测试?
代码由 Google Android 开发人员编写,应该可以完美运行。 (我用的一样)。应用程序编译没有错误。代码在这里: https://github.com/google-developer-training/android-basics-kotlin-words-app
我尝试了各种解决方案:
- Espresso tests not running on Android 12
- Android instrumented test no tests found
- 将 gradle 和所有内容升级到最新版本。
- 在 Pixel 2 和 Pixel 3 模拟器上试过
它可能与 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 连接到设备“Pixel_3_API_29 [emulator-5556]”上的进程 10870。>
你对此有何看法?感谢您的时间!
【问题讨论】:
标签: android android-studio kotlin testing