jeudi 16 juillet 2015

Android testing: asserting an activity is paused

I am looking at tests on Android activities. I would like to test the activity lifecycle and particularly the end of my activity to start another activity (I am testing the end of the first activity, not the start of the second). I am using ActivityInstrumentationTestCase2 and Android Espresso with JUnit 4 tests.

I have tried to assert that once I trigger the end of an activity, by pressing a button on the screen, the activity is paused or not visible but I ran out of luck so far. Is there any good practice to test transitions between activities?

Aucun commentaire:

Enregistrer un commentaire