This course will be retired on July 14, 2025.
Heads up! To view this whole video, sign in with your Courses account or enroll in your free 7-day trial. Sign In Enroll

- 2x 2x
- 1.75x 1.75x
- 1.5x 1.5x
- 1.25x 1.25x
- 1.1x 1.1x
- 1x 1x
- 0.75x 0.75x
- 0.5x 0.5x
In this video we'll introduce UI (aka Integration) testing with Espresso - a UI testing Framework by Google!
Gradle Dependencies
androidTestCompile 'com.android.support.test.espresso:espresso-core:2.2.2'
androidTestCompile 'com.android.support:support-annotations:23.3.0'
Gradle 'default config' Part
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
Related Links
Test Methods for Copying
@Test
public void editTextUpdatesTextView() throws Exception {
// Arrange
String givenString = "test123";
// Act
// Assert
}
@Test
public void spinnerUpdatesBackgroundColor() throws Exception {
// Arrange
// Act
// Assert
}
@Test
public void buttonLaunchesOtherActivity() throws Exception {
// Arrange
// Act
// Assert
}
Related Discussions
Have questions about this video? Start a discussion with the community and Treehouse staff.
Sign up-
Alexandru Bisa
4,295 Points0 Answers
-
Lalit Bagga
3,120 Points1 Answer
-
Trudy Lee
2,812 PointsIf I want to test some fragment, which test rule should I use? Could I find out the answer from digging the Android docs
Posted by Trudy LeeTrudy Lee
2,812 Points1 Answer
View all discussions for this video
Related Discussions
Have questions about this video? Start a discussion with the community and Treehouse staff.
Sign up
You need to sign up for Treehouse in order to download course files.
Sign upYou need to sign up for Treehouse in order to set up Workspace
Sign up