Last active
March 18, 2021 03:03
-
-
Save Senemix29/e97ede445c5f7063ddd03e45c89622be to your computer and use it in GitHub Desktop.
Example of Android Instrumented tests using 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
| @Test | |
| fun shouldEnableButtonWhenValidMessageIsTyped() { | |
| onView(withId(R.id.messageField)).perform(typeText("you do not talk about Fight Club")) | |
| onView(withId(R.id.sendButton)).check(matches(isEnabled())) | |
| } | |
| @Test | |
| fun shouldNotEnableButtonWhenInvalidMessageIsTyped() { | |
| onView(withId(R.id.messageField)).perform(typeText("Hey, let me tell you about the Fight Club")) | |
| onView(withId(R.id.sendButton)).check(matches(not(isEnabled()))) | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment