You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm trying to add screenshot testing using screenshot-tests-for-android and ran into an issue where I cannot get it to work. The error I get:
ls: /sdcard/screenshots/com.xyz.test/screenshots-default/metadata.json: No such file or directory
ls: /data/data/com.xyz.test/app_screenshots-default/metadata.json: No such file or directory
The tests live is a library module. Test uses androidx.fragment.app.testing.launchFragmentInContainer, then waits for it and calls Screenshot.snapActivity(fragment.activity!!). I use a custom test runner configured exactly as in the docs to call onCreate + onDestroy. Tests Use Junit4 + Espresso. The screenshot files themselves get generated, saved and pulled correctly. But the whole thing fails because of the missing metadata.
Things I've tried:
with/without orchestrator
check logcat (nothing related to the issue there)
use snap(fragment!!.view) -> same issue
add all the test data by hand using setName(), etc
use different API level emulators: 28,29,27
make sure both lib AndroidManifest.xml and test AndroidManifest.xml have WRITE_EXTERNAL_STORAGE permission
probably couple other things I've forgot
The text was updated successfully, but these errors were encountered:
With what I believe is a similar setup (aar + sample app), I ended up putting tests into sample app. My manifest under sample/androidTest not only has WRITE_EXTERNAL_STORAGE, but also package (ending with test) and android:sharedUserId (ending with uid) - something sample app also has in its manifest. The above works for me under API28. APIs beyond come with scoped storage, but it's another story.
I'm trying to add screenshot testing using screenshot-tests-for-android and ran into an issue where I cannot get it to work. The error I get:
The tests live is a library module. Test uses
androidx.fragment.app.testing.launchFragmentInContainer
, then waits for it and callsScreenshot.snapActivity(fragment.activity!!)
. I use a custom test runner configured exactly as in the docs to call onCreate + onDestroy. Tests Use Junit4 + Espresso. The screenshot files themselves get generated, saved and pulled correctly. But the whole thing fails because of the missing metadata.Things I've tried:
snap(fragment!!.view)
-> same issuesetName()
, etcWRITE_EXTERNAL_STORAGE
permissionThe text was updated successfully, but these errors were encountered: