Question

I run my Espresso test via Spoon. Often, I get a build successful, with tests not being executed. I assume the cause is there was no alterations to the code of the app in question. I can see why they would do this - Why test an app that just ran the same test and passed? However, my situation is different; testing the app is not my primary concern, but testing what the app controls.

My question: My test will be run on a continuous loop, and the app will not be altered or changed. So is there any way around this?

Was it helpful?

Solution 2

With Spoon, a test will not run twice if the first test passed. This is cause it believes if it runs the test again, it will pass and there is no reason for that. Bad design on Square's part if you ask me.

The solution is: gradle clean spoon. clean will regenerate the res files (among others) and make spoon believe that it is essentially a different test. This makes running tests take longer than it should. But it works.

OTHER TIPS

I assume the cause is there was no alterations to the code of the app in question.

This is not true. You can run the same test thousands of times with Espresso without changing a line of code.

Make sure you're running it the correct way:

java -jar spoon-runner-1.1.0-jar-with-dependencies.jar \
    --apk example-app.apk \
    --test-apk example-tests.apk

Also keep in mind that the devices running the test should be visible in adb (run adb devices to check).

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top