1

我们正在努力在新的仅测试模块中使用测试编排器。当测试位于应用程序模块中时,我们让它工作正常。

一个观察结果是,在仅测试模块中工作时,引入的依赖关系略有不同

仅测试

implementation "androidx.test:runner:$androidTestRunnerVersion"
implementation "androidx.test:rules:$androidTestRulesVersion"
implementation "androidx.test.ext:truth:$androidTestTruthExtensionsVersion"

普通应用模块

androidTestimplementation "androidx.test:runner:$androidTestRunnerVersion"
androidTestimplementation "androidx.test:rules:$androidTestRulesVersion"
androidTestimplementation "androidx.test.ext:truth:$androidTestTruthExtensionsVersion"

如您所见,省略了 androidTest 元素。测试协调器是使用 androidTestUtil 引入的。有谁知道仅测试模块是否有等效的语法?仅测试模块是否有可能忽略 androidTestUtil 选项?

androidTestUtil 'androidx.test:orchestrator:1.3.0'

有没有人将测试编排器与仅测试模块相结合?!

4

0 回答 0