使用Espresso和Spoon运行特定测试

Cha*_*ham 5 android android-testing spoon android-espresso

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

gradle spoon -PspoonClassName = fully.qualified.TestCase

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

gradle spoon -PStressTest = com.espresso.websocket

StressTest我的班级在哪里,com.espresso.websocket是我的包裹.

Cha*_*ham 9

想出来:不得不把它添加到我的 build.gradle

  spoon {
     if (project.hasProperty('spoonClassName')) {
         className = project.spoonClassName  
        }
    }
Run Code Online (Sandbox Code Playgroud)

然后运行测试:

 gradle spoon -PspoonClassName=com.espresso.websosket.StressTest
Run Code Online (Sandbox Code Playgroud)