aws-devicefarm-maven-plugin

Maven plugin to run tests on AWS Device Farm

License

License

Categories

Categories

IDE Development Tools AWS Container PaaS Providers Maven Build Tools
GroupId

GroupId

io.github.martinschneider
ArtifactId

ArtifactId

aws-devicefarm-maven-plugin
Last Version

Last Version

1.2
Release Date

Release Date

Type

Type

maven-plugin
Description

Description

aws-devicefarm-maven-plugin
Maven plugin to run tests on AWS Device Farm
Project URL

Project URL

https://martinschneider.github.io/aws-devicefarm-maven-plugin
Source Code Management

Source Code Management

https://github.com/martinschneider/aws-devicefarm-maven-plugin

Download aws-devicefarm-maven-plugin

How to add to project

<plugin>
    <groupId>io.github.martinschneider</groupId>
    <artifactId>aws-devicefarm-maven-plugin</artifactId>
    <version>1.2</version>
</plugin>

Dependencies

compile (5)

Group / Artifact Type Version
org.slf4j : slf4j-api jar 1.7.25
org.slf4j : slf4j-simple jar 1.7.25
org.apache.maven : maven-plugin-api jar 3.5.3
org.apache.maven : maven-project jar 3.0-alpha-2
com.amazonaws : aws-java-sdk-devicefarm jar 1.11.344

provided (1)

Group / Artifact Type Version
org.apache.maven.plugin-tools : maven-plugin-annotations jar 3.5.1

Project Modules

There are no modules declared in this project.

Build status Buy me a coffee

aws-devicefarm-maven-plugin

Summary

The purpose of this Maven plugin is to prepare and trigger test runs on AWS Device Farm.

Maven goals

The following goals are available:

uploadAppPackage

This goal will upload the app package (apk or ipa) to AWS S3 for further use within Device Farm. The arn of the uploaded file will be exposed as a Maven property appArn for use in further build steps.

uploadTestPackage

This goal will upload the test package (zip) to AWS S3 for further use within Device Farm. Its arn will be exposed as a Maven property testArn for use in further build steps. Refer to the AWS documentation for details on how to package this file using Maven.

uploadExtraData

This goal will upload extra data (zip) to AWS S3 for further use within Device Farm. Its arn will be exposed as a Maven property extraDataArn for use in further build steps. AWS Device Farm will extract the contents of the extra data zip file to external data for Android or the app's sandbox for iOS.

Sample configuration

You can find a sample configuration below. In real-life applications you might want to use properties instead of hard-coding the values into the pom.xml.

<properties>
  <aws.devicefarm.maven.plugin.version>1.5</aws.devicefarm.maven.plugin.version>
</properties>

<build>
  <plugins>
    <plugin>
      <groupId>io.github.martinschneider</groupId>
      <artifactId>aws-devicefarm-maven-plugin</artifactId>
      <version>${aws.devicefarm.maven.plugin.version}</version>
      <configuration>
        <projectArn>YOUR_AWS_PROJECT_ARN</projectArn>
        <awsAccessKey>YOUR_AWS_ACCESS_KEY</awsAccessKey>
        <awsSecretKey>YOUR_AWS_SECRET_KEY</awsSecretKey>
        <awsRegion>YOUR_AWS_REGION</awsRegion>
      </configuration>
      <executions>
        <execution>
          <id>uploadAppPackage</id>
          <phase>verify</phase>
          <goals>
            <goal>uploadAppPackage</goal>
          </goals>
          <configuration>
            <appPackage>PATH_TO_YOUR_APP_PACKAGE</appPackage>
            <platform>android</platform>
          </configuration>
        </execution>
        <execution>
          <id>uploadTestPackage</id>
          <phase>verify</phase>
          <goals>
            <goal>uploadTestPackage</goal>
          </goals>
          <configuration>
            <testPackage>PATH_TO_YOUR_TEST_PACKAGE</testPackage>
          </configuration>
        </execution>
        <execution>
          <id>uploadExtraData</id>
          <phase>verify</phase>
          <goals>
            <goal>uploadExtraData</goal>
          </goals>
          <configuration>
            <extraData>PATH_TO_YOUR_EXTRA_DATA</extraData>
          </configuration>
        </execution>
        <execution>
          <id>scheduleRun</id>
          <phase>verify</phase>
          <goals>
            <goal>run</goal>
          </goals>
          <configuration>
            <devicePoolArn>YOUR_DEVICE_POOL_ARN</devicePoolArn>
            <executionName>demo</executionName>
            <accountsCleanup>true</accountsCleanup>
            <appPackagesCleanup>true</appPackagesCleanup>
            <additionalRunParameters>
              <appium_version>1.7.2</appium_version>
            </additionalRunParameters>
            <!-- see https://docs.aws.amazon.com/devicefarm/latest/developerguide/custom-test-environments.html -->
            <testSpecArn>${testSpecArn}</testSpecArn>
            <!-- these will be set by the previous goals -->
            <appArn>${appArn}</appArn>
            <testArn>${testArn}</testArn>
            <extraDataArn>${extraDataArn}</extraDataArn>
          </configuration>
        </execution>
      </executions>
    </plugin>
  </plugins>
</build>

Execute with mvn verify

Contact

Martin Schneider, [email protected]

Versions

Version
1.2
1.1
1.0.1
1.0