我正在使用这两个框架来测试我的应用程序。
我知道运行每个命令的以下命令:
乐器:gradlew clean connectedAndroidTest Robolectric:gradlew clean build
我也尝试过其他方法,但这些都是我的观点。
有没有什么命令可以同时运行这两个测试?
发布于 2015-08-06 20:50:21
您可以使用以下命令运行所有测试:
adb shell am instrument -w com.android.foo/android.test.InstrumentationTestRunner或者运行单个测试用例:
adb shell am instrument -w -e class com.android.foo.FooTest com.android.foo/android.test.InstrumentationTestRunner有关如何使用此处的更多信息:link
以下是我如何使用此命令的示例
adb shell am instrument -w -e class app.name.androidTest.TestCustomer mobile.touch.core.test/android.test.InstrumentationTestRunner它很棒,因为它可以立即运行测试
的另一种方式是实现 spoon-gradle-plugin Spoon插件,它非常适合运行测试和生成报告。
使用spoon运行测试的命令:
gradle spoon -PspoonClassName=fully.qualified.TestCasehttps://stackoverflow.com/questions/31788378
复制相似问题