How to integrate a cucumber into an android-maven project?

I would like to integrate the cucumber into an android test project that uses maven as a build system. The test project is separated from the main project and contains only functional tests based on robotics. I followed this tutorial and examples here , but during the test phase I received: 0 tests were found .. Any ideas? Thanks in advance.

+4
source share
1 answer

Eric I do not recommend these links, but please note that you must make all the dependency of the cucumber to compile the area. Use Junit4, which is going to give duplicationDependency, but use this command to build:

build command:    mvn clean install  -Dandroid.extractDuplicates=true

part of pom.xml

<dependency>
 <groupId>junit</groupId>
        <artifactId>junit</artifactId>
        <version>4.11</version>
        <scope>compile</scope>
    </dependency>

    <!-- cucumber -->
    <dependency>
        <groupId>info.cukes</groupId>
        <artifactId>cucumber-core</artifactId>
        <version>1.2.0</version>
        <scope>compile</scope>
    </dependency>
    <dependency>
        <groupId>info.cukes</groupId>
        <artifactId>cucumber-android</artifactId>
        <version>1.2.0</version>
        <scope>compile</scope>
    </dependency>
    <dependency>
        <groupId>info.cukes</groupId>
        <artifactId>cucumber-html</artifactId>
        <version>0.2.3</version>
        <scope>compile</scope>
    </dependency>
    <dependency>
        <groupId>info.cukes</groupId>
        <artifactId>cucumber-java</artifactId>
        <version>1.2.0</version>
        <scope>compile</scope>
    </dependency>
    <dependency>
        <groupId>info.cukes</groupId>
        <artifactId>cucumber-junit</artifactId>
        <version>1.2.0</version>
        <scope>compile</scope>
    </dependency>
    <dependency>
        <groupId>info.cukes</groupId>
        <artifactId>cucumber-jvm-deps</artifactId>
        <version>1.0.3</version>
        <scope>compile</scope>
    </dependency>
    <dependency>
        <groupId>info.cukes</groupId>
        <artifactId>gherkin</artifactId>
        <version>2.12.2</version>
        <scope>compile</scope>
    </dependency>
    <dependency>
        <groupId>info.cukes</groupId>
        <artifactId>cucumber-picocontainer</artifactId>
        <version>1.1.5</version>
        <scope>compile</scope>
    </dependency>
</dependencies>

part of the contents of AndroidManifest.xml (the application identifier that you want to test com.myproject.android):

   <instrumentation
        android:name="cucumber.api.android.CucumberInstrumentation"
        android:targetPackage="com.myproject.android" />
+3
source

All Articles