Hi everyone and welcome to my course, Introduction to Android Test Automation with Espresso. My name is Moataz Nabil and I will be your instructor for this course.


# What is Espresso?

Espresso is a native testing framework for Android to write reliable UI tests. Google released the Espresso framework in October 2013 and, as of release version 2.0, Espresso is part of the Android Support Repository. One of the important features in Espresso is that it automatically synchronizes your test actions with the user interface of your application. The framework also ensures that your activity is started before the test runs. It can also force a test to wait until all observer background activities have finished, which is sometimes a problem with other testing frameworks.


# Android Automated UI Test Types

We have two types of Android automated UI tests. UI tests for a single app verify that the target app behaves as expected when a user performs a specific action or stops an activity. It allows you to check that the target app returned the correct UI output and response to user interactions in the app's activities. UI testing frameworks like Espresso allow you to programmatically simulate user actions and to test complex, intra-app user interactions.

The second type is UI tests for multiple apps. This type of test verifies the correct behavior of interactions between different user apps or between user apps and system apps. For example, you might want to test that your camera app shares images correctly with a third party social media application or with a default Android photo application. UI testing frameworks that support adjacent app interactions such as UI Automator allow you to test such scenarios. Espresso supports writing test scripts in Java and Kotlin.


# About Me

Now let me introduce myself. Currently I am a senior software engineer in test with more than 12 years of development and test automation experience. I’ve worked in different business domains including agriculture, telecom, healthcare, fashion, and food delivery. I’ve designed test automation frameworks for web and mobile platforms using different sets of tools and programming languages. Finally, I’ve implemented different CI/CD pipelines using tools like GitLab, BitBucket, Bitrise, GitHub Actions, and Jenkins.


# Course Content

Our course contents will include the following topics:

  • Introduction to Espresso, its features and its various benefits

  • How to set up Espresso and prepare our environment

  • Our first test script using Espresso and Java

  • How to inspect and interact with different elements such as text views, buttons, drawers, and more

  • How to test a web view with Espresso

  • How to handle application synchronization with Espresso and idling resources

  • How do we use validation and assertions with Espresso

  • How do we create test suites with annotations and run our classes

  • How are Espresso tests run

  • The screen object button, similar to a page object button but for mobile applications. It's a screen, not a page in Espresso UI tests

  • Implementing Behavior-Driven Development (BDD) with Espresso and Cucumber for Android by adding feature files, step definitions, and runner

  • How to add visual validation with Applitools and Espresso

  • Running Espresso cloud testing with Firebase Test Lab from Google Cloud

  • Running Espresso test scripts with GitHub Action as a continuous integration on every build request or a nightly build


# Course Prerequisites



Our course prerequisites include Android Studio version 3.6.1 or the latest version, Android SDK and Android Virtual Device (AVD) to create emulators, Gradle version 6.3, and Java JDK version 8 or above. This course also requires the use of Git command line, a GitHub account, an Applitools account, and a Firebase Test Lab account.


# Let's Begin!

And now, let's begin our journey with Espresso and I hope that this course will be useful for everyone.

Resources

© 2024 Applitools. All rights reserved. Terms and Conditions Privacy Policy GDPR