In an Android project, is it possible to run Compo...
# compose
m
In an Android project, is it possible to run Compose UI tests without a device (or emulator), on just the JVM? Sounds like it should be possible but I can’t find information on that.
c
If you are looking specifically for screenshot tests then consider https://github.com/cashapp/paparazzi
t
I didn’t setup it myself but I saw people using Robolectric for running the UI tests as Unit tests
g
Robolectic should work but I haven't managed to get those two to cooperate yet
m
Paparazzi looks good, but since official screenshot testing from Google should be coming soon, I’d rather wait for that.
If I was more interested here in tests that interact with the component, not screenshot tests, it looks like Robolectric is the only way? I would have imaged that since Android Studio can run Compose previews, and Compose can also run on the Desktop target, tests should be able to run without a device too.
c
Now that I think of it, I don't think paparazzi is restricted to screenshot tests. Consider asking this question in #squarelibraries
y
Robolectric works nicely for this. You'll be surprised, how simple it is.
Paparazzi is a focused on screenshot testing, so harder to test more interaction focused tests.
c
@Marcin Wisniowski we are working on just that, host side screenshot testing without need for a device. It’s not ready yet though.
f
m
I'm aware of Gradle managed devices, but was interested in not needing the overhead of an emulator at all. Looking forward to Google's screenshot testing!
c
What about using roborazzi? https://github.com/takahirom/roborazzi
m
@Chris Sinco [G] Is there anywhere I can “star”/follow progress/get notified about Compose screenshot testing when it’s released?
c
We don’t have a public issue tracking this unfortunately. We hope to release something in canary in Q1 2024 but no promises. We do plan to discuss more of the details though at droidCon London at the end of October.