GithubHelp home page GithubHelp logo

apress / android-espresso-revealed Goto Github PK

View Code? Open in Web Editor NEW
69.0 11.0 53.0 1016 KB

Source Code for 'Android Espresso Revealed' by Denys Zelenchuk

License: Apache License 2.0

Kotlin 39.73% Java 58.57% HTML 1.70%

android-espresso-revealed's Introduction

Apress Source Code

This repository accompanies Android Espresso Revealed by Denys Zelenchuk (Apress, 2019).

Cover image

Download the files as a zip using the green button, or clone the repository to your machine using Git.

Releases

Release v1.0 corresponds to the code in the published book, without corrections or updates.

Contributions

See the file Contributing.md for more information on how you can contribute to this repository. A sample TO-DO application project forked from the googlesamples android-architecture and modified in a way to show you most of the Espresso use cases.

AndroidX Test branch.

Content:

Explains how to identify Android application UI elements, perform actions, assertions and apply matchers to them.

Contains more advanced examples of how to implement custom ViewAction, including clicks and swiping actions; ViewMatcher, such as: matching complex views, RecyclerView matchers or Drawable matchers. It will be shown how to use custom actions and matchers, implement custom FailureHandler.

Is about migrating tests written in Java to Kotlin. migrating existing Espresso Java tests to Kotlin, provides an example of creating Espresso DSL.

Explains how to handle application network requests or long-lasting operations during test execution with the help of IdlingResource interface. Provides an example about ConditionalWatcher as an alternative to IdlingResource.

Shows IntentMatchers usage inside the application under test as well as possibility to stub external intents and provide back extras. Contains an example of external intent stubbing that selects an image from the photo gallery.

Gives an overview about testing WebViews inside application under test. Implemented WebViews will showcase different UI elements that Espresso-Web API is able to operate on. The Espresso-Web cheat sheet is also the part of this chapter content and is available under TODO.

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

Shows one of the most powerful test automation setups for Android, which combines Espresso test framework together with UI Automator testing tool. Contains the examples of how to test notifications or operate on third party apps during Espresso tests execution.

Explains different ways of how we can deal with system permission request dialogs.

Demonstrates how to set device in test friendly state to reduce test flakiness. Contains test examples generated by Espresso Test Recorder.

Shows how to apply Screen Object (the same as Page Object) architecture approach in Android test project which allows to reduce maintenance effort spent on test maintenance.

Contains examples of how to apply Testing Robot Pattern which splits the test implementation from the business logic to Espresso UI tests.

Gives an example of how to implement supervised pseudo monkey tests using Espresso and UI Automator which can be applicable for applications you have access to the source code to and for the third-party applications.

Demonstrates how to migrate the test code from Android Support to AndroidX Test library and how Truth library can be used in UI tests.

Contains code samples that were not covered in other chapters and Espresso testing tips which may increase your daily test writing productivity. It includes creating Parametrized 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.

Espresso-Web cheat sheet:

Illustration of the Espresso-Web API.

UI Automator cheat sheet:

Illustration of the UI Automator API.

android-espresso-revealed's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

android-espresso-revealed's Issues

Sharing Intent in Task Fragment does not work

There is a broken reference on line 185 under onOptionsItemSelected() method.

case R.id.menu_share:
                String email = PreferenceManager
                        .getDefaultSharedPreferences(getContext())
                        .getString("email_text", "");

"email_text" should match android:key="email_edit_text" found in pref_general.xml

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.