jeudi 21 septembre 2017

Android Test Orchestrator and custom Application class

I gave a try to Android Test Orchestrator and it doesn't see any tests if Application class were changed. Pretty easy to reproduce.

  1. In Android Studio 3 preview Beta 6 create simple project with wizard
  2. Create custom runner like:
    class CustomTestRunner : AndroidJUnitRunner() {
      override fun newApplication(cl: ClassLoader?, className: String?,   context: Context?): Application {
       return super.newApplication(cl, TestApplicationClass::class.simpleName, context)
      }
    }

  1. Replace instrumentation runner with new one
  2. No test found after running instrumented tests

Any ideas? Looks like the Orchestrator depends on application class name from manifest.

I use this configuration to use special Dagger dependencies for tests.

Aucun commentaire:

Enregistrer un commentaire