androidx.test:orchestrator in test-only module ('com.android.test')

294 views Asked by At

We are struggling to use the test orchestrator in our new test only module. We had it working fine when the tests were located in the app module.

One observation is that when working within a test-only module, dependencies are brought in slightly differently

Test only

implementation "androidx.test:runner:$androidTestRunnerVersion"
implementation "androidx.test:rules:$androidTestRulesVersion"
implementation "androidx.test.ext:truth:$androidTestTruthExtensionsVersion"

Normal app module

androidTestimplementation "androidx.test:runner:$androidTestRunnerVersion"
androidTestimplementation "androidx.test:rules:$androidTestRulesVersion"
androidTestimplementation "androidx.test.ext:truth:$androidTestTruthExtensionsVersion"

As you can see, the androidTest element is omitted. Test orchestrator is brought in using androidTestUtil.. does anyone know if there an equivalent syntax for test-only modules? Is it possible that a test-only module ignores the androidTestUtil option?

androidTestUtil 'androidx.test:orchestrator:1.3.0'

Has anyone combined test orchestrator with a test only module?!

0

There are 0 answers