Created
November 22, 2016 13:01
-
-
Save grumpyshoe/fdcddeed2c70c0b2b0d69428ce83ecca to your computer and use it in GitHub Desktop.
Espresso: How to add intent Extras/Bundle to IntentsTestRule
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
@Rule | |
public IntentsTestRule<MainActivity> mTestRule = new IntentsTestRule<MainActivity>(MainActivity.class){ | |
@Override | |
protected Intent getActivityIntent() { | |
Context targetContext = InstrumentationRegistry.getInstrumentation() | |
.getTargetContext(); | |
Intent result = new Intent(targetContext, MainActivity.class); | |
result.putExtra("Name", "Value"); | |
return result; | |
} | |
}; |
nurisezginspexco
commented
Feb 16, 2017
•
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment