Update Your Build Status
Not for use with personal data
Reveal and resolve accessibility issues earlier in your software development life cycle by integrating axe DevTools Mobile in your CI/CD pipeline. Find accessibility issues by running a scan and handling the results. Fail tests when issues are found, and fail builds to keep these issues from being merged with your production code. The code snippet below shows an example of how you would fail a build when accessibility issues are found in your scan results.
private fun a11yScan() {
rule.scenario.onActivity { activity ->
//1. Scan and receive the ScanResultHandler locally
val scanResultHandler = axe.scan(activity)
//2. Upload it to the dashboard
scanResultHandler?.uploadToDashboard()
//3. Use the results in your test suite
val result: AxeResult? = scanResultHandler?.getSerializedResult()
val failureCount = result?.axeRuleResults?.filter { axeRuleResult -> axeRuleResult.status == AxeStatus.FAIL }.size
//4. Fail the build if failures occurred
assertEquals(failureCount, 0)
}
}