Android Espresso Revealed Writing Automated - Programming Ebook

Latest

Download Programming Ebook

Tuesday, April 28, 2020

Android Espresso Revealed Writing Automated

Android Espresso Revealed Writing Automated
Android Espresso Revealed Writing Automated



Book Details 
             TitleAndroid Espresso Revealed Writing Automated
      ISBN-10978-1-4842-4314-5 
         Author: Denys Zelenchuk
    Language: English
No. of pages: 314
         Format: PDF, EPUB


Introduction

Who This Book Is For

This book is a guideline on how to write Android user interface tests for quality assurance engineers and test automation engineers who are interested in Android test automation using Espresso for Android (Espresso). It can also be valuable to Android developers involved in writing UI or integration tests.
This book was written mostly for software or test engineers with medium to advanced knowledge in Android test automation; however, engineers with basic development and test automation experience will benefit from it as well.

What This Book Covers

Advanced Android App Architecture Book


There is a lot of good official Android testing documentation out there, including GitHub projects with source code, but it is sometimes hard to find the needed portion of information, especially when it comes to plain automated UI end-to-end testing, which Android Espresso users face on a daily basis.
I tried to cover all the major topics of writing functional UI automated tests using the Espresso testing framework, including different ways of running automated tests, architecting test projects in easy and maintainable ways, and using tools that help to implement automated tests with the less effort.

Chapter Overview

Chapter 1: Getting Started with Espresso for Android

This chapter describes the basics of Espresso. It defines goals and approaches of user interface testing and provides examples for setting up tests inside the Android Studio IDE project. It also explains how to identify Android application UI elements, perform actions and assertions, and apply matchers to them. At the end of this chapter, you will be able to write simple tests and execute them from inside the Android Studio IDE on the device or emulator. It also includes examples for how to run tests using Gradle or shell commands.

Chapter 2: Customizing Espresso for Our Needs

With more advanced examples, you will learn how to implement a custom ViewAction, including clicks and swiping actions; and a ViewMatcher, such as matching complex views as RecyclerView matchers. You will learn how to use custom actions and matchers, implement a custom FailureHandler with the possibility to take and save screenshots upon failure.

Chapter 3: Writing Espresso Tests with Kotlin

This chapter gives an overview of the benefits of using the Kotlin programming language in tests and explains how to migrate tests written in Java to Kotlin. It also provides an example of creating an Espresso domain specific language in Kotlin.

Chapter 4: Handling Network Operations and Asynchronous Actions

This chapter explains how to handle application network requests and long-lasting operations during test execution with the help of the IdlingResource interface. It provides an example of using ConditionalWatcher as an alternative to IdlingResource.

Chapter 5: Verifying and Stubbing Intents with IntentMatchers
This chapter explains using IntentMatchers inside an application as well as how to stub external intents and provide extras. A good example of an external intent is selecting an image from the photo gallery, which then can be used by the application you’re testing.

Chapter 6: Testing Web Views

This chapter covers testing WebViews inside an application. Implemented WebViews showcase different UI elements that the Espresso-Web API is able to operate on. You will be provided an Espresso-Web cheat sheet as part of the book’s content.

Chapter 7: Accessibility Testing

This chapter unleashes the topic of how to test application accessibility using Espresso for Android. It raises awareness about the importance of accessibility testing and provides an overview of manual tools that can be used to test application accessibility.

Chapter 8: Espresso and UI Automator: The Perfect Tandem

This chapter explains one of the most powerful test automation setups for Android, which combines the Espresso test framework with the UI Automator testing tool. Examples show how to test notifications or operate on third-party apps during Espresso tests execution.

Chapter 9: Dealing with Runtime System Actions and Permissions

This chapter explains different ways that you can deal with system actions like permission request dialogs and describes possible solutions for changing the Android emulator system language programmatically.

Chapter 10: Android Test Automation Tooling

After reading this chapter, you will understand how to use the Espresso test recorder, set up a test device or emulator to minimize test flakiness, and run tests in the Firebase cloud.

Chapter 11: Screen Object Design Pattern in Android UI Tests

This chapter shows you how to apply the screen object (the same as page object) architecture approach to the test project, which allows you to reduce the maintenance effort spent on reworking tests after changes in the application’s source code.

Chapter 12: Testing the Robot Pattern with Espresso and Kotlin

In this chapter, you learn how to apply a testing robot pattern that splits the test implementation from the business logic to the Espresso UI tests.

Chapter 13: Supervised Monkey Tests with Espresso and UI Automator

This chapter shows how to implement supervised pseudo-monkey tests using Espresso and UI Automator, which can be applicable to applications whose source code you have access to as well as to third-party applications.


Chapter 14: AndroidX Test Library
This chapter demonstrates how to migrate test code from Android support to the AndroidX Test library. You will find information about new APIs introduced in the AndroidX Test library and see how they can be applied to UI tests.

Chapter 15: Improving Productivity and Testing Unusual Components

This chapter contains code samples that were not covered in the other chapters and Espresso testing tips that may increase your daily test writing productivity. This includes creating parameterized tests, aggregating tests into test suites, using AndroidStudio
Live templates in UI tests, setting
SeekBar progress in Espresso UI tests, and Espresso Drawable matchers topics. 

No comments:

Post a Comment