# ScreenshotTestSuite

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


```
@Incubating
interface ScreenshotTestSuite : TestSuite
```

<br />

*** ** * ** ***

Model for screenshot test suites in the Variant API.

This object is accessible on subtypes of `https://developer.android.com/reference/tools/gradle-api/9.6/com/android/build/api/variant/Variant` that implement `https://developer.android.com/reference/tools/gradle-api/9.6/com/android/build/api/variant/HasTestSuites`, via `https://developer.android.com/reference/tools/gradle-api/9.6/com/android/build/api/variant/HasTestSuites#suites()`.

## Summary

| ### Public properties |
|---|---|
| `https://docs.gradle.org/current/javadoc/org/gradle/api/provider/Provider.html<https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html>` | `https://developer.android.com/reference/tools/gradle-api/9.6/com/android/build/api/variant/ScreenshotTestSuite#engineVersion()` The version of the `com.android.tools.screenshot:screenshot-validation-junit-engine` artifact to use for layout rendering and screenshot validation. |
| `https://docs.gradle.org/current/javadoc/org/gradle/api/provider/Provider.html<https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-float/index.html>` | `https://developer.android.com/reference/tools/gradle-api/9.6/com/android/build/api/variant/ScreenshotTestSuite#imageDifferenceThreshold()` The maximum allowed percentage difference between the reference image and the rendered image for a screenshot test to pass. |

### Inherited functions

From [com.android.build.api.variant.TestSuite](https://developer.android.com/reference/tools/gradle-api/9.6/com/android/build/api/variant/TestSuite) `https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html` `https://developer.android.com/reference/tools/gradle-api/9.6/com/android/build/api/variant/TestSuite#configureTestTasks(kotlin.Function2)(action: https://docs.gradle.org/current/javadoc/org/gradle/api/tasks/testing/Test.html.(context: https://developer.android.com/reference/tools/gradle-api/9.6/com/android/build/api/dsl/TestTaskContext) -> https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html)`

Configures the test tasks for this test target.
`https://docs.gradle.org/current/javadoc/org/gradle/api/provider/Provider.html<https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html>` `@https://docs.gradle.org/current/javadoc/org/gradle/api/Incubating.html
https://developer.android.com/reference/tools/gradle-api/9.6/com/android/build/api/variant/TestSuite#instrumentationRunner(com.android.build.api.variant.TestSuiteSourceSet.TestApk)(source: https://developer.android.com/reference/tools/gradle-api/9.6/com/android/build/api/variant/TestSuiteSourceSet.TestApk)`

The instrumentationRunner to use to run the tests.
`https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html` `@https://docs.gradle.org/current/javadoc/org/gradle/api/Incubating.html
https://developer.android.com/reference/tools/gradle-api/9.6/com/android/build/api/variant/TestSuite#withTestTaskProviders(kotlin.Function2)(action: https://docs.gradle.org/current/javadoc/org/gradle/api/tasks/TaskProvider.html<https://docs.gradle.org/current/javadoc/org/gradle/api/tasks/testing/Test.html>.(context: https://developer.android.com/reference/tools/gradle-api/9.6/com/android/build/api/dsl/TestTaskContext) -> https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html)`

Runs some action on the `https://developer.android.com/reference/tools/gradle-api/9.6/com/android/build/api/variant/TestSuite` test task's `https://docs.gradle.org/current/javadoc/org/gradle/api/tasks/TaskProvider.html`.

### Inherited properties

From [org.gradle.api.Named](https://docs.gradle.org/current/javadoc/org/gradle/api/Named.html) `https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html` `https://docs.gradle.org/current/javadoc/org/gradle/api/Named.html#name` From [com.android.build.api.variant.TestSuite](https://developer.android.com/reference/tools/gradle-api/9.6/com/android/build/api/variant/TestSuite) `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/TestSuite#codeCoverageEnabled()`

Whether test coverage is enabled for this test suite.
`https://developer.android.com/reference/tools/gradle-api/9.6/com/android/build/api/variant/JUnitEngineSpec` `https://developer.android.com/reference/tools/gradle-api/9.6/com/android/build/api/variant/TestSuite#junitEngineSpec()`

Return the `https://developer.android.com/reference/tools/gradle-api/9.6/com/android/build/api/variant/JUnitEngineSpec` for this test suite.
`https://docs.gradle.org/current/javadoc/org/gradle/api/provider/Provider.html<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/TestSuite#requiresUpdateTask()`

Whether this test suite requires an extra update task.
`https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/-collection/index.html<https://developer.android.com/reference/tools/gradle-api/9.6/com/android/build/api/variant/TestSuiteSourceSet>` `https://developer.android.com/reference/tools/gradle-api/9.6/com/android/build/api/variant/TestSuite#sources()`

Return the list of sourcesets associated with this test suite.
`https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/-map/index.html<https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html, https://developer.android.com/reference/tools/gradle-api/9.6/com/android/build/api/variant/TestSuiteTarget>` `https://developer.android.com/reference/tools/gradle-api/9.6/com/android/build/api/variant/TestSuite#targets()`

Return the list of `https://developer.android.com/reference/tools/gradle-api/9.6/com/android/build/api/variant/TestSuiteTarget` for this test suite in this variant.

## Public properties

### engineVersion

Added in 9.6.0-alpha03

```
val engineVersion: Provider<String>
```

The version of the `com.android.tools.screenshot:screenshot-validation-junit-engine` artifact to use for layout rendering and screenshot validation.

### imageDifferenceThreshold

Added in 9.6.0-alpha03

```
val imageDifferenceThreshold: Provider<Float>
```

The maximum allowed percentage difference between the reference image and the rendered image for a screenshot test to pass.

Specified as a floating-point value between `0.0f` (exact match required) and `1.0f` (100% difference allowed). For example, a value of `0.0001f` represents a 0.01% difference threshold.

Default value is `0.0f` (exact match required).