当try 在Android Studio(直到3.2 Canary 9)上运行用Kotlin编写的Espresso 测试时,我收到错误: 进程已完成,退出代码为%1 找不到类:"com.myproject.directoryofwinning.VerifyAppIsAwesomeTest"Empty测试套件.

奇怪的是,同一个项目中的Java测试没有问题.

已经try 重置其他人建议的配置,但这似乎没有任何区别.

推荐答案

In the end I found that it was down to "test" being added to the end of the classname. Either moving the word Test to the front of the classname, or omitting it all together resolves the issue.

Kotlin相关问答推荐

来自SnapshotFlow的单元测试StateFlow仅发出initialValue

调用即发即忘方法--哪个作用域?

Spring Boot Bean验证器未触发

何时使用figureEach

jOOQ Kotlin Coroutines - Select all and exists查询

Kotlin supervisorScope 即使包裹在 try catch 中也会失败

如何将 `throw` 放置在辅助函数中但仍然具有空安全性?

匹配在单词边界上包含特殊字符的变量字符串的正则表达式

Fragment的onDestroy()中是否需要将ViewBinding设置为null?

下拉通知面板时是否可以暂停Android中的任何视频(媒体播放器)应用程序?

什么是 .kotlin_builtins 文件,我可以从我的 uberjars 中省略它们吗?

Firebase 权限被拒绝

Kotlin 的类型具体化使哪些在 Java 或 Scala 中无法实现的成为可能?

Kotlin中的下划线名称是为什么保留的?

Tornadofx - 如何在每个实例上将参数传递给 Fragment

如何在Kotlin中获得KType?

Kotlin lambda 语法混淆

在 suspendCoroutine 块中调用挂起函数的适当方法是什么?

是否可以在不使用class的情况下将 Mockito 与 Kotlin 一起使用?

RxJava - 每秒发出一个 observable