Ignore Rules
Axe Account admins can choose which accessibility rules run for their organization's mobile scans, and decide whether team members can ignore additional rules in their automated tests. While we feel that all rules are important, these customizations will allow you to tailor your testing for your business needs.
Ignore Rules by Rule ID
You can ignore select rules while scanning. To do this, add the key ignoreRules to the configuration settings object and set its value to an array containing the IDs of the rules you want to ignore. Each string in the array should be a valid ruleId - in the JavaScript example below you can see the ColorContrast and ScreenTitle rules. Find all ruleIds inside of the axeConf object in the JSON result for any scan.
const axeSettings = {
apiKey: "<DEQUE_APIKEY>",
projectId: "<DEQUE_PROJECT_ID>",
ignoreRules: ["ColorContrast", "ScreenTitle"],
ignoreRulesOnElementIds: { loginButton: ['ColorContrast'] },
ignoreRulesOnElementClasses: { UILabel: ['ClippedText'] }, // iOS only
}
...
await driver.execute('mobile: axeStartSession', axeSettings)
// settings are passed in once to `axeStartSession`
...
const result = await driver.execute(
'mobile: axeScan',
{ scanName: '<YOUR_SCAN_NAME>' }
)If an admin has not enabled rule ignores in Axe Account, ignoreRules has no effect and you will still see results for those rules. Ignores by element ID (both platforms) and by class name (iOS) still apply.
Ignore Rules by Element ID
Ignore rules on specific elements with ignoreRulesOnElementIds. The value is an object containing key-value pairs with an element ID and an array of rule IDs to skip on that element. On Android, the ID is the view ID resource name. On iOS, it's the accessibility identifier.
Ignore Rules by Class Name (iOS Only)
Ignore rules on a type of element with ignoreRulesOnElementClasses. The value is an object containing key-value pairs with a class name and an array of rule IDs to skip on elements belonging to that class name. Class matching is exact - subclasses are not included.
