Instrumented Tests with Genymotion SaaS and gmsaas

2024-04-23

This tutorial explains how to automate instrumented tests from a desktop and run instrumented tests locally using the command line tool gmsaas for Genymotion SaaS. Refer to the gmsaas user guide for installation and usage.

> Important: Authentication is required with an API Token. Refer to the gmsaas user guide for detailed instructions.

1. Create and start your instance

Create and start an instance using the following command:

Bash

gmsaas instances start <RECIPE_UUID> <INSTANCE_NAME>

<RECIPE_UUID> is the recipe identifier. <INSTANCE_NAME> is the name to give the instance. Once the instance is up, the command returns and shows the <INSTANCE_UUID>.

> Note: The list of available recipes can be retrieved using this command: gmsaas recipes list

2. Connect the instance to ADB

Connect the instance to ADB by running the following command:

Bash

gmsaas instances adbconnect <INSTANCE_NAME> [--adb-serial-port <VALUE>]

3. Run your instrumented tests

Run instrumented tests using Gradle CLI or AndroidStudio.

View tests running in the virtual device by signing in to Genymotion SaaS.

4. Stop the virtual devices

Stop the virtual devices using the following command:

Bash

gmsaas instances stop <INSTANCE_UUID>

<INSTANCE_UUID> is the UUID (not the name) of the instance used for the test. All data generated on the virtual device during the tests are destroyed.