Created
November 7, 2016 13:28
-
-
Save rsicarelli/ac8b512c457a90bd886a562a288b877c to your computer and use it in GitHub Desktop.
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 shouldShareImageFromGallery() { | |
Instrumentation.ActivityResult result = new Instrumentation.ActivityResult(Activity.RESULT_OK, data); | |
intending(hasAction(Intent.ACTION_CHOOSER)).respondWith(result); | |
onView(withId(R.id.share)).perform(click()); | |
intended(allOf( | |
hasExtras(allOf( | |
hasEntry(equalTo(Intent.EXTRA_INTENT), hasAction(Intent.ACTION_SEND)), | |
hasEntry(equalTo(Intent.EXTRA_INTENT), hasType("image/*")), | |
hasEntry(equalTo(Intent.EXTRA_TITLE), containsString("Share image") | |
), | |
hasAction(equalTo(Intent.ACTION_CHOOSER)))); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment