pull/1708/head
Yuri Schimke 1 month ago
parent 3e4f66b489
commit e77dedf0dc

@ -50,6 +50,7 @@ import com.google.samples.apps.nowinandroid.core.designsystem.theme.NiaTheme
import org.hamcrest.Matcher import org.hamcrest.Matcher
import org.hamcrest.Matchers import org.hamcrest.Matchers
import org.robolectric.RuntimeEnvironment import org.robolectric.RuntimeEnvironment
import java.io.File
import java.io.FileOutputStream import java.io.FileOutputStream
val DefaultRoborazziOptions = val DefaultRoborazziOptions =
@ -134,9 +135,10 @@ fun <A : ComponentActivity> AndroidComposeTestRule<ActivityScenarioRule<A>, A>.c
accessibilityException.results.forEachIndexed { index, check -> accessibilityException.results.forEachIndexed { index, check ->
val viewImage = check.viewImage val viewImage = check.viewImage
if (viewImage is BitmapImage) { if (viewImage is BitmapImage) {
val file = File("build/outputs/roborazzi/${screenshotName}_${deviceName}_$index.png")
println("Writing check.viewImage to $file")
FileOutputStream( FileOutputStream(
"build/outputs/roborazzi/" + file,
"${screenshotName}_${deviceName}_$index.png",
).use { ).use {
viewImage.bitmap.compress(PNG, 100, it) viewImage.bitmap.compress(PNG, 100, it)
} }

Loading…
Cancel
Save