-
-
Notifications
You must be signed in to change notification settings - Fork 112
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test a11y with karma-accessibility-checker
- Loading branch information
Showing
8 changed files
with
144 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
# optional - Specify the rule archive | ||
# i.e. For march rule archive use ruleArchive: 2017MayDeploy | ||
# Default: latest | ||
# Refer to README.md FAQ section below to get the rule archive ID. | ||
ruleArchive: latest | ||
|
||
# optional - Specify one or many policies to scan. | ||
# i.e. For one policy use policies: IBM_Accessibility_2017_02 | ||
# i.e. Multiple policies: IBM_Accessibility_2017_02,IBM_Accessibility_BETA or refer to below as a list | ||
# Default: null (all policies) | ||
# Refer to README.md FAQ section below to get the policy ID. | ||
policies: | ||
- IBM_Accessibility | ||
|
||
# optional - Specify one or many violation levels on which to fail the test | ||
# i.e. If specified violation then the testcase will only fail if | ||
# a violation is found during the scan. | ||
# i.e. failLevels: violation | ||
# i.e. failLevels: violation,potential violation or refer to below as a list | ||
# Default: violation, potentialviolation | ||
failLevels: | ||
- violation | ||
|
||
# optional - Specify one or many violation levels which should be reported | ||
# i.e. If specified violation then in the report it would only contain | ||
# results which are level of violation. | ||
# i.e. reportLevels: violation | ||
# i.e. reportLevels: violation,potentialviolation or refer to below as a list | ||
# Default: violation, potentialviolation, recommendation, potentialrecommendation, manual | ||
reportLevels: | ||
- violation | ||
- potentialviolation | ||
- recommendation | ||
- potentialrecommendation | ||
- manual | ||
|
||
# Optional - In what format types the results should be output in (json, html) | ||
# Default: json | ||
outputFormat: | ||
- json | ||
|
||
# Optional - Specify labels that you would like associated to your scan | ||
# | ||
# i.e. | ||
# label: Firefox,master,V12,Linux | ||
# label: | ||
# - Firefox | ||
# - master | ||
# - V12 | ||
# - Linux | ||
# Default: N/A | ||
label: | ||
- master | ||
|
||
# optional - Where the scan results should be saved. | ||
# Default: results | ||
outputFolder: x-a11y |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
|
||
|
||
describe('A11Y Compliance', function() { | ||
|
||
var html = `<div> | ||
<label for="a11y-test"> | ||
<select multiple id="a11y-test" class="setup-here" placeholder="a11y test"> | ||
<option value="a">a</option> | ||
<option value="b">b</option> | ||
<option value="c">c</option> | ||
</select> | ||
</div>`; | ||
|
||
it_n('setup', function(done) { | ||
|
||
var test = setup_test(html); | ||
|
||
aChecker.getCompliance(test.instance.wrapper, 'setup', function (results) { | ||
|
||
var returnCode = aChecker.assertCompliance(results); | ||
assert.equal( returnCode, 0, "A11Y Scan failed." + JSON.stringify(results) ); | ||
done(); | ||
}); | ||
|
||
}); | ||
|
||
it_n('isOpen', function(done) { | ||
|
||
var test = setup_test(html); | ||
|
||
click(test.instance.control, function(){ | ||
|
||
assert.equal(test.instance.isOpen,true); | ||
|
||
aChecker.getCompliance(test.instance.wrapper, 'isOpen', function (results) { | ||
|
||
var returnCode = aChecker.assertCompliance(results); | ||
assert.equal( returnCode, 0, "A11Y Scan failed." + JSON.stringify(results) ); | ||
done(); | ||
}); | ||
}); | ||
|
||
}); | ||
|
||
|
||
}); |