gitmyhub

testing-samples

Java ★ 9.3k updated 11mo ago

A collection of samples demonstrating different frameworks and techniques for automated testing

A collection of small Android example projects from Google's Android team, each demonstrating a specific tool or approach for writing automated tests that check your app works correctly.

JavaGradleAndroid StudioEspressoUiAutomatorBazelsetup: moderatecomplexity 2/5

This repository is a collection of small example projects maintained by the Android team at Google. Each example demonstrates a specific approach to automated testing for Android apps. The goal is to show developers the different tools and frameworks available for checking that their apps work correctly before shipping them to users.

The examples cover several testing tools. Espresso is used for testing what users see and interact with on screen, such as buttons, lists, and text inputs. The collection includes more than a dozen Espresso examples, ranging from basic interaction tests to more complex scenarios like handling multiple windows, background tasks, and camera simulations. There is also a UiAutomator example, which tests the app from the outside by simulating real user gestures. Additional examples cover how to run tests using the standard Android test runner and how to apply rules that manage the app lifecycle during testing.

To run any of these examples, you need Android Studio or a compatible build environment. The projects use Gradle for building. You can run tests either on a connected physical device or on an emulator. The README includes the exact commands needed. There is also experimental support for Bazel, an alternative build system, though that support is Linux-only and still marked as unofficial.

This repository is primarily useful for Android developers who want to learn by example how to write automated tests, or who need a reference when setting up testing in their own projects. Non-technical readers are unlikely to find the content directly useful, as the repository contains only code and instructions aimed at developers.

Where it fits