# 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/9.6/com/android/build/api/variant/ApplicationVariantBuilder), [DynamicFeatureVariantBuilder](https://developer.android.com/reference/tools/gradle-api/9.6/com/android/build/api/variant/DynamicFeatureVariantBuilder), [LibraryVariantBuilder](https://developer.android.com/reference/tools/gradle-api/9.6/com/android/build/api/variant/LibraryVariantBuilder)

|---|---|
| `https://developer.android.com/reference/tools/gradle-api/9.6/com/android/build/api/variant/ApplicationVariantBuilder` | Model for application components that only contains configuration-time properties that impacts the build flow. |
| `https://developer.android.com/reference/tools/gradle-api/9.6/com/android/build/api/variant/DynamicFeatureVariantBuilder` | Model for dynamic feature components that only contains configuration-time properties that impacts the build flow. |
| `https://developer.android.com/reference/tools/gradle-api/9.6/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/9.6/com/android/build/api/variant/KotlinMultiplatformAndroidVariantBuilder)

|---|---|
| `https://developer.android.com/reference/tools/gradle-api/9.6/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 `https://developer.android.com/reference/tools/gradle-api/9.6/com/android/build/api/variant/AndroidTest` component on a `https://developer.android.com/reference/tools/gradle-api/9.6/com/android/build/api/variant/Variant`.

This is implemented by select subtypes of `https://developer.android.com/reference/tools/gradle-api/9.6/com/android/build/api/variant/VariantBuilder`.

## Summary

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