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

eygraber

06/13/2022, 2:12 AM
Is there a way to take screenshots using
ComposeTestRule
with Robolectric. Currently getting
androidx.compose.ui.test.ComposeTimeoutException: Condition still not satisfied after 2000 ms
errors on
captureToImage
when calling
Copy code
rule.onRoot().captureToImage().asAndroidBitmap().compress(Bitmap.CompressFormat.PNG, 100, FileOutputStream(File("test.png")))
e

eygraber

06/13/2022, 2:20 AM
So without using Robolectric it should be fine? Does that mean I would need to run on a physical device / emulator in order for screenshots to work?
e

ephemient

06/13/2022, 2:21 AM
or use https://github.com/cashapp/paparazzi #squarelibraries
🙏 1
130 Views