Created
June 20, 2017 10:46
-
-
Save vuhung3990/a0a38c4c371c1c40f923641fb08dc8f7 to your computer and use it in GitHub Desktop.
test intent
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
androidTestCompile('com.android.support.test.espresso:espresso-intents:2.2.2', { | |
exclude group: 'com.android.support', module: 'support-annotations' | |
}) |
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
public class MainActivityTest { | |
@Rule | |
public IntentsTestRule<MainActivity> rule = new IntentsTestRule<MainActivity>(MainActivity.class); | |
@Test | |
public void openExport_shouldPass() throws Exception { | |
onView(withId(R.id.export_contact)).perform(click()); | |
intended( | |
allOf( | |
hasComponent(ContactActivity.class.getCanonicalName()), | |
hasExtras( | |
allOf( | |
hasEntry(equalTo(ContactActivity.TITLE), equalTo(R.string.export_title)) | |
) | |
) | |
)); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment