I came across an interesting package containing in particular the Intents class for testing Intent sending, as well as the IntentMatchers class, as the snippet listed on the Intents class page shows:
Intent resultData = new Intent();
String phoneNumber = "123-345-6789";
resultData.putExtra("phone", phoneNumber);
ActivityResult result = new ActivityResult(Activity.RESULT_OK, resultData);
// Set up result stubbing when an intent sent to "contacts" is seen.
intending(toPackage("com.android.contacts")).respondWith(result));
But when I got to try it, Android Studio complained about not knowing these classes. I checked the Espresso jars (espresso-core and espreso-contrib) listed on the android-test-kit website and indeed I could not find any android.support.test.espresso.intent package in these jars. Is there any dependency I am missing?
Aucun commentaire:
Enregistrer un commentaire