# ScreenshotTestSuite

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


```
@Incubating
interface ScreenshotTestSuite
```

<br />

*** ** * ** ***

A test suite to run Compose screenshot tests.

A `https://developer.android.com/reference/tools/gradle-api/9.4/com/android/build/api/dsl/ScreenshotTestSuite` configures the execution environment and inputs required to render Compose previews and execute screenshot tests.

Example usage:

```
android {
    testOptions {
        screenshotTests {
            create("myScreenshotTest") {
                engineVersion = "1.0.0"
                targetVariants.add("debug")
                dependencies {
                    implementation(project(":my-test-helpers"))
                }
            }
        }
    }
}
```

## Summary

| ### Public functions |
|---|---|
| `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.4/com/android/build/api/dsl/ScreenshotTestSuite#dependencies(kotlin.Function1)(action: https://developer.android.com/reference/tools/gradle-api/9.4/com/android/build/api/dsl/AgpTestSuiteDependencies.() -> https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html)` Configures the dependencies for this test suite. |

| ### Public properties |
|---|---|
| `https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html?` | `https://developer.android.com/reference/tools/gradle-api/9.4/com/android/build/api/dsl/ScreenshotTestSuite#engineVersion()` The version of the screenshot validation engine. |
| `https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/-mutable-list/index.html<https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html>` | `https://developer.android.com/reference/tools/gradle-api/9.4/com/android/build/api/dsl/ScreenshotTestSuite#targetVariants()` Defines which variants this test suite targets. |

## Public functions

### dependencies

Added in 9.4.1

```
@Incubating
fun dependencies(action: AgpTestSuiteDependencies.() -> Unit): Unit
```

Configures the dependencies for this test suite.

Dependencies are added to the test suite's host (JVM) execution classpath. This enables the screenshot tests to access custom test helpers and preview providers during rendering.

## Public properties

### engineVersion

Added in 9.4.1

```
var engineVersion: String?
```

The version of the screenshot validation engine.

Specifies the version of the `com.android.tools.screenshot:screenshot-validation-junit-engine` artifact (published on the Google Maven repository) to use for layout rendering and screenshot validation.

This property is mandatory. A valid version must be provided; otherwise, a Gradle sync error will be reported.

### targetVariants

Added in 9.4.1

```
val targetVariants: MutableList<String>
```

Defines which variants this test suite targets.