This hands-on will feature getting started with automating Android with Espresso. We'll learn what’s Espresso, benefits of using it , tool set required for android app automation, writing a test using espresso API. We will start with setting up espresso using gradle and write test for single and multiple activities.
By: Deepika Verma, Nikhil Jain & Rohit Singhal
• What’s Espresso
• Similar Frameworks for Automation
• Why Expresso?
• Advantages of Espresso
• Hands-on with API discussion
• API cheat sheet
• A testing framework for Android to make it easy to write reliable UI
tests for a single application
• Developed internally at Google and open sourced in 2013
• Espresso 2.0 released in December 2015 and part of the Android
Similar Frameworks for Automation
Why ? and Benefits
Problems Faced during automation?
Testing framework is complex!
Tests are flaky!
Tests are slow and lasts hours!
Not easy to write tests!
Why ? and Benefits(contd.)
- Fast and Reliable
- Backward Compatibility(Froyo is there)
- Automatic Synchronization
- Supports testing activities outside apps
- Test Coverage
Entry point to interactions with views is via :-
• onData(Matcher<? extends Object>)
ViewMatcher - allows you to locate a view in the current view hierarchy
Matches on User Properties
Matches on UI properties
Matches on with Hierarchy
ViewActions - allows you to interact with views
• perform(ViewAction… viewActions)
ViewAssertions – allows you to assert the state of a view.
• checks(ViewAssertion viewAssert)