Commit 5d9dc325 by Christine Lytwynec

add custom-a11y-rules.js from edx-custom-a11y-rules

parent 5d422b10
...@@ -6,6 +6,7 @@ ...@@ -6,6 +6,7 @@
"uglify-js": "2.4.24" "uglify-js": "2.4.24"
}, },
"devDependencies": { "devDependencies": {
"jshint": "^2.7.0" "jshint": "^2.7.0",
"edx-custom-a11y-rules": "edx/edx-custom-a11y-rules"
} }
} }
...@@ -25,6 +25,7 @@ class TestPaverBokChoyCmd(unittest.TestCase): ...@@ -25,6 +25,7 @@ class TestPaverBokChoyCmd(unittest.TestCase):
"DEFAULT_STORE={default_store} " "DEFAULT_STORE={default_store} "
"SCREENSHOT_DIR='{repo_dir}/test_root/log{shard_str}' " "SCREENSHOT_DIR='{repo_dir}/test_root/log{shard_str}' "
"BOK_CHOY_HAR_DIR='{repo_dir}/test_root/log{shard_str}/hars' " "BOK_CHOY_HAR_DIR='{repo_dir}/test_root/log{shard_str}/hars' "
"BOKCHOY_A11Y_CUSTOM_RULES_FILE='{repo_dir}/{a11y_custom_file}' "
"SELENIUM_DRIVER_LOG_DIR='{repo_dir}/test_root/log{shard_str}' " "SELENIUM_DRIVER_LOG_DIR='{repo_dir}/test_root/log{shard_str}' "
"nosetests {repo_dir}/common/test/acceptance/{exp_text} " "nosetests {repo_dir}/common/test/acceptance/{exp_text} "
"--with-xunit " "--with-xunit "
...@@ -35,6 +36,7 @@ class TestPaverBokChoyCmd(unittest.TestCase): ...@@ -35,6 +36,7 @@ class TestPaverBokChoyCmd(unittest.TestCase):
repo_dir=REPO_DIR, repo_dir=REPO_DIR,
shard_str='/shard_' + self.shard if self.shard else '', shard_str='/shard_' + self.shard if self.shard else '',
exp_text=name, exp_text=name,
a11y_custom_file='node_modules/edx-custom-a11y-rules/lib/custom_a11y_rules.js',
) )
return expected_statement return expected_statement
......
...@@ -32,6 +32,10 @@ class Env(object): ...@@ -32,6 +32,10 @@ class Env(object):
BOK_CHOY_A11Y_REPORT_DIR = REPORT_DIR / "a11y" BOK_CHOY_A11Y_REPORT_DIR = REPORT_DIR / "a11y"
BOK_CHOY_COVERAGERC = BOK_CHOY_DIR / ".coveragerc" BOK_CHOY_COVERAGERC = BOK_CHOY_DIR / ".coveragerc"
BOK_CHOY_A11Y_COVERAGERC = BOK_CHOY_DIR / ".a11ycoveragerc" BOK_CHOY_A11Y_COVERAGERC = BOK_CHOY_DIR / ".a11ycoveragerc"
BOK_CHOY_A11Y_CUSTOM_RULES_FILE = (
REPO_ROOT / "node_modules" / "edx-custom-a11y-rules" /
"lib" / "custom_a11y_rules.js"
)
# If set, put reports for run in "unique" directories. # If set, put reports for run in "unique" directories.
# The main purpose of this is to ensure that the reports can be 'slurped' # The main purpose of this is to ensure that the reports can be 'slurped'
......
...@@ -55,6 +55,7 @@ class BokChoyTestSuite(TestSuite): ...@@ -55,6 +55,7 @@ class BokChoyTestSuite(TestSuite):
self.num_processes = kwargs.get('num_processes', DEFAULT_NUM_PROCESSES) self.num_processes = kwargs.get('num_processes', DEFAULT_NUM_PROCESSES)
self.extra_args = kwargs.get('extra_args', '') self.extra_args = kwargs.get('extra_args', '')
self.har_dir = self.log_dir / 'hars' self.har_dir = self.log_dir / 'hars'
self.a11y_file = Env.BOK_CHOY_A11Y_CUSTOM_RULES_FILE
self.imports_dir = kwargs.get('imports_dir', None) self.imports_dir = kwargs.get('imports_dir', None)
self.coveragerc = kwargs.get('coveragerc', None) self.coveragerc = kwargs.get('coveragerc', None)
...@@ -205,6 +206,7 @@ class BokChoyTestSuite(TestSuite): ...@@ -205,6 +206,7 @@ class BokChoyTestSuite(TestSuite):
"DEFAULT_STORE={}".format(self.default_store), "DEFAULT_STORE={}".format(self.default_store),
"SCREENSHOT_DIR='{}'".format(self.log_dir), "SCREENSHOT_DIR='{}'".format(self.log_dir),
"BOK_CHOY_HAR_DIR='{}'".format(self.har_dir), "BOK_CHOY_HAR_DIR='{}'".format(self.har_dir),
"BOKCHOY_A11Y_CUSTOM_RULES_FILE='{}'".format(self.a11y_file),
"SELENIUM_DRIVER_LOG_DIR='{}'".format(self.log_dir), "SELENIUM_DRIVER_LOG_DIR='{}'".format(self.log_dir),
"nosetests", "nosetests",
test_spec, test_spec,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment