SnapshotReferenceDirectory

Finds an existing snapshot reference directory for a test class without choosing a snapshot library or recording policy.

For a test class com.example.HomeScreenTest, candidates are <root>/<directoryName>/HomeScreenTest/ for each root, in order. Only existing directories match. Pass the result's path to Roborazzi, Paparazzi, or another library, and fall back to its default location when this returns null.

Properties

Link copied to clipboard

The default reference folder name.

Functions

Link copied to clipboard
fun resolve(testClass: Class<*>, roots: List<File>, directoryName: String = DEFAULT_DIRECTORY_NAME): File?

Returns the first existing reference directory for testClass.

fun resolve(testName: String, roots: List<File>, directoryName: String = DEFAULT_DIRECTORY_NAME): File?

Returns the first existing reference directory named testName.