AccessibilityTestHelper

Helper object for accessibility-related testing utilities in Litho component hierarchies.

This object provides accessibility-specific predicates, extractors, and assertions built on top of the generic NodeInfoTestHelper. Use this for testing accessibility properties like accessibility roles, focus states, and other accessibility-related NodeInfo fields.

Usage example:

// Assert that a view tree contains a view with a specific accessibility role
AccessibilityTestHelper.assertHasAccessibilityRole(viewTree, "android.widget.Button")

// Use the extractor function for debug output
val extractor = AccessibilityTestHelper.GET_ACCESSIBILITY_ROLE_FUNCTION

Properties

Link copied to clipboard

A function that extracts accessibility role information from a View and formats it for debug output.

Functions

Link copied to clipboard
fun assertHasAccessibilityRole(viewTree: ViewTree, accessibilityRole: String)

Asserts that a ViewTree contains a view with a NodeInfo that has the specified accessibility role.