Skip to content

Commit e77dedf

Browse files
committed
logging
1 parent 3e4f66b commit e77dedf

File tree

1 file changed

+4
-2
lines changed
  • core/screenshot-testing/src/main/kotlin/com/google/samples/apps/nowinandroid/core/testing/util

1 file changed

+4
-2
lines changed

core/screenshot-testing/src/main/kotlin/com/google/samples/apps/nowinandroid/core/testing/util/ScreenshotHelper.kt

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ import com.google.samples.apps.nowinandroid.core.designsystem.theme.NiaTheme
5050
import org.hamcrest.Matcher
5151
import org.hamcrest.Matchers
5252
import org.robolectric.RuntimeEnvironment
53+
import java.io.File
5354
import java.io.FileOutputStream
5455

5556
val DefaultRoborazziOptions =
@@ -134,9 +135,10 @@ fun <A : ComponentActivity> AndroidComposeTestRule<ActivityScenarioRule<A>, A>.c
134135
accessibilityException.results.forEachIndexed { index, check ->
135136
val viewImage = check.viewImage
136137
if (viewImage is BitmapImage) {
138+
val file = File("build/outputs/roborazzi/${screenshotName}_${deviceName}_$index.png")
139+
println("Writing check.viewImage to $file")
137140
FileOutputStream(
138-
"build/outputs/roborazzi/" +
139-
"${screenshotName}_${deviceName}_$index.png",
141+
file,
140142
).use {
141143
viewImage.bitmap.compress(PNG, 100, it)
142144
}

0 commit comments

Comments
 (0)