C# API reference
API reference for the Axe DevTools for Web C# classes and methods
Axe DevTools C# Classes
This page documents the classes which make up Axe DevTools C#
class Deque.AxeDevtools.Selenium.AxeSelenium
The interface to the accessibility analysis. Contains configurations that change how the analysis runs, as well as the ability to run it.
| static Field | Type | Description |
|---|---|---|
| defaultAxeSource | string | The default axe-core string that will be used. |
AxeSelenium(OpenQA.Selenium.Remote.RemoteWebDriver, ReportConfiguration?, string)
Create a new AxeSelenium object for a page with specific configuration.
| Param | Description |
|---|---|
| webdriver | Selenium object of the page to test. Should be in the state ready to test. |
| reportConfiguration | Configuration for various report-specific information. Defaults to ReportConfiguration.GetDefault() |
| axeSource | axe-core source to use. Defaults to AxeSelenium.defaultAxeSource |
ReportResultsAnalyze()
Run the accessibility analysis on the page.
Returns: The report from running axe-core on the page.
var report = new AxeSelenium(driver).Analyze();AxeSelenium Configure(Spec)
Configure axe. Done via axe.configure
| Param | Description |
|---|---|
| spec | Spec object to pass. |
Returns: This object for chaining.
var spec = new Spec.Spec {
Checks = new Spec.Check[] {
new Spec.Check() {
Id = "dylang",
Options = (object) new string[] { "dylan" },
Evaluate = @"function (node, options) {
var lang = (node.getAttribute('lang') || '').trim().toLowerCase();
var xmlLang = (node.getAttribute('xml:lang') || '').trim().toLowerCase();
var invalid = [];
(options || []).forEach(function(cc) {
cc = cc.toLowerCase();
if (lang && (lang === cc || lang.indexOf(cc.toLowerCase() + '-') === 0)) {
lang = null;
}
if (xmlLang && (xmlLang === cc || xmlLang.indexOf(cc.toLowerCase() + '-') === 0)) {
xmlLang = null;
}
});
if (xmlLang) {
invalid.push('xml:lang='' + xmlLang + ''');
}
if (lang) {
invalid.push('lang='' + lang + ''');
}
if (invalid.length) {
this.data(invalid);
return true;
}
return false;
}"
}
},
Rules = new Spec.Rule[] {
new Spec.Rule() {
Id = "dylang",
Selector = "html",
Tags = new string[] { "wcag2aa" },
All = new string[0],
Any = new string[0],
None = new string[] { "dylang" }
}
}
};
var report = new AxeSelenium(driver)
.Configure(spec)
.Analyze()AxeSeleniumDisablingRules(string[])
Disable some rules when running the analysis.
| Param | Description |
|---|---|
| rules | List of ids of rules. |
Returns: This object for chaining.
var report = new AxeSelenium(driver)
.DisablingRules("html-has-lang", "label")
.Analyze()AxeSeleniumExcluding(string)
Specify part of the page to exclude from the analysis. To exclude several unrelated parts of the page, call Excluding once for each one.
| Param | Description |
|---|---|
| selector | A single CSS selector for the elements to exclude. |
Returns: This object for chaining.
var report = new AxeSelenium(driver)
.Excluding(".cookie-banner")
.Excluding(".ad-slot")
.Analyze()AxeSeleniumExcluding(params string[])
Specify an element inside one or more nested iframes to exclude. Every selector but the last matches one level of iframe nesting; the last matches the element to exclude inside the innermost iframe.
Because the parameter is declared params, Excluding(".iframe1", ".third-party-ad") and Excluding(new[] { ".iframe1", ".third-party-ad" }) are the same call. Either way the selectors form one iframe selector, not separate exclusions. To exclude several unrelated parts of the page, call Excluding(string) once for each one.
| Param | Description |
|---|---|
| selector | A set of CSS selectors describing a path through nested iframes to the element to exclude. |
Returns: This object for chaining.
// Exclude .third-party-ad inside the iframe matched by .iframe1
var report = new AxeSelenium(driver)
.Excluding(".iframe1", ".third-party-ad")
.Analyze()Excluding(FromFrames) expresses the same thing more explicitly and is the recommended form for new tests.
AxeSeleniumExcluding(string[][])
Specify an element inside one or more nested shadow DOM trees to exclude. Pass one inner array per call. Within that array, every selector but the last matches a shadow host, and the last matches the element to exclude inside the innermost shadow root.
| Param | Description |
|---|---|
| selector | An array containing a single array of CSS selectors describing a path through nested shadow roots. |
Returns: This object for chaining.
// Exclude #shadow-button inside the shadow root attached to #shadow-host
var selector = new string[][] {
new string[] { "#shadow-host", "#shadow-button" }
};
var report = new AxeSelenium(driver)
.Excluding(selector)
.Analyze()Excluding(FromShadowDom) expresses the same thing without the wrapping array and is the recommended form for new tests.
AxeSelenium Excluding(FromFrames)
Specify an element inside one or more nested iframes to exclude, using an explicit FromFrames selector.
| Param | Description |
|---|---|
| fromFrames | A FromFrames selector. Every selector but the last matches one level of iframe nesting; the last matches the element to exclude inside the innermost iframe. |
Returns: This object for chaining.
// Exclude the form inside the #payment-frame iframe
var report = new AxeSelenium(driver)
.Excluding(new FromFrames("#payment-frame", "form"))
.Analyze()AxeSelenium Excluding(FromShadowDom)
Specify an element inside one or more nested shadow DOM trees to exclude, using an explicit FromShadowDom selector.
Because axe-core matches elements against the flattened DOM tree, selecting a shadow DOM node also selects any descendants inserted through a <slot> element.
| Param | Description |
|---|---|
| fromShadowDom | A FromShadowDom selector. Every selector but the last matches a shadow host; the last matches the element to exclude inside the innermost shadow root. |
Returns: This object for chaining.
// Exclude the #search form inside the shadow root attached to .app-header
var report = new AxeSelenium(driver)
.Excluding(new FromShadowDom(".app-header", "form#search"))
.Analyze()AxeSeleniumExcluding(params object[])
Specify a selector that mixes plain CSS selectors with FromFrames or FromShadowDom objects, for cases the other overloads cannot express.
This overload is selected only when the call passes more than one argument, or a single argument that is not one of the types above. Passing a single FromFrames or FromShadowDom selects Excluding(FromFrames) or Excluding(FromShadowDom) instead.
To reach an iframe that lives inside a shadow root, the FromShadowDom selector must be nested inside the FromFrames selector; the reverse causes an error.
| Param | Description |
|---|---|
| selectors | A mixed set of CSS selectors and selector objects forming a single path to the element to exclude. |
Returns: This object for chaining.
// Exclude .target inside the shadow root attached to #host, inside the #frame iframe
var report = new AxeSelenium(driver)
.Excluding("#frame", new FromShadowDom("#host", ".target"))
.Analyze()AxeSeleniumIncluding(string)
Specify part of the page to analyze. To analyze several unrelated parts of the page, call Including once for each one.
| Param | Description |
|---|---|
| selector | A single CSS selector for the elements to test. |
Returns: This object for chaining.
var report = new AxeSelenium(driver)
.Including(".sidebar")
.Including(".some-class")
.Analyze()AxeSeleniumIncluding(params string[])
Specify an element inside one or more nested iframes to test. Every selector but the last matches one level of iframe nesting; the last matches the element to test inside the innermost iframe.
Because the parameter is declared params, Including(".sidebar-frame", ".some-class") and Including(new[] { ".sidebar-frame", ".some-class" }) are the same call. Either way the selectors form one iframe selector, not separate includes. To test several unrelated parts of the page, call Including(string) once for each one.
| Param | Description |
|---|---|
| selector | A set of CSS selectors describing a path through nested iframes to the element to test. |
Returns: This object for chaining.
// Test .some-class inside the iframe matched by .sidebar-frame
var report = new AxeSelenium(driver)
.Including(".sidebar-frame", ".some-class")
.Analyze()Including(FromFrames) expresses the same thing more explicitly and is the recommended form for new tests.
AxeSeleniumIncluding(string[][])
Specify an element inside one or more nested shadow DOM trees to test. Pass one inner array per call. Within that array, every selector but the last matches a shadow host, and the last matches the element to test inside the innermost shadow root.
| Param | Description |
|---|---|
| selector | An array containing a single array of CSS selectors describing a path through nested shadow roots. |
Returns: This object for chaining.
// Test #shadow-button inside the shadow root attached to #shadow-host
var selector = new string[][] {
new string[] { "#shadow-host", "#shadow-button" }
};
var report = new AxeSelenium(driver)
.Including(selector)
.Analyze()Including(FromShadowDom) expresses the same thing without the wrapping array and is the recommended form for new tests.
AxeSelenium Including(FromFrames)
Specify an element inside one or more nested iframes to test, using an explicit FromFrames selector.
| Param | Description |
|---|---|
| fromFrames | A FromFrames selector. Every selector but the last matches one level of iframe nesting; the last matches the element to test inside the innermost iframe. |
Returns: This object for chaining.
// Test the form inside the #payment-frame iframe
var report = new AxeSelenium(driver)
.Including(new FromFrames("#payment-frame", "form"))
.Analyze()AxeSelenium Including(FromShadowDom)
Specify an element inside one or more nested shadow DOM trees to test, using an explicit FromShadowDom selector.
Because axe-core matches elements against the flattened DOM tree, selecting a shadow DOM node also selects any descendants inserted through a <slot> element.
| Param | Description |
|---|---|
| fromShadowDom | A FromShadowDom selector. Every selector but the last matches a shadow host; the last matches the element to test inside the innermost shadow root. |
Returns: This object for chaining.
// Test the #search form inside the shadow root attached to .app-header
var report = new AxeSelenium(driver)
.Including(new FromShadowDom(".app-header", "form#search"))
.Analyze()AxeSeleniumIncluding(params object[])
Specify a selector that mixes plain CSS selectors with FromFrames or FromShadowDom objects, for cases the other overloads cannot express.
This overload is selected only when the call passes more than one argument, or a single argument that is not one of the types above. Passing a single FromFrames or FromShadowDom selects Including(FromFrames) or Including(FromShadowDom) instead.
To reach an iframe that lives inside a shadow root, the FromShadowDom selector must be nested inside the FromFrames selector; the reverse causes an error.
| Param | Description |
|---|---|
| selectors | A mixed set of CSS selectors and selector objects forming a single path to the element to test. |
Returns: This object for chaining.
// Test .target inside the shadow root attached to #host, inside the #frame iframe
var report = new AxeSelenium(driver)
.Including("#frame", new FromShadowDom("#host", ".target"))
.Analyze()AxeSelenium RunOptions(RunOptions)
Specify RunOptions to pass through when calling axe.run.
| Param | Description |
|---|---|
| options | Object to pass |
Returns: This object for chaining.
var options = new RunOptions.RunOptions {
IFrames = false,
RunOnly = RunOptions.RunOnly.Tags(RunOptions.TagType.Wcag2a)
};
var report = new AxeSelenium(driver)
.RunOptions(options)
.Analyze()AxeSeleniumWithConfigFile(string)
Set where to find a config file. Default path is config/axe-ruleset.json or $AXE_RULESET_PATH.
| Param | Description |
|---|---|
| path | Path to config file. |
Returns: This object for chaining.
var report = new AxeSelenium(driver)
.WithConfigFile("path/to/file.json")
.Analyze();AxeSeleniumWithRules(string[])
Specify rules (by id) to use when running the analysis.
| Param | Description |
|---|---|
| rules | List of ids of rules. |
Returns: This object for chaining.
var report = new AxeSelenium(driver)
.WithRules("document-title", "label")
.WithRules("html-has-lang")
.Analyze()AxeSeleniumWithRuleset(string, bool)
Use a specific ruleset (i.e. wcag2.1, 508).
| Param | Description |
|---|---|
| rulesetId | Id of the ruleset to use. |
| enableBestPractices | Whether or not to turn on rules tagged best-practice. Defaults to false |
Returns: This object for chaining.
var report = new AxeSelenium(driver)
.WithRuleset("508", true)
.Analyze()AxeSelenium WithTags(TagType[])
Specify rules (by tag) to use when running the analysis.
| Param | Description |
|---|---|
| tags | List of tags of rules. |
Returns: This object for chaining.
var report = new AxeSelenium(driver)
.WithTags(RunTagType.BestPractice)
.Analyze()Environment variables
These environment variables allow you to configure the usage service and change the properties of reported events.
| Name | Type | Can Override | Description |
|---|---|---|---|
AXE_DISTINCT_ID |
String | — | A UUID identifier that remains the same for the logged-in user (unless it is regenerated). In Ruby, this variable is named DEQUE_DISTINCT_ID. |
AXE_INCLUDE_TEST_RESULTS |
Boolean | — | Set to true to include the full axe-core results in the testResults object of each event (default is false). Supported by the CLI and the Node.js APIs only. |
AXE_METRICS_URL |
String | — | The URL of the REST usage endpoint (default is https://usage.deque.com) |
AXE_TRACK_USAGE |
Boolean | — | Set to false to disable usage service reporting. Reporting is enabled by default. |
AXE_APPLICATION |
String | false | The application that was used to check for accessibility errors |
AXE_DEV_INSTANCE |
Boolean | true | Indicates whether this event is from a software developer's actions. Useful for marking and later removing events logged during development or testing. |
AXE_DEPARTMENT |
String | true | The user's department within the organization |
AXE_KEYCLOAK_ID |
String | false | The user's Keycloak ID |
AXE_LOGGED_IN |
Boolean | false | Records whether the user is logged in to the application under test |
AXE_ORGANIZATION |
String | true | The user's organization. To have your usage appear in Axe Reports, set this to your organization's ID (contact Deque to obtain it). |
AXE_SESSION_ID |
String | false | A UUID identifying the user's session |
AXE_USER_ID |
String | false | A specific user's identity such as an email address, name, or login ID. Axe Reports counts unique users from this value. |
AXE_USER_JOB_ROLE |
String | false | The user's job role |
AXE_USER_STATUS |
String | false | Status information you want to associate with the user |
AxeSeleniumEnableTracking(bool)
Opt in to or out of sending data to the usage service. Sending is enabled by default.
| Param | Description |
|---|---|
| state | Whether tracking is enabled |
Returns: This object for chaining.
AxeSeleniumSetTrackingUrl(string)
Set where usage metrics data are sent. Defaults to https://usage.deque.com
| Param | Description |
|---|---|
| url | URL where it will be sent |
Returns: This object for chaining.
AxeSeleniumSetDistinctId(string)
Set distinct id used when sending usage metrics.
| Param | Description |
|---|---|
| id | UUID to send as distinct id |
Returns: This object for chaining.
class Deque.AxeDevtools.Selenium.ReportConfiguration
Configures report-specific information like test suite name or user agent information
| static Field | Type | Description |
|---|---|---|
| TIMESTAMP_FORMAT | string | Format of timestamps in reports. |
static ReportConfigurationGetDefault()
Gets the current default configuration. Note that the default can be changed.
Returns: The current default.
static void ResetDefault()
Resets the default to its initial state.
void SetAsDefault()
Sets this object as the default.
ReportConfiguration.GetDefault()
.TestSuiteName("my-tests")
.UIState("home-page")
.SetAsDefault();ReportConfigurationTestMachine(string)
Sets the machine these tests were run on.
| Param | Description |
|---|---|
| testMachine | Id for the machine. |
Returns: This object for chaining.
ReportConfigurationTestSuiteName(string)
Sets the test suite name.
| Param | Description |
|---|---|
| name | Name. |
Returns: This object for chaining.
ReportConfigurationUIState(string)
Specify the ui-state for this set of tests. Used as ID.
| Param | Description |
|---|---|
| id | State id. |
Returns: This object for chaining.
ReportConfigurationUserAgent(string)
Set the user agent used when testing.
| Param | Description |
|---|---|
| userAgent | User agent string. |
Returns: This object for chaining.
class Deque.AxeDevtools.Selenium.Results.Check
The result of running a check.
| Field | Type | Description |
|---|---|---|
| Data | object | Additional information that is specific to the type of Check which is optional. For example, a color contrast check would include the foreground color, background color, contrast ratio, etc. |
| Id | string | Unique identifier for this check. Check ids may be the same as Rule ids. |
| Impact | string | How serious this particular check is. Can be one of "minor", "moderate", "serious", or "critical". Each check that is part of a rule can have different impacts. The highest impact of all the checks that fail is reported for the rule. |
| Message | string | Description of why this check passed or failed. |
| RelatedNodes | List<Node> | Optional array of information about other nodes that are related to this check. For example, a duplicate id check violation would list the other selectors that had this same duplicate id. |
class Deque.AxeDevtools.Selenium.Results.CheckedNode
An HTML node that was checked by a rule.
| Field | Type | Description |
|---|---|---|
| All | List<Check> | Array of checks that were made where all must have passed. |
| Any | List<Check> | Array of checks that were made where at least one must have passed. |
| Impact | string | How serious the violation is. Can be one of "minor", "moderate", "serious", or "critical" if the test failed or null if the check passed. |
| None | List<Check> | Array of checks that were made where all must have not passed. |
class Deque.AxeDevtools.Results.FromFrames
A selector that targets an element inside one or more nested iframes. Pass it to Including(FromFrames) or Excluding(FromFrames).
FromFrames(params object[])
| Param | Description |
|---|---|
| fromFramesList | One selector per level of iframe nesting, followed by a selector for the element inside the innermost iframe. Each entry is a CSS selector string, or a FromShadowDom selector when the iframe itself lives inside a shadow root. |
| Field | Type | Description |
|---|---|---|
| FromFramesObjectList | object[] | The selectors making up the path through the nested iframes. |
var report = new AxeSelenium(driver)
.Including(new FromFrames("iframe#outer", "iframe#inner", "form"))
.Analyze()class Deque.AxeDevtools.Results.FromShadowDom
A selector that targets an element inside one or more nested shadow DOM trees. Pass it to Including(FromShadowDom) or Excluding(FromShadowDom).
FromShadowDom(params string[])
| Param | Description |
|---|---|
| fromShadowDomList | One selector per level of shadow DOM nesting, followed by a selector for the element inside the innermost shadow root. |
| Field | Type | Description |
|---|---|---|
| FromShadowDomList | string[] | The selectors making up the path through the nested shadow roots. |
var report = new AxeSelenium(driver)
.Including(new FromShadowDom("app-root", ".header", "#search"))
.Analyze()class Deque.AxeDevtools.Selenium.Results.Node
Specifies a specific HTML node.
| Field | Type | Description |
|---|---|---|
| Html | string | Snippet of HTML of the Element. |
| Target | object | Array of either strings or Arrays of strings. If the item in the array is a string, then it is a CSS selector. If there are multiple items in the array each item corresponds to one level of iframe or frame. If there is one iframe or frame, there should be two entries in target. If there are three iframe levels, there should be four entries in target. If the item in the Array is an Array of strings, then it points to an element in a shadow DOM and each item (except the n-1th) in this array is a selector to a DOM element with a shadow DOM. The last element in the array points to the final shadow DOM node. |
class Deque.AxeDevtools.Selenium.Results.Platform
The platform a test was run on.
| Field | Type | Description |
|---|---|---|
| TestMachine | string | Id of the machine the test was run on. |
| UserAgent | string | User agent the test was run on. |
class Deque.AxeDevtools.Selenium.Results.ReportResults
Results from a test that are compatible with the reporter format.
var axe = new AxeSelenium(driver, ReportConfiguration.GetDefault().UIState("UIState"));
var res = axe.Analyze();
File.WriteAllText(reportPath, JsonConvert.SerializeObject(res));| Field | Type | Description |
|---|---|---|
| EndTime | string | When the test was complete. |
| Findings | TestResults | Axe results. |
| Id | string | Id for the test run. |
| Name | string | Name of the test run. |
| Platform | Platform | Information on the platform on which the test was run. |
| TestSubject | TestSubject | Information on where the test was run (e.g. the URL of the webpage). |
| Type | string | Type of report. Is always "attest-result". |
class Deque.AxeDevtools.Selenium.Results.Rule
Result for a single rule.
| Field | Type | Description |
|---|---|---|
| CreatedDate | string | The date and time that analysis was completed. |
| Description | string | Text string that describes what the rule does. |
| Help | string | Help text that describes the test that was performed. |
| HelpUrl | string | URL that provides more information about the specifics of the violation. Links to a page on the Deque University site. |
| Id | string | Unique identifier for the rule. |
| Impact | string | How serious the violation is. Can be one of "minor", "moderate", "serious", or "critical" if the Rule failed or null if the check passed. |
| Nodes | List<CheckedNode> | Array of all elements the Rule tested. |
| Tags | List<string> | Array of tags that this rule is assigned. These tags can be used in the option structure to select which rules are run. |
| Url | string | The URL of the page that was tested. |
class Deque.AxeDevtools.Selenium.Results.TestEngine
Information on the axe-core engine the test was run on.
| Field | Type | Description |
|---|---|---|
| Name | string | Name of the engine. |
| Version | string | Version number for the engine. |
class Deque.AxeDevtools.Selenium.Results.TestEnvironment
Information about the environment in which the test was performed.
| Field | Type | Description |
|---|---|---|
| OrientationAngle | double? | Angle of orientation of the screen. (e.g. 0) |
| OrientationType | string | Type of orientation of the screen. (e.g. "landscape-primary") |
| UserAgent | string | User agent of the browser in which the test was run. |
| WindowHeight | int | Height of the window. |
| WindowWidth | int | Width of the window. |
class Deque.AxeDevtools.Selenium.Results.TestResults
Results returned by running the analysis on the page.
| Field | Type | Description |
|---|---|---|
| Inapplicable | List<Rule> | These results were aborted and require further testing. This can happen either because of technical restrictions to what the rule can test, or because a JavaScript error occurred. |
| Incomplete | List<Rule> | These results indicate which rules did not run because no matching content was found on the page. For example, with no video, those rules won't run. |
| Passes | List<Rule> | These results indicate what elements passed the rules. |
| TestEngine | TestEngine | Information about the axe-core engine used in the test. |
| TestEnvironment | TestEnvironment | Information about the environment in which the test was performed. |
| TestRunner | TestRunner | Name of the test runner. |
| Timestamp | string | The date and time that analysis was completed. |
| ToolOptions | object | Options applied when testing. |
| Url | string | The URL of the page that was tested. |
| Violations | List<Rule> | These results indicate what elements failed the rules. |
class Deque.AxeDevtools.Selenium.Results.TestRunner
Name of the test runner.
| Field | Type | Description |
|---|---|---|
| Name | string | The name. |
class Deque.AxeDevtools.Selenium.Results.TestSubject
Information about what is being tested.
| Field | Type | Description |
|---|---|---|
| FileName | string | Filename of the site-under-test. (Can be a URL.) |
| LineNum | int | Line number of the test. |
| State | string | State of the file. |
class Deque.AxeDevtools.Selenium.RunOptions.Context
Specify which element should and which should not be tested.
void Excluding(string[])
Add a selector set for elements which should not be tested.
| Param | Description |
|---|---|
| exclude | CSS selector set. |
void Including(string[])
Add a selector set for elements which should be tested.
| Param | Description |
|---|---|
| include | CSS selector set. |
enum Deque.AxeDevtools.Selenium.RunOptions.ResultGroup
- Passes
- Violations
- Incomplete
- Inapplicable
class Deque.AxeDevtools.Selenium.RunOptions.RuleStatus
Enables or disables a rule.
| Field | Type | Description |
|---|---|---|
| Enabled | bool | Whether or not it is enabled. |
class Deque.AxeDevtools.Selenium.RunOptions.RunOnly
Limit which rules are executed, based on names or tags.
static RunOnlyRules(string[])
Construct a limiter for rules based on ids.
| Param | Description |
|---|---|
| rules | List of ids of rules to use. |
Returns: The RunOnly object.
static RunOnly Tags(TagType[])
Construct a limiter for rules based on tags.
| Param | Description |
|---|---|
| types | List of tags to use. |
Returns: The RunOnly object.
enum Deque.AxeDevtools.Selenium.RunOptions.RunOnlyType
- Rule
- Rules
- Tag
- Tags
class Deque.AxeDevtools.Selenium.RunOptions.RunOptions
A flexible configuration for how the analysis operates.
| Field | Type | Description |
|---|---|---|
| ElementRef | bool? | Return element references in addition to the target. |
| IFrames | bool? | Whether to run inside iframes. |
| ResultTypes | ResultGroup[] | Limit which result types are processed and aggregated |
| Rules | Dictionary<string, RuleStatus> | Allow customizing a rule's properties (including { enable: false }). |
| RunOnly | RunOnly | Limit which rules are executed, based on names or tags. |
| Selectors | bool? | Return xpath selectors for elements. |
enum Deque.AxeDevtools.Selenium.RunOptions.TagType
- Wcag2a
- Wcag2aa
- Wcag2aaa
- Wcag21a
- Wcag21aa
- Wcag21aaa
- Wcag22a
- Wcag22aa
- Wcag22aaa
- Section508
- TTv5
- EN301549
- RGAAv4
- BestPractice
class Deque.AxeDevtools.Selenium.Spec.Check
Used to add checks to the list of checks used by rules, or to override the properties of existing checks.
| Field | Type | Description |
|---|---|---|
| After | string | This is the function that gets called for checks that operate on a page-level basis, to process the results from the iframes. |
| Enabled | bool? | This is used to indicate whether the check is on or off by default. Checks that are off are not evaluated, even when included in a rule. Overriding this is a common way to disable a particular check across multiple rules. |
| Evaluate | string | This is the function that implements the check's functionality. |
| Id | string | This uniquely identifies the check. If the check already exists, this will result in any supplied check properties being overridden. |
| Matches | string | A filtering CSS selector that will exclude elements that do not match the CSS selector. |
| Options | object | This is the options structure that is passed to the evaluate function and is intended to be used to configure checks. It is the most common property that is intended to be overridden for existing checks. |
class Deque.AxeDevtools.Selenium.Spec.Rule
Used to add rules to the existing set of rules, or to override the properties of existing rules.
| Field | Type | Description |
|---|---|---|
| All | string[] | This is a list of checks that, if any "fails", will generate a violation. |
| Any | string[] | This is a list of checks that, if none "pass", will generate a violation. |
| Enabled | bool? | Whether the rule is turned on. This is a common attribute for overriding. |
| ExcludeHidden | bool? | This indicates whether elements that are hidden from all users are to be passed into the rule for evaluation. |
| Id | string | This uniquely identifies the rule. If the rule already exists, it will be overridden with any of the attributes supplied. |
| Matches | string | A filtering CSS selector that will exclude elements that do not match the CSS selector. |
| None | string[] | This is a list of checks that, if any "pass", will generate a violation. |
| PageLevel | bool? | When set to true, this rule is only applied when the entire page is tested. Results from nodes on different frames are combined into a single result. |
| Selector | string | A CSS selector used to identify the elements that are passed into the rule for evaluation. |
| Tags | string[] | A list if the tags that "classify" the rule. In practice, you must supply some valid tags or the default evaluation will not invoke the rule. The convention is to include the standard (WCAG 2, section 508, Trusted Tester v5, or EN 301 549), the WCAG 2 level, Section 508 paragraph, and the WCAG 2 success criteria. Tags are constructed by converting all letters to lower case, removing spaces and periods and concatenating the result. E.g. WCAG 2 A success criteria 1.1.1 would become ["wcag2a", "wcag111"] |
class Deque.AxeDevtools.Selenium.Spec.Spec
Configures the format of the rule data. This can be used to add new rules, which must be registered with the library to execute.
| Field | Type | Description |
|---|---|---|
| Branding | Branding | Used to set the branding of the helpUrls . |
| Checks | Check[] | Used to add checks to the list of checks used by rules, or to override the properties of existing checks. |
| Locale | Locale | A locale object to apply (at runtime) to all rules and checks. |
| ReporterVersion | ReporterVersion? | Used to set the output format that the axe.run function will return. |
| Rules | Rule[] | Used to add rules to the existing set of rules, or to override the properties of existing rules. |
