Open PawelKwiecinski opened 2 years ago
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.
This typically indicates that you're not calling flush()
appropriately like so: https://github.com/facebook/screenshot-tests-for-android/blob/f22eab67ea1eed54d2de126de08657c775692197/core/src/main/java/com/facebook/testing/screenshot/ScreenshotRunner.java#L53
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
permission