title: How to make Cucumber features run in an Android project as local unit tests?
body: <p>I have an Android project written in Java that I'm working on in Android Studio.</p>
  
  <p>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 <a href="https://developer.android.com/studio/test/command-line" rel="nofollow noreferrer">local unit tests</a> (without Instrumentation) using <code>gradlew test</code> because the components under test do not interact with the Android SDK.</p>
  
  <p><strong>My problem is that the Cucumber features are not recognized by Gradle and do not run when I run <code>gradlew test</code>.</strong></p>
  
  <p>Here's how I set it up so far:</p>
  
  <ol>
  <li><p>Added these dependencies to my app's build.gradle:</p>
  
  <pre><code>testImplementation 'io.cucumber:cucumber-java:3.0.2'
  testImplementation 'io.cucumber:cucumber-junit:3.0.2'
  testImplementation 'io.cucumber:cucumber-jvm:3.0.2'
  </code></pre></li>
  <li><p>Also there, I added the path to where I've put my Feature file:</p>
  
  <pre><code>android {
      ...
      sourceSets {
          test {
              assets.srcDirs = ['src/test/java/integrationTest/assets']
          }
      }
  }
  </code></pre>
  
  <p>This is based on this folder structure:</p>
  
  <p><a href="https://i.stack.imgur.com/5R3RM.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/5R3RM.png" alt="enter image description here"></a></p></li>
  <li><p>Added a class for the steps (<code>Steps1.java</code>) as can be seen above.</p></li>
  </ol>
  
  <p>What am I missing here?</p>