Running specific tests using Espresso and Spoon

2019-03-21 00:35发布

I am using Espresso and Spoon for my android tests. I am extremely pleased with these. My only problem is I am trying to run a specific test. I found this on the spoon site:

gradle spoon -PspoonClassName=fully.qualified.TestCase

But I cannot get this to work. It still runs all my test. Any suggestions? I am running the command like so:

gradle spoon -PStressTest=com.espresso.websocket

Where StressTest is my class, and com.espresso.websocket is my package.

1条回答
不美不萌又怎样
2楼-- · 2019-03-21 00:57

Figured it out: had to add this to my build.gradle

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

Then run tests with this:

 gradle spoon -PspoonClassName=com.espresso.websosket.StressTest
查看更多
登录 后发表回答