ビルドステータスを更新する

This page is not available in the language you requested. You have been redirected to the English version of the page.
Link to this page copied to clipboard
Not for use with personal data

Axe DevTools Mobile を CI/CD パイプラインに統合することで、ソフトウェア開発ライフサイクルの早い段階でアクセシビリティの問題を明らかにし、解決します。スキャンを実行し、結果に対応する によってアクセシビリティの問題を発見します。問題が見つかった場合はテストを失敗させ、ビルドが本番コードと一緒にマージされないようにビルドを失敗させます。以下のコードスニペットは、スキャン結果でアクセシビリティの問題が見つかったときにビルドを失敗させる方法の例を示しています。

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)
    }
}