This is a very short recap of accessibility testing features for Android that were announced at Google IO. This also includes links to the official resources.
3. Espresso 2.2+
• Standardized a11y unit tests available
@Before
public void setUp() {
AccessibilityChecks.enable();
}
Espresso: https://developer.android.com/tools/testing-support-library/index.html#Espresso
AccessibilityChecks: http://developer.android.com/reference/android/support/test/espresso/contrib/AccessibilityChecks.html
Enabling AccessibilityChecks will run through the app and check for accessibility errors.
Auto updates with latest tests from Google
4. Robolectric
• Also include AccessibilityChecks
@Test
@AccessibilityChecks
public void testFooBar…
Sample Result:
View is missing speakable text needed for a screen reader
java.lang.RuntimeException: View has accessibility issues.
Robolectric: http://robolectric.org/
Robolectric + AccessibilityChecks: https://github.com/robolectric/robolectric/blob/master/robolectric-annotations/src/main/java/org/robolectric/annotation/
AccessibilityChecks.java
5. This is not yet available. It’s an app that you install on the device. It adds a floating button to the screen. You then open an app and press the button. This generates a full
report of accessibility issues and should include web view issues.
6. Pressing the test button triggers a full report.
This is not yet available. I don’t know if you can export the report. I believe it can detect errors within a web view.