@Documented @Retention(value=RUNTIME) @Target(value={TYPE,METHOD}) public @interface AccessibilityChecks
Robolectric can check for certain kinds of accessibility bugs while running your tests. These are bugs that interfere with services that allow users with disabilities to access your UI. When these checks are enabled, calling Robolectric.onClick()
will run a series of checks on your UI and throw exceptions if errors are present.
Modifier and Type | Optional Element and Description |
---|---|
boolean |
enabled
Enable or disable accessibility checking.
|
AccessibilityChecks.ForRobolectricVersion |
forRobolectricVersion
Accessibility checking can be a moving target.
|
public abstract boolean enabled
Enable or disable accessibility checking.
public abstract AccessibilityChecks.ForRobolectricVersion forRobolectricVersion
Accessibility checking can be a moving target. As new checks are added to Robolectric, these checks may reveal issues with a UI that previously passed all checks (but were probably affecting users all along). This option forces Robolectric to run only those checks that were present in a specified version of Robolectric, which reduces the opportunity for a new bug to be discovered in an old test. Note that this option does not guarantee that the behavior of individual checks won’t change as bugs are fixed and/or features added to checks that existed in the specified version.