Issue
I'm trying to set up a few Espresso tests for my app.
I want to call onActivityResult() from one of the tests, but since that is protected, it won't work if the test is in a different package.
But if that test is in the same package, then trying to run unit tests fails with an error like:
Class not found: "com.example.MainActivityTest"Empty test suite.
Solution
You should not invoke onActivityResult()
from your test. What you should do, as the test would involve more than one Activity is to use UiAutomator to invoke the other Activity that send the result, interact with it to actually send the result and then in your Activity under test verify that whatever is reflected in the UI when the result is received happened.
Answered By - Diego Torres Milano
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.