Skip to content

Instantly share code, notes, and snippets.

@phellipealexandre
Created January 4, 2020 00:11
Show Gist options
  • Save phellipealexandre/f449d4d7833d60da51a54480a87be43a to your computer and use it in GitHub Desktop.
Save phellipealexandre/f449d4d7833d60da51a54480a87be43a to your computer and use it in GitHub Desktop.
@RunWith(AndroidJUnit4::class)
class ChangeTextBehaviorTest {
@get:Rule
var activityRule: ActivityTestRule<MainActivity> = ActivityTestRule(MainActivity::class.java)
@Test
fun changeText_sameActivity() {
onView(withId(R.id.editTextUserInput)).perform(typeText("Espresso"), closeSoftKeyboard())
onView(withId(R.id.changeTextBt)).perform(click())
onView(withId(R.id.textToBeChanged)).check(matches(withText("Espresso")))
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment