Last active
September 7, 2019 23:52
-
-
Save AlexZhukovich/e9ee9b85c9f720de32ff27939e5113aa to your computer and use it in GitHub Desktop.
Sign In error verification Android UI tests with Espresso
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@RunWith(AndroidJUnit4::class) | |
class EspressoSignInTest { | |
@Rule @JvmField | |
val activityRule = ActivityTestRule<SignInActivity>(SignInActivity::class.java) | |
@Test | |
fun shouldDisplaySinInErrorWhenEmailIsIncorrect() { | |
val incorrectEmail = "test" | |
onView(withId(R.id.email)) | |
.perform(replaceText(incorrectEmail), closeSoftKeyboard()) | |
onView(withId(R.id.signIn)) | |
.perform(click()) | |
onView(withText(R.string.error_email_should_be_valid)) | |
.check(matches(isDisplayed())) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment