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

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

アクセシビリティの問題をソフトウェア開発ライフサイクルの初期段階で発見して解決するために、CI/CDパイプラインにAxe DevTools Mobileを統合しましょう。スキャンを実行し結果を処理するを使ってアクセシビリティの問題を発見します。問題が見つかったときにはテストを失敗させ、ビルドも失敗させて、これらの問題がプロダクションコードにマージされないようにします。以下のコードスニペットは、スキャン結果でアクセシビリティの問題が見つかった場合にビルドを失敗させる方法の例を示しています。(この例では、JavaScriptとMochaテストフレームワークを使用しています。)

    it('your-scan', async () => {
        // run accessibility scan
        const result = await driver.execute('mobile: axeScan', axeSettings);

        // ensure no error occurred during the scan
        if (result.axeError) {
            assert.fail(`AxeScan failed with error: ${result.axeError}`);
        }

        const failCount = result.axeRuleResults.filter(rule => rule.status === 'FAIL').length;

        // assert that there are no accessibility violations
        assert.strictEqual(failCount, 0);
    });