Content

Instrumented Tests from Jenkins with Genymotion SaaS

2024-04-23

This tutorial explains how to automate your instrumented tests from your Jenkins continuous integration server with Genymotion SaaS, using gmsaas command line tool.

Prerequisites

Configuring a Jenkins job with gmsaas

To configure the Jenkins job that will run the instrumented test, from Jenkins, go to the Configure menu.

1. In Source Code Management

Enter the location of the application source code.

2. In the Build section

Notes about variables:

Add Execute shell to run commands and add the following commands:

<GMSAAS_PATH>/gmsaas auth token <API_TOKEN>
<GMSAAS_PATH>/gmsaas instances start <RECIPE_UUID> <NAME>
<GMSAAS_PATH>/gmsaas instances adbconnect <NAME> [--adb-serial-port <VALUE>]

<GMSAAS_PATH>/gmsaas auth token
<API_TOKEN>
<GMSAAS_PATH>/gmsaas instances start
<RECIPE_UUID>
<NAME>
<GMSAAS_PATH>/gmsaas instances adbconnect
<NAME>
[--adb-serial-port <VALUE>]

3. In Invoke Gradle script

Add steps to run your instrumented test.

4. In the Post Build section

Add Publish JUnit test result report & Publish HTML reports to get test reports.

Add Execute a set of scripts to stop the device where the tests were run. In Build steps, add Execute shell section and add the following command:

<GMSAAS_PATH>/gmsaas instances stop <UUID>

where <UUID> is the UUID of the virtual device you created (not the <NAME>!).

Running the builds

You can run the builds manually by clicking Build with Parameters or have it automatically built by configuring a scheduled build.

Viewing test reports

Once your tests have run, you can view your test reports from Test Report.