Android UI tests - Example Application
This is a Android example app to study purposes about UI instrumentation tests, using Espresso framework.
For this example, we are using the Login Activity Android Studio template
Screenshot
Getting Started
-
Clone this repo
-
With Android Studio, click on
File=>Openand select the cloned folder -
Open the class
LoginBehaviorTestand click on green arrow beside of the methodperformAuth_sameActivity()Or, right-click on the test class in the projects panel, and select
Run.Obs: More explanation about running tests, see this link: Running Espresso tests
-
Choice a avd emulator. The UI test will run like the screen below:
Links: tutorials and questions
The refence links below contains tutorials and helpers about Android testing.
Google (official documentation)
- Testing UI for a Single App
- Testing Support Library (AndroidJUnitRunner, UI Automator)
- Espresso - google.github.io
Questions - Errors, Exceptions and Doubts
- Cannot resolve symbol 'AndroidJUnit4'
- Conflict with dependency 'support-annotations'
- Cannot launch AVD in emulator. Output: sh: 1: glxinfo
- AssertionFailedError: No tests found
- Espresso test that your Activity finishes with the expected result.

Formed in 2009, the Archive Team (not to be confused with the archive.org Archive-It Team) is a rogue archivist collective dedicated to saving copies of rapidly dying or deleted websites for the sake of history and digital heritage. The group is 100% composed of volunteers and interested parties, and has expanded into a large amount of related projects for saving online and digital history.


