Skip to content

Instantly share code, notes, and snippets.

@heitorcolangelo
Created September 7, 2016 17:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save heitorcolangelo/98e0552095862fdff677d2d7d13ccd2a to your computer and use it in GitHub Desktop.
Save heitorcolangelo/98e0552095862fdff677d2d7d13ccd2a to your computer and use it in GitHub Desktop.
UserDetailsActivityTest - runtime permission error
@Test
public void clickOnPhone_shouldStartPhoneIntent() {
mActivityRule.launchActivity(createIntent(false));
Intents.init();
intending(hasAction(Intent.ACTION_CALL))
.respondWith(new Instrumentation.ActivityResult(Activity.RESULT_OK, new Intent()));
onView(withId(R.id.user_details_phone)).perform(scrollTo(), click());
intended(hasAction(Intent.ACTION_CALL));
Intents.release();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment