1.33.0
Experimental Accessibility Test Framework checks
Thanks to @yschimke's contribution, we now have a library that integrates accessibility checks into Roborazzi. It uses the Accessibility Test Framework to ensure accessibility.
Please add the library dependency:
testImplementation("io.github.takahirom.roborazzi:roborazzi-accessibility-check:[version]")
https://github.com/takahirom/roborazzi/tree/main/roborazzi-accessibility-check
Configure in Junit Rule
@get:Rule
val roborazziRule = RoborazziRule(
composeRule = composeTestRule,
captureRoot = composeTestRule.onRoot(),
options = Options(
roborazziAccessibilityOptions = RoborazziATFAccessibilityCheckOptions(
checker = RoborazziATFAccessibilityChecker(
checks = setOf(NoRedTextCheck()),
suppressions = matchesElements(withTestTag("suppress"))
),
failureLevel = RoborazziATFAccessibilityChecker.CheckLevel.Warning
),
// If you want to automatically check accessibility after a test, use AccessibilityCheckAfterTestStrategy.
accessibilityCheckStrategy = AccessibilityCheckAfterTestStrategy(),
)
)
Add accessibility checks
composeTestRule.onNodeWithTag("nothard").checkRoboAccessibility(
// If you don't specify options, the options in RoborazziRule will be used.
roborazziATFAccessibilityCheckOptions = RoborazziATFAccessibilityCheckOptions(
checker = RoborazziATFAccessibilityChecker(
preset = AccessibilityCheckPreset.LATEST,
),
failureLevel = RoborazziATFAccessibilityChecker.CheckLevel.Warning
)
)
Not only is this library designed to make our app accessible to everyone, but I also believe that AI agent testing will be a future trend, and we want to prepare for it. I think this could help make our app accessible to AI as well, enabling agents to interact with it, such as clicking on image buttons using content descriptions. Additionally, we can create custom checks, like NoRedTextCheck, specifically for AI.
What's Changed
- Include AI assertion results in the Roborazzi test report by @takahirom in #552
- Add modules and configurations to dependency diff by @takahirom in #558
- Update Robolectric 4.14 by @takahirom in #426
- Add basic ATF A11y checks via AccessibilityCheckAfterTestStrategy and checkRoboAccessibility by @yschimke in #557
- [Dependency for sample in Roborazzi, Not a library dependency change]Update dependency androidx.compose.foundation:foundation to v1.7.5 by @renovate in #520
Full Changelog: 1.32.2...1.33.0