Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Running specific tests using Espresso and Spoon

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.

like image 530
Chad Bingham Avatar asked Jan 06 '14 17:01

Chad Bingham


People also ask

What is an espresso test?

Espresso is a UI test framework (part of the Android Testing Support Library) that allows you to create automated UI tests for your Android app.

What is spoon testing?

Put the spoon in a plastic bag and keep it under the sun or any bright light. After a minute, take the spoon out of the bag. Avoid touching the base. Indication of perfect health. If you find no stains or no unpleasant odour in the spoon, then your internal organs are in perfect health.


1 Answers

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
like image 118
Chad Bingham Avatar answered Nov 04 '22 22:11

Chad Bingham