引用
The compelling thing about developing Espresso was making it easy and fun for developers to write reliable UI tests. Espresso has a small, predictable, and easy to learn API, which is still open for customization. But most importantly - Espresso removes the need to think about the complexity of multi-threaded testing. With Espresso, you can think procedurally and write concise, beautiful, and reliable Android UI tests quickly.
Google目前已经在超过30多个应用(Drive、Maps、G+)中使用Espresso。
public void testSayHello() { onView(withId(R.id.name_field)) .perform(typeText("Steve")); onView(withId(R.id.greet_button)) .perform(click()); onView(withText("Hello Steve!")) .check(matches(isDisplayed())); }
Espresso
https://code.google.com/p/android-test-kit/wiki/Espresso
Espresso Start Guide
https://code.google.com/p/android-test-kit/wiki/EspressoStartGuide
Espresso Samples
https://code.google.com/p/android-test-kit/wiki/EspressoSamples
Espresso for Android - a Demo
http://www.youtube.com/watch?v=qtKx1WxK7cw