Ignore Rules

Link to Ignore Rules copied to clipboard
Not for use with personal data

You can choose to ignore specified rules while testing for accessibility. We support ignoring a specific rule, ignoring rules by class name, and ignoring rules by accessibility identifier. While we feel that all rules are important, these customizations will let you ignore views that have yet to be fixed and focus on identifying new issues.

important

In the below examples, axe refers to the AxeDevTools object initialized when logging in.

APIs Available

To ignore a specific rule or set of rules, update the configuration before testing takes place.

Ignore Rule(s)

The below code shows how to ignore a specific rule, ConflictingTraits.

Rules ignored with this API will not run and therefore will not be available within the dashboard.

axe?.configuration.ignore(rule: AxeRuleId.ConflictingTraits.toString())

To ignore multiple rules, create an array of the rules separated by commas:

axe?.configuration.ignore(rules: [AxeRuleId.ConflictingTraits.toString(), AxeRuleId.InScrollView.toString()])

Ignore Rules by Class Name

Rules ignored with this API will run and be reported in the dashboard under the IGNORED status.

axe?.configuration.ignore(rulesFor: ["UILabel": [AxeRuleId.InScrollView.toString()]])

Ignore Rules by Accessibility Identifier

Rules ignored with this API will run and be reported in the dashboard under the IGNORED status.

axe?.configuration.ignore(rulesFor: ["LoginScreen.Button": [AxeRuleId.CollidingViews.toString()]])

Note: The rulesFor parameter supports class names and accessibility identifiers.

Ignore Experimental Rules

Experimental rules are rulesets that are still in testing and development. Results for the experimental rules can be IGNORED with the ignoreExperimental method, and this way they will not run.

axe?.configuration.ignoreExperimental()

note
The Supports Dynamic Type rule is opt-in only and is not affected by the ignoreExperimental method.

Ignore Rules with Automated Testing

To ignore rules while running unit or UI tests, update the configuration before your tests run. We recommend utilizing the setUp and tearDown methods.