使用Espresso和Spoon运行特定测试

时间:2014-01-06 17:42:23

标签: android android-testing android-espresso spoon

我正在使用EspressoSpoon进行我的Android测试。我对这些非常满意。我唯一的问题是我正在尝试运行一个特定的测试。我在勺子网站上发现了这个:

  

gradle spoon -PspoonClassName = fully.qualified.TestCase

但我不能让这个工作。它仍然运行我所有的测试。有什么建议? 我这样运行命令:

  

gradle spoon -PStressTest = com.espresso.websocket

StressTest是我的班级,而com.espresso.websocket是我的班级。

1 个答案:

答案 0 :(得分:9)

想出来:必须将此添加到我的build.gradle

  spoon {
     if (project.hasProperty('spoonClassName')) {
         className = project.spoonClassName  
        }
    }

然后用这个运行测试:

 gradle spoon -PspoonClassName=com.espresso.websosket.StressTest