Testing Support Library) • To create automated UI tests for Android app • Gradle + Android Studio support • Simple and Extensible API remains open for customization
androidTestCompile 'com.android.support.test.espresso:espresso- core:2.2.2' androidTestCompile 'com.android.support.test:runner:0.5' • Under default config testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" • Create class with @RunWith(AndroidJUnit4.class) • Specify Activity to be tested with @Rule and Create test functions with @Test
to interact with views and APIs not tied to view • ViewMatchers – To identify view within view hierarchy • ViewActions – Do action on view • ViewAssertions – Verify or Assert on view
Support from API level 8 (Froyo) • Light weight, Fast and Reliable test • Rich failure information and customizable failure handling • Automatic synchronization of test actions loopmainthreaduntilidle • Can use UI automator methods • Runs on actual device or emulator, mimics user WHY