#Appium Maven Plugin
A maven plugin for appium
#Basic Usage
Add the plugin to your project
- Add the plugin to the build section of your pom's project :
<plugin>
<groupId>com.lazerycode.appium</groupId>
<artifactId>appium-maven-plugin</artifactId>
<version>0.1.0</version>
<configuration>
<nodeDefaultLocation>${project.basedir}</nodeDefaultLocation>
<appiumLocation>${project.basedir}</appiumLocation>
</configuration>
<executions>
<execution>
<id>start appium</id>
<phase>pre-integration-test</phase>
<goals>
<goal>start</goal>
</goals>
</execution>
<execution>
<id>stop appium</id>
<phase>post-integration-test</phase>
<goals>
<goal>stop</goal>
</goals>
</execution>
</executions>
</plugin>
- Use the frontend-maven-plugin to download node and appium
<plugin>
<groupId>com.github.eirslett</groupId>
<artifactId>frontend-maven-plugin</artifactId>
<version>1.3</version>
<configuration>
<workingDirectory>src/test</workingDirectory>
</configuration>
<executions>
<execution>
<id>install node and npm</id>
<phase>process-resources</phase>
<goals>
<goal>install-node-and-npm</goal>
</goals>
<configuration>
<nodeVersion>v7.4.0</nodeVersion>
<npmVersion>4.1.1</npmVersion>
</configuration>
</execution>
<execution>
<id>npm install</id>
<phase>process-resources</phase>
<goals>
<goal>npm</goal>
</goals>
<configuration>
<arguments>install</arguments>
</configuration>
</execution>
</executions>
</plugin>
This will require a package.json:
{
"name": "mobile-appium-tests",
"private": true,
"license": "",
"version": "0.0.0",
"description": "Download appium for automated tests",
"devDependencies": {
"appium": "1.6.5",
"ios-deploy":"1.9.1"
},
"scripts": {
"prestart": "npm install",
"pretest": "npm install"
}
}
Run the build
`mvn verify`
Now node and appium will be downloaded and appium will stop and start as part of your build.