Espresso Patronum - The Magic Of The Robot Pattern
summary
Shows how using the robot pattern with Espresso turns long nested onView calls into a small set of screen-specific helpers, e.g. enterFirstName() and assertEmailDisplay(), for a registration form (first/last/email/phone/opt‑in). Implements view matchers in a companion object, one method per action/assertion, per‑screen robots, and a unit‑test robot for a ViewModel; changing LiveData to a BehaviorSubject requires one robot edit and all tests still pass. Includes screenshot logging and a GitHub repo with working samples.
AI-written summary · about
chapters (10)
- 0:00Introduction to Robot Pattern
- 3:12Espresso Basics and Problems
- 7:25Separation of Concerns Issues
- 9:09Introducing the Robot Pattern
- 13:21Building the Registration Robot
- 15:07Best Practices for Robots
- 18:20Robot Pattern Beyond UI Tests
- 21:36Unit Test Robot Example
- 23:21Real-World Robot Maintenance
- 24:45Key Takeaways and Recap
related talks
37mEspresso Patronum: The Magic Of The Robot Pattern
36mHow Espresso Works
44mDrink Espresso during Android Testing
01h 29mHello Espresso! Start with Android Gray box automation
38mEspresso, beyond the basics
57mHow Espresso Works
44mEfficient testing UI Android apps by example
42mRock-Solid UI and Instrumentation Testing
