I have an Android project written in Java that I'm working on in Android Studio.
I'd like to use Cucumber for integration testing of some internal components (note: I know this is not the BDD way, nonetheless useful to me). I want the tests to run as local unit tests (without Instrumentation) using gradlew test
because the components under test do not interact with the Android SDK.
My problem is that the Cucumber features are not recognized by Gradle and do not run when I run gradlew test
.
Here's how I set it up so far:
Added these dependencies to my app's build.gradle:
testImplementation 'io.cucumber:cucumber-java:3.0.2' testImplementation 'io.cucumber:cucumber-junit:3.0.2' testImplementation 'io.cucumber:cucumber-jvm:3.0.2'
Also there, I added the path to where I've put my Feature file:
android { ... sourceSets { test { assets.srcDirs = ['src/test/java/integrationTest/assets'] } } }
This is based on this folder structure:
Added a class for the steps (
Steps1.java
) as can be seen above.
What am I missing here?