This file contains hidden or 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
@RunWith(AndroidJUnit4.class) | |
public class MultipleIntentsTest { | |
@Rule | |
public ActivityTestRule<MyActivity> testRule = new ActivityTestRule<>(MyActivity.class, | |
false, // initialTouchMode | |
false); // launchActivity. False to set intent per test); | |
@Test | |
public void testOscarGrouchy() { | |
Intent grouchyIntent = new Intent(); |
This file contains hidden or 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
/* | |
* This class is used for buttons that have a pressed state animation. | |
* Can't use default click() because espresso bug where click becomes long click, which causes | |
* animation, which causes tests to stall because ui thread is busy. :( | |
* https://code.google.com/p/android-test-kit/issues/detail?id=45 | |
*/ | |
public class CallOnClickAction implements ViewAction { | |
@Override | |
public Matcher<View> getConstraints() { | |
return allOf(isClickable(), isDisplayed()); |
This file contains hidden or 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
private static class CustomFailureHandler implements FailureHandler { | |
private final FailureHandler delegate; | |
public CustomFailureHandler(Context targetContext) { | |
delegate = new DefaultFailureHandler(targetContext); | |
} | |
@Override | |
public void handle(Throwable error, Matcher<View> viewMatcher) { | |
try { |