This testing framework should do two things:
- Programmatically launch the app in an emulator, and get it into a specific state.
- Take a screenshot of the whole app in that state, and compare it against a known-good screenshot.
Presumably, step 1 can be handled by espresso, where we can feed the app certain inputs (keystrokes, clicks, etc) to get it into the state that we want. And step 2 might be handled by either the Facebook screenshot library, or by the raw ADB screenshot feature. After the screenshot is captured, it can be compared against a reference screenshot using some kind of library (in python?)
For a specific first step, let's implement the following test:
- Launch the app and open the "Barack Obama" article.
- Bonus points for using a test fixture for returning a network response, instead of talking to the live site.
- Take a screenshot
- Compare it to a reference screenshot, and output the number of pixels that are different.