A library to help auto-generate screenshot tests from Composable Previews with any screenshot testing library: JVM-based (i.e. Paparazzi, Roborazzi) as well as Instrumentation-based (i.e. Shot, Dropshots, Android-Testify, etc.)
The most common scenario is to have @Previews as functions in a file, instead of defining them inside a class.
So like this
// #1
@Composable
@Preview
fun CoffeeDrinkListPreview() {
MyComposable(...)
}
instead of this
// #2
class PreviewsForScreenshotTests {
@Composable
@Preview
fun CoffeeDrinkListPreview() {
MyComposable(...)
}
}
However, the # 2 is for example, what Google's Compose Preview Screenshot Testing tool requires to execute tests.
This is currently not supported by ComposablePreviewScanner, and throws the following exception in that case
java.lang.NullPointerException: Cannot invoke "Object.getClass()" because "obj" is null
It'd be convenient to also support such case, so one can smoothly transition from one library to another
The most common scenario is to have
@Preview
s as functions in a file, instead of defining them inside a class. So like thisinstead of this
However, the # 2 is for example, what Google's Compose Preview Screenshot Testing tool requires to execute tests. This is currently not supported by ComposablePreviewScanner, and throws the following exception in that case
It'd be convenient to also support such case, so one can smoothly transition from one library to another