https://kotlinlang.org logo
#compose
Title
# compose
s

shivansh mittal

04/07/2022, 7:33 PM
Hi, I am trying to write fast, deterministic screenshot tests for compose components, I am using facebook screenshot testing library : is there a way to ComposeView to draw or generate bitmap without attaching to a window? Or any recommendation to write fast screenshot tests for jetpack compose components without starting an activity
😯 1
j

jw

04/07/2022, 8:46 PM
Considered paparazzi?
t

tad

04/07/2022, 8:57 PM
There's
ComposeScene
but that's desktop-only
a

Albert Chang

04/08/2022, 1:08 AM
We are using Paparazzi and it’s working well. Just note that you need to use snapshot version at the moment.
👍 1
j

james

04/08/2022, 4:28 AM
at my day job, the team is currently looking at using “Shot” which is another library for snapshot testing. it’s mid-evaluation right now, but we haven’t looked into Paparazzi, which I personally had forgotten all about the team was really just looking at the FB library or Shot, but perhaps I need to throw Paparazzi into the mix.. is it correct to say that it doesn’t matter if you have a mixture of old Activities and Fragments plus new Composables, that Paparazzi can handle old those layouts too? I mean specifically, layouts which were not written with custom views, but just layout files inflated into stock standard Fragments?
a

Albert Chang

04/08/2022, 8:44 AM
Yep. Paparazzi was originally created for the view system.
s

shivansh mittal

04/14/2022, 5:59 PM
paparazzi seems cool, but currently it does not support taking screenshot without device frame, or only the composable