Sauce Labs with Espresso

Link to Sauce Labs with Espresso copied to clipboard
Not for use with personal data

Using axe DevTools Mobile, you can find accessibility issues with your Espresso tests. Integrate your test with Sauce Labs and gain insights into your audience's experience with your app - before they've even seen it! This doesn't entail additional effort from your team. Sauce Labs is the largest cloud-based testing platform, hosting various device and emulator configurations to build your digital confidence. Configure your tests to run on Sauce within your current build automation to catch issues before they reach production.

Below is a guide for running your Espresso tests integrated with axe DevTools Mobile and Sauce Labs.

Prerequisites

  1. The `saucectl` command-line interface: Follow the installation instructions from Sauce Labs if you don't already have the Sauce CLI.
  2. Sauce Labs credentials: Add these to your .bash_profile or .zshenv. Be sure to load the changes by running source .filename. For more details, follow instructions from Sauce Labs.

Add Sauce Labs Configuration

Sauce Labs uses a yaml file at the project root located at .sauce/config.yml. Refer to the sample config file below:

version: 2.1
apiVersion: v1alpha
kind: espresso
sauce:
 region: us-west-1
 concurrency: 10
 metadata:
   tags:
     - e2e
   build: Your App
espresso:
 app: ./app/build/outputs/apk/debug/<app_name>-debug.apk
 testApp: ./app/build/outputs/apk/androidTest/debug/<app_name>-debug-androidTest.apk
suites:
 - name: "<app_name>"
   testOptions:
     clearPackageData: true
     useTestOrchestrator: true
   emulators:
     - name: "Google Pixel 3 GoogleAPI Emulator"
       platformVersions:
         - "11.0"
     - name: "Google Pixel 3a GoogleAPI Emulator"
       platformVersions:
         - "10.0"
     - name: "Google Pixel 3 XL GoogleAPI Emulator"
       platformVersions:
         - "9.0"

Run Tests on Sauce Labs

Running saucectl run from the root of your project will kick off your Espresso tests on the Sauce Labs platform. Integrate this command into your CI/CD pipeline for full automation.