-
Notifications
You must be signed in to change notification settings - Fork 220
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Preview annotation to automatically generate Paparazzi unit tests. #973
Comments
You can do it with Showkase for now. |
Doesn't Showkase add an extra activity to your app? I'd be interested if it's limited to just unit tests. |
You can get the list of all (non private) preview composables from Showkase using I have setup a custom paparazzi screenshot test which iterates over all components and takes a snapshot of each. The activity is just a way of displaying all previews inside the app. |
@apkelly You can find an example hier: https://github.com/airbnb/Showkase/tree/master/showkase-screenshot-testing-paparazzi-sample |
I'm the author of ComposablePreviewScanner, and it looks like it would perfectly help accomplish what is described in the example, likely much better than Showkase. Roborazzi currently supports creating screenshot tests out of previews with ComposablePreviewScanner since 1.22.0 and I've got pretty good feedback from it. The integration was not very hard indeed and I'm also aware many projects currently use it with Paparazzi as well. If you'd consider to integrate ComposablePreviewScanner in Paparazzi, I can gladly help with that. |
Would be amazing @sergio-sastre @jrodbx |
Each of the composables in our app have an associated Preview in the file for rendering in the IDE. It'd be great if there was a new annotation I could apply to these previews, that would be read by the Paparazzi plugin, which would create a snapshot test for that composable.
e.g.
would generate a unit test
This means I could keep my Previews close to the composable they relate too, but also means I don't have to duplicate the parameters and code for a unit test. It'd also make keeping them in sync a zero cost exercise, not need to update my unit tests if the parameters change to the composable.
The text was updated successfully, but these errors were encountered: