Issue
Looking at the following method in Google sample for intents:
@Before
public void stubAllExternalIntents() {
// By default Espresso Intents does not stub any Intents. Stubbing needs to be setup before
// every test run. In this case all external Intents will be blocked.
intending(not(isInternal())).respondWith(new ActivityResult(Activity.RESULT_OK, null));
}
I see that all external intents will be blocked but I was wondering what purpose does this method serve?
Solution
You want to perform hermetic testing, meaning that you are not interested in system intents, which may cause test flakiness depending on your assertions, that's why you are prohibiting intents that are not from your app (not(isInternal())
).
Answered By - azizbekian
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.