Annotation Type AccessibilityChecks


  • @Documented
    @Retention(RUNTIME)
    @Target({TYPE,METHOD})
    @Deprecated
    public @interface AccessibilityChecks
    Deprecated.
    Use Espresso instead. Will be removed after Robolectric 4.4.
    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.

    Requires org.robolectric:plugin-accessibility-deprecated.

    • Element Detail

      • enabled

        boolean enabled
        Deprecated.
        Enable or disable accessibility checking.
        Returns:
        True if accessibility checking is enabled.
        Default:
        true
      • forRobolectricVersion

        AccessibilityChecks.ForRobolectricVersion forRobolectricVersion
        Deprecated.
        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.
        Returns:
        Run all checks corresponding to this version of Robolectric.
        Default:
        org.robolectric.annotation.AccessibilityChecks.ForRobolectricVersion.LATEST