mercredi 19 décembre 2018

Custom Android Test Runner not running

I'm writing a UI test suite using Espresso to test an Android app and I wanted to be able to set arguments before launching them in the CI platform - in order to turn on/off server mocking without changing code, for instance.

This seems to be possible by using the "am instrument" command, as described here: https://developer.android.com/studio/test/command-line. Then using a custom test runner which inherits AndroidJUnitRunner and set it in the gradle file via the "testInstrumentationRunner" attribute.

I have set up this class and overridden its "onCreate" method to get the incoming arguments. My problem is that it doesn't seem to run at all. For some reason, the class is never called (verified using breakpoints).

Is there something else that needs to be done in order to make it run?

Aucun commentaire:

Enregistrer un commentaire