Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Does androidTest support flavors and build type variants?

Does androidTest support flavors and build type variants?

flavorDimensions "foo"
productFlavors {
  full {
    dimension "foo"
  }         
  trial {
    dimension "foo"
  }
}

If there is only src/androidTest/java, which variant to test?

like image 609
eastwater Avatar asked Feb 20 '18 23:02

eastwater


1 Answers

You can create tests for specific flavors in src/androidTestFull and src/androidTestTrial. Any tests that are common to all flavors go in src/androidTest.

The instrumented tests in src/androidTest/ source set are shared by all build variants. When building a test APK for the "MyFlavor" variant of your app, Gradle combines both the src/androidTest/ and src/androidTestMyFlavor/ source sets.

Source

like image 148
Code-Apprentice Avatar answered Oct 17 '22 08:10

Code-Apprentice