Espresso is a native testing framework for running user interface tests on Android devices. Sauce Labs offers the option to run Espresso tests against emulators in our testing cloud with Sauce Runner for Virtual Devices.
Supported Espresso Package Versions
Max Test Execution Time
Recommended maximum execution time for Espresso jobs is 1 hour, however the emulators are capable of running Espresso jobs for 3 hours, and are shutdown after 3 hours.
Configuring Sauce Runner for Virtual Devices for Espresso Testing
The Command Reference for Sauce Runner for Virtual Devices contains a list of the options you can use to configure Sauce Runner to run tests with Espresso.
Emulator Settings for Espresso Tests
Following Google's recommendation to avoid flakey tests, we disable system animations on emulators during Espresso tests. Specifically the following three system animations are disabled:
- Window animation scale
- Transition animation scale
- Animator duration scale
When testing on Sauce emulators, one error to look out for is Espresso test suites running as expected on one Android version, but failing on another version (e.g., "Internal Server Error").
Potential Cause: Application under test requires a minimum Android version or above.
Recommendation: Check the
build.gradle for your application project.