Open yschimke opened 3 days ago
example that includes the check ViewImage, useful for contrast failures
// Rethrow the Accessibility exception once screenshots have passed
if (accessibilityException != null) {
accessibilityException.results.forEachIndexed { index, check ->
val viewImage = check.viewImage
if (viewImage is BitmapImage) {
FileOutputStream(
"build/outputs/roborazzi/" +
"${screenshotName}_${deviceName}_$index.png",
).use {
viewImage.bitmap.compress(PNG, 100, it)
}
}
}
throw accessibilityException
}
I think we can use AwtRoboCanvas to save images while respecting user settings, such as image extensions, and to write text and frames.
Something similar to https://developer.android.com/guide/topics/ui/accessibility/testing#accessibility-scanner
Perhaps on failing accessibility checks, overlay the screenshot with the bounding box of the failure
https://developer.android.com/guide/topics/ui/accessibility/testing#accessibility-scanner