Skip to content

Instantly share code, notes, and snippets.

@phellipealexandre
Last active August 20, 2018 12:43
Show Gist options
  • Save phellipealexandre/ebb871fd7ad78aa5cef17b7f05eb9b6c to your computer and use it in GitHub Desktop.
Save phellipealexandre/ebb871fd7ad78aa5cef17b7f05eb9b6c to your computer and use it in GitHub Desktop.
Robolectric instrumentation test in Kotlin
@RunWith(AndroidJUnit4::class)
class OnDeviceTest {
@get:Rule val rule = ActivityTestRule(NoteListActivity::class.java)
@Test fun clickingOnTitle_shouldLaunchEditAction() {
onView(withId(R.id.button)).perform(click())
intended(hasAction(equalTo("android.intent.action.EDIT")))
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment