Espresso is a testing framework for Android to make it easy to write reliable user interface tests
the following synchronization conditions are met:
espresso-core
Contains core and basic View matchers, actions, and assertions. See Basics and Recipes.espresso-web
Contains resources for WebView support.espresso-idling-resource
Espresso’s mechanism for synchronization with background jobs.espresso-contrib
External contributions that contain DatePicker, RecyclerView and Drawer actions, accessibility checks, and CountingIdlingResource.espresso-intents
Extension to validate and stub intents for hermetic testing.espresso-remote
Location of Espresso’s multi-process functionality.The Espresso Test Recorder tool lets you create UI tests for your app without writing any test code.
By recording a test scenario, you can record your interactions with a device and add assertions to verify UI elements in particular snapshots of your app.
Espresso Test Recorder then takes the saved recording and automatically generates a corresponding UI test that you can run to test your app.
note : Before using Espresso Test Recorder, make sure you turn off animations on your test device to prevent unexpected results.
Espresso tests consist of two primary components
UI interactions include tap and type actions that a person may use to interact with your app
1. Click Run > Record Espresso Test.
2. In the Select Deployment Target window, choose the device on which you want to record the test.
3. Recorded interactions will appear in the main panel in the Record Your Test window, When you run the test, the Espresso test will try executing these actions in the same order.
1. Click Add Assertion.
2. To select a View element on which to create an assertion, click on the element in the screenshot or use the first drop-down menu in the Edit assertion box at the bottom of the window.
3. Select the assertion you want to use from the second drop-down menu in the Edit assertion box.
4. Click Save and Add Another to create another assertion or click Save Assertion to close the assertion panels.
Additional resources