lundi 19 mars 2018

How to put test data files on a device for instrumental tests?

What is the best/proper way to upload the test data files onto the device before the instrumentation (Espresso) tests?

I want to test app functionality when a user selects some files on the device file system and my app are processing these files and prepare the app state for further functional testing.

I tried to write it to the file system by the first test right from the test apk assets. However there are problems with permissions. My tested apk does not have the WRITE_EXTERNAL_STORAGE and anyway I'm afraid that is not good way since the modern Android security model with a interactive permission requests to users.

May be I have to integrate it into the gradle script somehow?

Also please note I have 2 types of testing: debug and staging(to test apk with minifyEnabled)

And I'm interested with a way which will be fine for Firebase Test Labs as well.

Thank you.

Aucun commentaire:

Enregistrer un commentaire