Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
E
edx-ora2
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
edx
edx-ora2
Commits
c69c00af
Commit
c69c00af
authored
Nov 12, 2015
by
Christine Lytwynec
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add custom a11y rules to bok choy tests
parent
cfea6656
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
33 additions
and
0 deletions
+33
-0
.gitignore
+5
-0
scripts/test-acceptance.sh
+19
-0
test/acceptance/accessibility.py
+9
-0
No files found.
.gitignore
View file @
c69c00af
...
...
@@ -34,6 +34,11 @@ coverage.xml
test_ora2db
test_ora2db-journal
# Bok choy
test/custom_a11y_rules.js
test/acceptance/screenshots/*.png
test/logs/*
# Mr Developer
.mr.developer.cfg
.project
...
...
scripts/test-acceptance.sh
View file @
c69c00af
...
...
@@ -33,5 +33,24 @@ cd test/logs
test_name
=
"
${
1
:-
acceptance
}
"
# The machines that these tests run on in jenkins have an old
# version of npm which doesn't seem to work with the
# requirements in this repo. There is a devops ticket for
# this, but it may be better to wait until some of the other
# work they have going on now is done before attempting to
# install the custom rules via npm. This bit of code is a
# work around for that. It will work both in jenkins and for
# local runs of the tests.
if
[[
"
${
test_name
}
"
=
"accessibility"
]]
;
then
export
BOKCHOY_A11Y_CUSTOM_RULES_FILE
=
../../test/custom_a11y_rules.js
if
[[
!
-f
$BOKCHOY_A11Y_CUSTOM_RULES_FILE
]]
;
then
echo
"Custom a11y rules file not found. Fetching it..."
custom_a11y_version
=
8633ea2fd04d84d69c4610bbfbf38db32ad005a9
curl https://raw.githubusercontent.com/edx/edx-custom-a11y-rules/
${
custom_a11y_version
}
/lib/custom_a11y_rules.js
>
${
BOKCHOY_A11Y_CUSTOM_RULES_FILE
}
fi
fi
echo
"Running acceptance tests from
${
test_name
}
.py against the sandbox..."
python ../acceptance/
${
test_name
}
.py
test/acceptance/accessibility.py
View file @
c69c00af
...
...
@@ -16,12 +16,21 @@ class OpenAssessmentA11yTest(OpenAssessmentTest):
self
.
auto_auth_page
.
visit
()
def
_check_a11y
(
self
,
page
):
page
.
a11y_audit
.
config
.
set_scope
(
exclude
=
[
".container-footer"
,
".nav-skip"
,
"#global-navigation"
,
],
)
page
.
a11y_audit
.
config
.
set_rules
({
"ignore"
:
[
"aria-valid-attr"
,
# TODO: AC-199
"color-contrast"
,
# TODO: AC-198
"empty-heading"
,
# TODO: AC-197
"link-href"
,
# TODO: AC-199
"link-name"
,
# TODO: AC-196
"skip-link"
,
# TODO: AC-179
]
})
page
.
a11y_audit
.
check_for_accessibility_errors
()
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment