ルールを無視する
Not for use with personal data
important
Axe DevTools MobileダッシュボードからAxe Developer Hubへの移行の一環として、ignoreRulesとignoreExperimentalが廃止されました。テストでこれらの設定パラメータを使用している場合は、これまでどおり機能します。各パラメータがセッションで初めて使用されるとき、Appiumサーバーログに非推奨警告が表示されます。
アクセシビリティテストを行う際に、指定したルールを無視することができます。すべてのルールが重要ではありますが、これらのカスタマイズにより、ビジネスニーズに合わせたテストを行うことができます。
ルールIDでルールを無視する
スキャン中に特定のルールを無視することができます。これを行うには、キーignoreRulesを設定オブジェクトに追加し、その値を無視したいルールのIDを含む配列に設定します。配列内の各文字列は有効なruleIdである必要があります。以下のJavaScript例では、ColorContrastとScreenTitleのルールが表示されています。任意のスキャンのJSON結果内のaxeConfオブジェクト内で、すべてのruleIdを見つけてください。
const axeSettings = {
apiKey: "<DEQUE_APIKEY>"
}
const scanSettings = {
ignoreRules: ["ColorContrast", "ScreenTitle"]
}
...
await driver.execute('mobile: axeStartSession', axeSettings)
// authentication settings are passed in once to `axeStartSession`
...
const result = await driver.execute(
'mobile: axeScan',
scanSettings
// deprecated features are not available on the session level and are still passed to `axeScan`
)実験的なルールを無視する
実験的なルール はまだテストと開発中のルールセットです。スキャン中にすべての実験的なルールを無視するためには、設定オブジェクトにキーignoreExperimentalを追加し、その値を 'true' に設定します。
const axeSettings = {
apiKey: "<DEQUE_APIKEY>",
}
const scanSettings = {
ignoreExperimental: true
}
...
await driver.execute('mobile: axeStartSession', axeSettings)
// authentication settings are passed in once to `axeStartSession`
...
const result = await driver.execute(
'mobile: axeScan',
scanSettings
// deprecated features are not available on the session level and are still passed to `axeScan`
)