Repository navigation
v0.3.1
0.3.1
Bug fix: whitespace handling in method names
Fixed snapshot filename generation for test methods whose names contain whitespace (e.g., parameterized tests like render[A, B, C]). Previously, spaces in methodName were not replaced with the delimiter,
causing filename mismatches when comparing against golden images. Spaces are now correctly replaced with the delimiter character.
New: SnapshotFileNameProvider for custom snapshot naming
Snapshot filename generation is now pluggable via the new SnapshotFileNameProvider functional interface. This lets you match the naming convention of your specific Paparazzi version and avoid filename mismatches.
The default behavior (DefaultSnapshotFileNameProvider) is unchanged from previous releases (with the whitespace fix above). To customize, pass your own implementation to tdSnapshotHandler():
val paparazzi = Paparazzi(
snapshotHandler = tdSnapshotHandler(
fileNameProvider = SnapshotFileNameProvider { snapshot, delimiter, extension ->
"${snapshot.testName.className}.${snapshot.testName.methodName}.$extension"
}
)
) New API parameter
tdSnapshotHandler() now accepts an optional fileNameProvider parameter:
fun tdSnapshotHandler(
maxPercentDifference: Double = 0.0,
fileNameProvider: SnapshotFileNameProvider = DefaultSnapshotFileNameProvider
): SnapshotHandler
Compatibility
┌───────────────┬────────┬────────┐
│ Paparazzi │ AGP │ Gradle │
├───────────────┼────────┼────────┤
│ 2.0.0-alpha02 │ 8.13.1 │ 8.13 │
├───────────────┼────────┼────────┤
│ 2.0.0-alpha04 │ 9.0.1 │ 9.2.1 │
├───────────────┼────────┼────────┤
│ ``` │ │ │
└───────────────┴────────┴────────┘