Evaluation Library API: Result Objects
From MemberWiki
Accessibility Home | Downloads | Evaluation Library Objects and APIs | Rule Format | Issue Tracker
Evaluation Library API: Evaluation Objects | Result Objects | Information and Summary Objects
Contents |
Overview
The Result objects are those objects produced by performing an evaluation of a web page; they do not exist until after the evaluation. They include:
EvaluationResult object
EvaluationResult JSDoc documentation
An object that contains:
- An array of RuleResult objects
- Methods for retrieving RuleResult objects filtered by rule groups such as Rule Category and WCAG Guideline
- Information about the all the rule results, including summary information
EvaluationResult methods
| Method | Returns | Arguments | Description |
|---|---|---|---|
| getDate | String | none | Returns a string representing the date and time of the evaluation |
| getEvaluationTitle | String | none | Returns a string representing the title defined when the evaluation (e.g. of Ruleset Object) method was called |
| getEvaluationURL | String | none | Returns a string representing the URL defined when the evaluation (e.g. of Ruleset Object) method was called |
| getRuleResultsAll | RuleGroupResult | none | Returns a RuleGroupResult object with all rule results |
| getRuleResultsByCategory | RuleGroupResult | rule_category_id (Number, required parameter):
| RuleGroupResult object containing information about the rule results associated with the specified rule category |
| getRuleResultsByGuideline | RuleGroupResult | wcag_guideline_id (Number):
| RuleGroupResult object containing information about the rule results associated with the specified WCAG guideline |
| getRuleResult | RuleResult | rule_id (String) | Returns the RuleResult object for a specific rule id (e.g used in rule testsuites) |
| getRuleset | Ruleset | none | Returns the Ruleset Object used to create this EvaluationResult |
| toJSON | String | include_element_results (Boolean):
| Returns a JSON formatted string of the rule and element results |
RuleGroupResult object
RuleGroupResult JSDoc documentation
An object that contains:
- an array of RuleResult objects
- information about the group of rule results, including summary information
RuleGroupResult methods
| Method | Returns | Arguments | Description |
|---|---|---|---|
| getRuleResultsArray | Array of RuleResult | none | Returns a list of RuleResult objects associated with the rule grouping |
| getRuleResultsSummary | RuleResultsSummary | none | Returns a RuleResultsSummary object that contains counts of violations, warnings, manual checks, passed and not applicable rule results |
| hasRuleResults | Boolean | none | Returns a boolean:
|
| getEvaluationResult | EvaluationResult | none | Returns the EvaluationResult Object used to create this RuleGroupResult Object |
| getImplementationScore | Number | none | Returns a number between 0-100 indicating the level of implementation of rule requirements |
| getImplementationValue | Number | none | Returns a constant that can is used to represent the level of implementation based on the implementation score and wether there are manual check results:
|
| getImplementationValueNLS | String | none | Returns a NLS string that can is used to represent the level of implementation based on the implementation score and wether there are manual check results:
|
| getRuleGroupInfo | RuleGroupInfo | none | Returns a RuleGroupInfo object with information about the group of rules |
| hasRules | Boolean | none | Returns true if there is at least one rule in the group |
RuleResult object
RuleResult JSDoc documentation
An object that contains:
- A rule result value
- A rule result message
- Information about the associated rule
- An array of element results
- Summary information on element results
RuleResult methods
| Method | Returns | Arguments | Description |
|---|---|---|---|
| getResultValue | Number | none | Returns a constant that represents the rule result:
|
| getResultValueNLS | String | none | Returns a string that represents the rule result:
|
| getResultMessage | String | none | Returns a string with rule result message |
| getResultMessagesArray | String | none | Returns an array of strings with rule result messages |
| getImplementationScore | Number | none | Returns a number between 0-100 indicating the level of implementation of element results that passed, violations and warnings (e.g. 0 means no elements passed and 100 means all element results passed) |
| getImplementationValue | Number | none | Returns a constant that can is used to represent the level of implementation based on the implementation score and wether there are manual check results:
|
| getImplementationValueNLS | String | none | Returns a string that can is used to represent the level of implementation based on the implementation score and wether there are manual check results:
|
RuleResult methods related to ElementResult objects
| Method | Returns | Arguments | Description |
|---|---|---|---|
| getElementResultsSummary | ElementResultsSummary | none | Returns an ElementsResultsSummary object that contains count information on element results |
| getElementResultsArray | Array of ElementResult | none | Returns a list of ElementResult objects identifying the documents target resources applying to the rule and the results of the evaluation |
| hasElementResults | Boolean | none | Returns:
|
| hasHiddenElements | Boolean | none | Returns:
|
| getPrimaryLabel | String | none | Returns the label for the primary ElementInfo object.
This can be used to set a column header for primary element information NOTE: An empty string means no primary property was defined for the rule and therefore no label, this is often the case for rules with scope of Page or Website |
RuleResult methods related to Rule object
| Method | Returns | Arguments | Description |
|---|---|---|---|
| getRule | Rule | none | Returns a reference to the Rule object |
| getRuleDefinition | String | none | Returns a string with rule definition based if the rule was required or recommended in the ruleset
(NOTE: adds in isRuleRequired to the getRuleDefinition method of the Rule Object) |
| getRuleSummary | String | none | Returns a string with rule summary based if the rule was required or recommended in the ruleset
(NOTE: adds in isRuleRequired to the getRuleSummary method of the Rule Object) |
| getRuleScope | Number | none | Returns:
A constant representing the rule scope:
|
| getRuleScopeNLS | String | none | Returns:
A constant representing the rule scope:
|
| getWCAG20Level | Number | none | Returns:
Returns a constant representing the WCAG 2.0 level
|
| getWCAG20LevelNLS | String | none | Returns:
Returns a constant representing the WCAG 2.0 level
|
| isRuleRequired | Boolean | none | Returns:
|
| isRuleRequiredNLS | String | none | Returns:
|
ElementResult object
ElementResult JSDoc documentation
An object that contains:
- An element result value
- An element result message
- Tag name and/or attribute information used to identify the element
- A reference to the live DOM node in the web page
- The ordinal position of the element in the DOM
- Important information about the element used by the rule evaluation method
- The primary element information needed for understanding the accessibility of the element for this rule
- An array of RelatedElementsInfo objects (each with information such as headers for a table cell, elements referenced by ARIA-LABELLEDBY, ...)
ElementResult methods
| Method | Returns | Arguments | Description |
|---|---|---|---|
| getResultValue | Number | none | Returns a constant that represents the element result:
|
| getResultMessage | String | none | Returns a string describing the element result |
| getElementIdentifier | String | none | Returns a string with two types of information:
|
| getElementInfoPrimary | ElementInfo | none | Returns an ElementInfo Object that has information on the most important element attribute (e.g. role value) or property (e.g. accessible name and/or description)
NOTE: If no primary property is defined the ElementInfo properties will be empty strings
|
| getElementInfoSecondaryArray | Array of ElementInfo | none | Returns a array of ElementInfo Objects that have information attributes (e.g. role value) or properties (e.g. accessible name and/or description) important evaluating the rule, the array can be empty
NOTE(1): excludes ElementInfo Object identified in getElementInfoPrimary method NOTE(2): If no secondary properties are defined the array will be empty |
| getOrdinalPosition | Number | none | Returns a number related to the document position of the element related to the other element results (e.g. can be used to sort list by document order of the elements) |
| getDOMElement | DOMElement | none | Returns the DOM element object that include the DOM node reference. tag name and computed style information (e.g. can be used for highlighting the element or as a reference to browser based DOM for inspection tools) |
| getRelatedElementsArray | Array of RelatedElements | none | Returns an Array of RelatedElements objects that are used to identify other important elements related to this element results and the relationship, examples include:
|
ElementResult methods related to RuleResult object
| Method | Returns | Arguments | Description |
|---|---|---|---|
| getRuleResult | RuleResult | none | Reference to the rule result object the element result is part of |
ElementResult methods related to Rule object
| Method | Returns | Arguments | Description |
|---|---|---|---|
| getRule | Rule | none | Reference to the rule object the element results is associated with |
DOMElement object
The DOMElement is a rich object with many properties. Here we document only a selected few of these:
DOMElement properties (selected)
| Property | Type | Description |
|---|---|---|
| node | Object | Reference to the live DOM node |
| tag_name | String | HTML tag name of the element |
| computed_style | Object | Reference to an object with computed style properties, including is_visible_onscreen |
RelatedElements object
RelatedElementsInfo JSDoc documentation
An object that contains:
- The name of the relationship
- An array of RelatedElementInfo objects
RelatedElements methods
| Methods | Type | Description |
|---|---|---|
| getRelatedElements | Array of RelatedElementInfo | Returns an array of RelatedElementInfo objects containing the elements with the relationship |
| getTitle | String | Returns a title that describes the relationship (e.g. labeling elements, data table headers,..) |
