diff --git a/core/screenshot-testing/src/main/kotlin/com/google/samples/apps/nowinandroid/core/testing/util/ScreenshotHelper.kt b/core/screenshot-testing/src/main/kotlin/com/google/samples/apps/nowinandroid/core/testing/util/ScreenshotHelper.kt index 00c54e909..cca781725 100644 --- a/core/screenshot-testing/src/main/kotlin/com/google/samples/apps/nowinandroid/core/testing/util/ScreenshotHelper.kt +++ b/core/screenshot-testing/src/main/kotlin/com/google/samples/apps/nowinandroid/core/testing/util/ScreenshotHelper.kt @@ -50,6 +50,7 @@ import com.google.samples.apps.nowinandroid.core.designsystem.theme.NiaTheme import org.hamcrest.Matcher import org.hamcrest.Matchers import org.robolectric.RuntimeEnvironment +import java.io.File import java.io.FileOutputStream val DefaultRoborazziOptions = @@ -134,9 +135,10 @@ fun AndroidComposeTestRule, A>.c accessibilityException.results.forEachIndexed { index, check -> val viewImage = check.viewImage if (viewImage is BitmapImage) { + val file = File("build/outputs/roborazzi/${screenshotName}_${deviceName}_$index.png") + println("Writing check.viewImage to $file") FileOutputStream( - "build/outputs/roborazzi/" + - "${screenshotName}_${deviceName}_$index.png", + file, ).use { viewImage.bitmap.compress(PNG, 100, it) }