# HasAndroidTestBuilder

# HasAndroidTestBuilder

[View Source](https://cs.android.com/search?q=file:com/android/build/api/variant/HasAndroidTestBuilder.kt+class:com.android.build.api.variant.HasAndroidTestBuilder)  
Added in 7.0.0  


```
@ReplacedByIncubating(message = "Replaced by the new interface HasDeviceTestsBuilder", bugId = 357083708)
interface HasAndroidTestBuilder
```

<br />

Known direct subclasses  
[ApplicationVariantBuilder](https://developer.android.com/reference/tools/gradle-api/8.12/com/android/build/api/variant/ApplicationVariantBuilder), [DynamicFeatureVariantBuilder](https://developer.android.com/reference/tools/gradle-api/8.12/com/android/build/api/variant/DynamicFeatureVariantBuilder), [LibraryVariantBuilder](https://developer.android.com/reference/tools/gradle-api/8.12/com/android/build/api/variant/LibraryVariantBuilder)  

|----------------------------------------------------------------------------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------|
| [ApplicationVariantBuilder](https://developer.android.com/reference/tools/gradle-api/8.12/com/android/build/api/variant/ApplicationVariantBuilder)       | Model for application components that only contains configuration-time properties that impacts the build flow.     |
| [DynamicFeatureVariantBuilder](https://developer.android.com/reference/tools/gradle-api/8.12/com/android/build/api/variant/DynamicFeatureVariantBuilder) | Model for dynamic feature components that only contains configuration-time properties that impacts the build flow. |
| [LibraryVariantBuilder](https://developer.android.com/reference/tools/gradle-api/8.12/com/android/build/api/variant/LibraryVariantBuilder)               | Model for library components that only contains configuration-time properties that impacts the build flow.         |

Known indirect subclasses  
[KotlinMultiplatformAndroidVariantBuilder](https://developer.android.com/reference/tools/gradle-api/8.12/com/android/build/api/variant/KotlinMultiplatformAndroidVariantBuilder)  

|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------|
| [KotlinMultiplatformAndroidVariantBuilder](https://developer.android.com/reference/tools/gradle-api/8.12/com/android/build/api/variant/KotlinMultiplatformAndroidVariantBuilder) | Model for kotlin multiplatform library components that only contains configuration-time properties that impacts the build flow. |

*** ** * ** ***

Interface that marks the potential existence of [AndroidTest](https://developer.android.com/reference/tools/gradle-api/8.12/com/android/build/api/variant/AndroidTest) component on a [Variant](https://developer.android.com/reference/tools/gradle-api/8.12/com/android/build/api/variant/Variant).

This is implemented by select subtypes of [VariantBuilder](https://developer.android.com/reference/tools/gradle-api/8.12/com/android/build/api/variant/VariantBuilder).

## Summary

|                                                        ### Public properties                                                         |
|--------------------------------------------------------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [AndroidTestBuilder](https://developer.android.com/reference/tools/gradle-api/8.12/com/android/build/api/variant/AndroidTestBuilder) | [androidTest](https://developer.android.com/reference/tools/gradle-api/8.12/com/android/build/api/variant/HasAndroidTestBuilder#androidTest()) Variant's [AndroidTestBuilder](https://developer.android.com/reference/tools/gradle-api/8.12/com/android/build/api/variant/AndroidTestBuilder) configuration to turn on or off android tests and set other android test related settings. |
| [Boolean](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html)                                                   | [androidTestEnabled](https://developer.android.com/reference/tools/gradle-api/8.12/com/android/build/api/variant/HasAndroidTestBuilder#androidTestEnabled()) Set to `true` if the variant's has any android tests, false otherwise.                                                                                                                                                      |
| [Boolean](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html)                                                   | [enableAndroidTest](https://developer.android.com/reference/tools/gradle-api/8.12/com/android/build/api/variant/HasAndroidTestBuilder#enableAndroidTest()) Set to `true` if the variant's has any android tests, false otherwise.                                                                                                                                                        |

## Public properties

### androidTest

Added in 8.3.1  

```
val androidTest: AndroidTestBuilder
```

Variant's [AndroidTestBuilder](https://developer.android.com/reference/tools/gradle-api/8.12/com/android/build/api/variant/AndroidTestBuilder) configuration to turn on or off android tests and set other android test related settings.  

### androidTestEnabled

Added in 7.0.0  

```
var androidTestEnabled: Boolean
```

Set to `true` if the variant's has any android tests, false otherwise. Value is Boolean#True by default.  

### enableAndroidTest

Added in 7.0.0  

```
var enableAndroidTest: Boolean
```

Set to `true` if the variant's has any android tests, false otherwise. Value is Boolean#True by default.