Skip to content

Instantly share code, notes, and snippets.

@makovkastar
Last active January 9, 2018 13:51
Show Gist options
  • Save makovkastar/8f8150ac157a14b6a234f09d76adcd57 to your computer and use it in GitHub Desktop.
Save makovkastar/8f8150ac157a14b6a234f09d76adcd57 to your computer and use it in GitHub Desktop.
@Test
fun isSignInButtonEnabledBinding() {
isSignInButtonEnabled.set(true)
onView(withId(R.id.button_sign_in)).check(matches(isEnabled()))
}
@Test
fun isProgressBarVisibleBinding() {
isProgressBarVisible.set(true)
onView(withId(R.id.progress_overlay)).check(matches(isDisplayed()))
}
@Test
fun emailTextChangedListenerBinding() {
onView(withId(R.id.edit_text_email)).perform(
typeText("email"), closeSoftKeyboard())
verify(emailTextChangedListener, times(5)).afterTextChanged(any())
}
@Test
fun passwordTextChangedListenerBinding() {
onView(withId(R.id.edit_text_password)).perform(
typeText("password"), closeSoftKeyboard())
verify(passwordTextChangedListener, times(8)).afterTextChanged(any())
}
@Test
fun emailFieldBinding() {
onView(withId(R.id.edit_text_email)).perform(
typeText("email"), closeSoftKeyboard())
assertThat(emailField.get(), `is`("email"))
}
@Test
fun passwordFieldBinding() {
onView(withId(R.id.edit_text_password)).perform(
typeText("password"), closeSoftKeyboard())
assertThat(passwordField.get(), `is`("password"))
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment