wealthfront/screencaptor

Support more ways to store captured screenshots

Opened this issue · 1 comments

Is your feature request related to a problem? Please describe.
Simple file paths aren't compatible with the recommended Test Orchestrator setting of clearPackageData: true. Like the name suggests, this setting will clear out all data belonging to your app package. So to survive the TO purge we need storage solutions that are device-level.

Describe the solution you'd like
I've seen success with storing screenshots in the device-level Pictures directory, accessible via Android's Media API. Supporting outputting screenshots would solve the problem.

Describe alternatives you've considered

  • Ask users of this library to add logic that copies any screenshots into Media (e.g. Test Rule)
  • Is there also a Screenshot directory accessible via the Media API?
  • I know Android has a new screenshot API. I wonder where those captures end up getting stored?

https://developer.android.com/reference/androidx/test/services/storage/TestStorage
perhaps TestStorage? Need to see if it's designed to be exported, or just effectively temp storage for duration of test(s).

https://github.com/android/testing-samples/blob/main/ui/espresso/ScreenshotSample/app/build.gradle
don't forget testInstrumentationRunnerArguments and androidTestUtil if you wanna use it