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

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パイプラインに統合することで、ソフトウェア開発ライフサイクルの早い段階でアクセシビリティの問題を明らかにし、解決することができます。アクセシビリティの問題を見つけるには、 スキャンを実行し結果を処理することで行います。問題が見つかった場合にはテストを失敗させ、これらの問題が本番コードにマージされるのを防ぐためにビルドを失敗させます。以下のコードスニペットは、スキャン結果でアクセシビリティの問題が見つかった際にビルドが失敗する例を示しています。(この例では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);
    });