Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature Request] show Accessibility checks visually #568

Open
yschimke opened this issue Nov 22, 2024 · 2 comments
Open

[Feature Request] show Accessibility checks visually #568

yschimke opened this issue Nov 22, 2024 · 2 comments

Comments

@yschimke
Copy link
Contributor

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

image

@yschimke
Copy link
Contributor Author

yschimke commented Nov 23, 2024

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
    }

@takahirom
Copy link
Owner

I think we can use AwtRoboCanvas to save images while respecting user settings, such as image extensions, and to write text and frames.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants