Better Android Testing at Airbnb (Part 1)
Article Summary
Airbnb built a system that automatically tests every click in their Android app without writing a single Espresso test. Here's how they turned interaction testing from tedious to automatic.
Part 3 of Airbnb's testing series dives into their automated interaction testing framework. Instead of manually writing brittle Espresso tests for click handlers, they programmatically click every view, capture all resulting actions, and generate JSON reports that get diffed like screenshots.
Key Takeaways
- System automatically clicks every view and records Fragment transactions, network requests, and state changes
- JSON reports capture interaction behavior with approval testing for one-click test updates
- Dependency injection intercepts custom systems (logging, network, database) without touching production code
- View hierarchy resets after each click to test interactions in isolation
- Happo integration combines JSON diffs with screenshot tests in single CI report
Critical Insight
Airbnb's automated interaction testing generates comprehensive integration tests with zero manual Espresso code, catching regressions in click handlers that screenshot tests miss.