I am assuming you are familiar with the Android Maven plugin? If not, you should check it out. Here is a method that is not bulletproof, but should work:
1- Start by writing a shell script that launches the Calabash tests. This shell script, say calabash.sh
, wouldn't be too complicated, just something along the lines of:
calabash-android run ../target/<app>.apk /path/to/calabash/tests
2- Launch this script once maven
has finished its integration-test
phase (if you are using Android Maven
, that's when you run your unit tests). This is taken from this SO question:
<plugin>
<artifactId>exec-maven-plugin</artifactId>
<groupId>org.codehaus.mojo</groupId>
<executions>
<execution>
<id>Version Calculation</id>
<phase>validate</phase> //This occurs [after integration-test][3]
<goals>
<goal>exec</goal>
</goals>
<configuration>
<executable>${basedir}/scripts/calabash.sh</executable>
</configuration>
</execution>
</executions>
</plugin>
This is not a bulletproof solution because I suspect that Maven cannot report any calabash test failures. Also, you might need to add some bash magic to make the script run until completion before Maven finishes building.