I get this error when running my Cucumber-jvm tests with Gradle on an Android emulator.
The exact same tests run perfectly on a device but I need to run them on emulator to perform the tests on Travis CI
The debug error:
Executing task ':app:connectedDebugAndroidTest' (up-to-date check took 0.0 secs) due to:
Task has not declared any outputs.
deleteDir(/home/travis/build/neoranga55/Experiment-CI/app/build/outputs/androidTest-results/connected) returned: true
deleteDir(/home/travis/build/neoranga55/Experiment-CI/app/build/outputs/code-coverage/connected) returned: true
Starting 0 tests on test(AVD) - 5.0.2
Tests on test(AVD) - 5.0.2 failed: Instrumentation run failed due to 'java.io.IOException'
com.android.builder.testing.ConnectedDevice > No tests found.[test(AVD) - 5.0.2] [31mFAILED [0m
No tests found. This usually means that your test classes are not in the form that your test runner expects (e.g. don't inherit from TestCase or lack @Test annotations).
deleteDir(/home/travis/build/neoranga55/Experiment-CI/app/build/reports/androidTests/connected) returned: true
:app:connectedDebugAndroidTest FAILED
:app:connectedDebugAndroidTest (Thread[main,5,main]) completed. Took 3 mins 13.635 secs.
FAILURE: Build failed with an exception.
The full log of execution and fail: https://s3.amazonaws.com/archive.travis-ci.org/jobs/81209650/log.txt
This is the CucumberTestCase.class I created to configure which tests will be executed by Cucumber and where the results will be placed using the @CucumberOptions:
import cucumber.api.CucumberOptions;
/**
* This class configures the Cucumber test framework and Java glue code
*/
@CucumberOptions(features = "features", // Test scenarios
glue = {"com.neoranga55.cleanguitestarchitecture.cucumber.steps"}, // Steps definitions
format = {"pretty", // Cucumber report formats and location to store them in phone
"html:/mnt/sdcard/cucumber-reports/html-report",
"json:/mnt/sdcard/cucumber-reports/cucumber.json",
"junit:/mnt/sdcard/cucumber-reports/cucumber.xml"
},
tags={"~@manual", "@login-scenarios"}
)
public class CucumberTestCase {
}
The command to launch is:
./gradlew connectedAndroidTest -PdisablePreDex --stacktrace --info