📸
AndroidUiTestingUtils
  • Overview
  • Setup
    • Instrumentation setup
    • Robolectric setup
    • Cross-Library setup
  • Usage
    • Instrumentation tests usage
      • Android-Testify usage
    • Robolectric usage
    • Cross-Library usage
    • TestRules & other utils
  • Ready-to-Run Samples
  • Github
Powered by GitBook
On this page
  • Sponsors
  • Reading on screenshot testing
  • Code attributions
  • Contributing

Overview

NextSetup

Last updated 14 days ago

AndroidUiTestingUtils is still in active development and has a long roadmap! New features are expected to come in June 2025.

A set of TestRules, ActivityScenarios and utils to facilitate UI & screenshot testing under certain configurations, independent of the UI testing libraries you are using. For screenshot testing, it supports:

  • Jetpack Compose

  • Android Views (e.g. custom Views, ViewHolders, etc.)

  • Activities

  • Fragments

This library enables you to easily change the following configurations in your UI tests:

    1. App Locale (i.e. per-app language preference)

    2. System Locale

  1. Font size

  2. Orientation

  3. Custom themes

  4. Dark mode / Day-Night mode

  5. Display size

Wondering why verifying our design under these configurations is important? I've got you covered:

Sponsors

By using Screenshotbot instead of the in-build record/verify modes provided by most screenshot libraries, you'll give your colleagues a better developer experience, since they will not be required to manually record screenshots after every run, instead getting notifications on their Pull Requests.

Reading on screenshot testing

Code attributions

This library has been possible due to the work others have done previously. Most TestRules are based on code written by others:

Moreover, to enable cross-library screenshot tests this library uses the following screenshot testing libraries under the hood:

Contributing

  1. Create an issue in this repo

  2. In that repo, add an example and test where the bug is reproducible/ and showcasing the new feature.

  3. Once pushed, add a link to the PR in the issue created in this repo and add @sergio-sastre as a reviewer.

  4. Once reviewed and approved, create an issue in this repo.

  5. Fork this repo and add the approved code from the other repo to this one (no example or test needed). Add @sergio-sastre as a reviewer.

I'll try to make the process easier in the future if I see many issues/feature requests incoming.

i.e. same test running either on device or on JVM.

Locale (also en_XA & ar_XB)

🎨

Thanks to for their support!

SystemLocaleTestRule ->

FontSizeTestRule ->

UiModeTestRule ->

Orientation change for activities ->

MeasureViewHelpers -> a copy of ViewHelpers from Facebook

Fork the repo

Once approved, I will merge the code in both repos, and you will be added as a contributor to as well as .

Robolectric
Cross-library & Shared screenshot testing
Pseudolocales
Design a pixel perfect Android app
Screenshotbot
An introduction to snapshot testing on Android in 2021 📸
The secrets of effectively snapshot testing on Android 🔓
UI tests vs. snapshot tests on Android: which one should I write? 🤔
Design a pixel perfect Android app 🎨
Screengrab
Novoda/espresso-support
AdevintaSpain/Barista
Shopify/android-testify
screenshot-tests-for-android
Paparazzi
Shot
Dropshots
Roborazzi
Android-testify
Android screenshot testing playground
Android UI testing utils
Android screenshot testing playground
Android UI testing utils logo modified from one by Freepik - Flaticon