@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()))) }