Cosmin Ciobanu
Cosmin Ciobanu

Reputation: 11

Robotium - installing the target app as part of the build

I'm trying to run a Robotium testing suite on a demo application, but the android maven plugin fails at mvn install after pushing the test application to the device, because it can't find the target app.

The error is

Test run failed to complete: Unable to find instrumentation target package: com.example.app

And indeed, the demo application is not pushed on the emulator as part of the build. If I push it manually, then the testing suite runs succesfully.

The parent pom.xml contains both modules (the demo app and the test app which has a dependency on the demo app), and the mvn package builds them both successfully, but it only pushes the test app to the emulator.

Any idea what I need to change to push the demo app to the emulator before the test app?

Upvotes: 1

Views: 341

Answers (1)

bergvandenp
bergvandenp

Reputation: 186

I fixed this issue on my project by adding the following depedencies in de test module:

   <dependency>
        <groupId>${project.groupId}</groupId>
        <artifactId>appartifact</artifactId>
        <scope>compile</scope>
        <type>jar</type>
    </dependency>
    <dependency>
        <groupId>${project.groupId}</groupId>
        <artifactId>appartifact</artifactId>
        <scope>provided</scope>
        <version>${project.version}</version>
        <type>apk</type>
    </dependency>

Upvotes: 1

Related Questions