samedi 21 mai 2016

How to rotate activity whilst testing with Espresso

I have decided that one of the testing criteria for testing my app with Android Espresso is as follows

Must test that Activity will maintain state after rotation

How do I rotate the screen when using Espresso?
I have tried the following Robotium code (Yes I placed Robotium code in my Espresso test so sue me)

solo.setActivityOrientation(solo.LANDSCAPE);
solo.setActivityOrientation(solo.PORTRAIT);

but It crashes the application when I run it within my Espresso test
Is there an espresso way to do this?
Thanks in advance for any help

Aucun commentaire:

Enregistrer un commentaire