From e77dedf0dcb85c3e33a635d141444e06f7256bf1 Mon Sep 17 00:00:00 2001 From: Yuri Schimke Date: Sat, 23 Nov 2024 06:47:12 +0000 Subject: [PATCH] logging --- .../apps/nowinandroid/core/testing/util/ScreenshotHelper.kt | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) 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) }