ScreenshotTestSuite

Added in 9.5.0-alpha03

@Incubating
interface ScreenshotTestSuite : TestSuite


Model for screenshot test suites in the Variant API.

This object is accessible on subtypes of Variant that implement HasTestSuites, via HasTestSuites.suites.

Summary

Public properties

Provider<String>

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

Provider<Float>

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

Inherited functions

From org.gradle.api.Named
From com.android.build.api.variant.TestSuite
Unit
configureTestTasks(action: Test.(context: TestTaskContext) -> Unit)

Configures the test tasks for this test target.

Provider<String>

The instrumentationRunner to use to run the tests.

Unit

Runs some action on the TestSuite test task's TaskProvider.

Inherited properties

From com.android.build.api.variant.TestSuite
Property<Boolean>

Turns on or off the code coverage support.

JUnitEngineSpec

Return the JUnitEngineSpec for this test suite.

Provider<Boolean>

Whether this test suite requires an extra update task.

Collection<TestSuiteSourceSet>

Return the list of sourcesets associated with this test suite.

Map<StringTestSuiteTarget>

Return the list of TestSuiteTarget for this test suite in this variant.

Public properties

engineVersion

Added in 9.5.0-alpha03
val engineVersionProvider<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.5.0-alpha03
val imageDifferenceThresholdProvider<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).