我正在使用Espresso和Spoon进行我的Android测试。我对这些非常满意。我唯一的问题是我正在尝试运行一个特定的测试。我在勺子网站上发现了这个:
gradle spoon -PspoonClassName = fully.qualified.TestCase
但我不能让这个工作。它仍然运行我所有的测试。有什么建议? 我这样运行命令:
gradle spoon -PStressTest = com.espresso.websocket
StressTest
是我的班级,而com.espresso.websocket
是我的班级。
答案 0 :(得分:9)
想出来:必须将此添加到我的build.gradle
spoon {
if (project.hasProperty('spoonClassName')) {
className = project.spoonClassName
}
}
然后用这个运行测试:
gradle spoon -PspoonClassName=com.espresso.websosket.StressTest