Problem with ContentResolver in UI test - get image path
I try write test UI. I have camera with access to gallery. After click on image I get Uri of image and back to activity with absolute path of selected image. Every thing work, but not in test UI with espresso. There is a way to test it? Maybe some inject but I don't want add params in constructor of activity.
in app code:
private fun getPathFromUri(uri: Uri?): String? {
uri ?: return null
return contentResolver.query(uri, null, null, null, null).use {
it?.let {...