Features

Espresso Testing

TestingBot provides access to Android physical devices and Android emulators, capable of running your Android Espresso tests.
Espresso is a mobile automation framework from Google, designed to run UI tests for Android applications.


Using Espresso in combination with TestingBot's Android cloud service is very straightforward:

  • Upload your native mobile Android app, together with the Espresso test apk file. These are created with either Java or Kotlin.
  • Specify on which devices you want to run the Espresso tests.
  • Retrieve the results of the Espresso tests.

Getting Started


To get started, please follow the steps below:

  1. You will need a key and secret to connect to the TestingBot grid.
    These credentials are available in the TestingBot member area.

  2. Espresso tests require a seperate apk file for testing. So you will need to upload both the app (.apk or .aab file) and the test file (.apk).

You can also use the TestingBot Espresso Demo App to give the Espresso Cloud Testing functionality a try.

Upload Android App


To run Android Espresso tests on TestingBot, you will first have to upload your .apk or .aab file to TestingBot Storage.


curl -u api_key:api_secret \
-X POST "https://api.testingbot.com/v1/app-automate/espresso/app" \
-F "file=@/path/to/app/file/Application-debug.apk"

The API response will include an id response, which you can use in the other API calls.

{
    "id": 4012
}

Upload Espresso Test Suite


You can now upload the .apk file containing the Espresso tests.
The upload process is similar to the app upload process.


curl -u api_key:api_secret \
-X POST "https://testingbot.com/api/v1/app-automate/espresso/:id/tests" \
-F "file=@/path/to/app/file/Application-debug-test.apk"

Replace the :id with the identifier you received during the app upload call.

Specify devices


You can specify one or more Android device capabilities with your API call.
These capabilities can target either Android emulators, or physical Android devices.


1. Select a Device Type
2. Select a Device Name

Run Espresso Tests


Now that you have uploaded both your Android application and the Espresso test suite, you can run your first Espresso test on the TestingBot cloud.


curl -u api_key:api_secret \
-X POST "https://testingbot.com/api/v1/app-automate/espresso/:id/run" \
-d '{"capabilities":[{"platform":"ANDROID", "version":12, "deviceName":"Pixel 6", "platformName":"Android"}]}' \
-H "Content-Type: application/json"

Replace the :id with the identifier you received during the app upload call.


The API response will include a success response, indicating if the tests will start or if an error occurred.

{
    "success": true
}

View Espresso Test Results


You will now see a test appear in the TestingBot dashboard, together with a video, test logs and other metadata.