Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support more ways to store captured screenshots #17

Open
cmathew opened this issue Aug 5, 2021 · 1 comment
Open

Support more ways to store captured screenshots #17

cmathew opened this issue Aug 5, 2021 · 1 comment

Comments

@cmathew
Copy link
Contributor

cmathew commented Aug 5, 2021

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?
@cmathew
Copy link
Contributor Author

cmathew commented Apr 17, 2023

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

1 participant