Last active
September 9, 2016 02:16
-
-
Save heitorcolangelo/47601a09fd3082cc1b40c36d28aad2be to your computer and use it in GitHub Desktop.
UserDetailsActivityTest - test with permission
This file contains 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 | |
public void clickOnPhone_shouldStartPhoneIntent() throws IOException { | |
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()); | |
PermissionUtils.allowPermissionsIfNeeded(Manifest.permission.CALL_PHONE); | |
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