JakeWharton / u2020

A sample Android app which showcases advanced usage of Dagger among other open source libraries.
https://www.youtube.com/watch?v=0XHx9jtxIxU
Apache License 2.0
5.68k stars 930 forks source link

Add instrumentation test infrastructure. #151

Closed JakeWharton closed 9 years ago

JakeWharton commented 9 years ago

A custom test runner subclass flips a boolean on a debug module before the graph is created. When the graph does get created, we use that boolean to force mock mode and skip wrapping the debug controls (both because it would never be used but also to ensure view-based matchers of Espresso work). We also kill the keyguard and hold a wake lock so that the screen is on and visible.

Closes #149. Closes #152.

JakeWharton commented 9 years ago

Note: this does not actually run the tests on CI. I'll do that in a follow-up along with maybe some actual tests...

JakeWharton commented 9 years ago

Damn. Of course Travis is set up to run connectedCheck. Whevs. I'll just add it now...

JakeWharton commented 9 years ago

Test is failing but passes locally (though I'm on 5.1 emu). Thanks for the HTML report on the CI server, Gradle. Useless. Too late to look tonight, maybe tomorrow.