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
86d7c4b4
Commit
86d7c4b4
authored
Jul 28, 2015
by
Christine Lytwynec
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add bok choy accessibility tests
parent
448d9200
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
90 additions
and
1 deletions
+90
-1
requirements/test-acceptance.txt
+1
-1
scripts/jenkins-acceptance-tests.sh
+7
-0
test/acceptance/accessibility.py
+82
-0
No files found.
requirements/test-acceptance.txt
View file @
86d7c4b4
bok
_choy==0.3.4
bok
-choy==0.4.3
nose==1.3.3
scripts/jenkins-acceptance-tests.sh
View file @
86d7c4b4
...
...
@@ -37,3 +37,10 @@ pip install -r requirements/test-acceptance.txt
cd test
/acceptance
python tests.py
# Unset SELENIUM_HOST so that bok-choy doesn't try to use saucelabs
unset
SELENIUM_HOST
# AutoAuthPage times out in PhantomJS when using https, switch to use http
export
BASE_URL
=
"http://
${
BASIC_AUTH_USER
}
:
${
BASIC_AUTH_PASSWORD
}
@
${
TEST_HOST
}
"
export
SELENIUM_BROWSER
=
phantomjs
python accessibility.py
test/acceptance/accessibility.py
0 → 100644
View file @
86d7c4b4
"""
UI-level acceptance tests for OpenAssessment accessibility.
"""
import
os
import
unittest
from
tests
import
OpenAssessmentTest
class
OpenAssessmentAxsTest
(
OpenAssessmentTest
):
"""
UI-level acceptance tests for Open Assessment accessibility.
"""
def
_check_axs
(
self
):
self
.
auto_auth_page
.
visit
()
self
.
submission_page
.
visit
()
report
=
self
.
submission_page
.
do_axs_audit
()
# There was one page in this session
self
.
assertEqual
(
1
,
len
(
report
))
result
=
report
[
0
]
# Verify that this page has no accessibility errors.
self
.
assertEqual
(
0
,
len
(
result
.
errors
))
# Verify that this page currently has 2 accessibility warnings.
self
.
assertEqual
(
3
,
len
(
result
.
warnings
))
# And that these are the warnings that the page currently gives.
for
warning
in
result
.
warnings
:
self
.
assertTrue
(
warning
.
startswith
((
'Warning: AX_FOCUS_01'
,
'Warning: AX_COLOR_01'
,
'Warning: AX_IMAGE_01'
,
)),
msg
=
"Unexpected warning: {}"
.
format
(
warning
))
class
SelfAssessmentAxsTest
(
OpenAssessmentAxsTest
):
"""
Test the accessibility of the self-assessment flow.
"""
def
setUp
(
self
):
super
(
SelfAssessmentAxsTest
,
self
)
.
setUp
(
'self_only'
)
def
test_self_assessment_axs
(
self
):
self
.
_check_axs
()
class
PeerAssessmentAxsTest
(
OpenAssessmentAxsTest
):
"""
Test the accessibility of the peer-assessment flow.
"""
def
setUp
(
self
):
super
(
PeerAssessmentAxsTest
,
self
)
.
setUp
(
'peer_only'
)
def
test_peer_assessment_axs
(
self
):
self
.
_check_axs
()
class
StudentTrainingAxsTest
(
OpenAssessmentAxsTest
):
"""
Test the accessibility of student training (the "learning to assess" step).
"""
def
setUp
(
self
):
super
(
StudentTrainingAxsTest
,
self
)
.
setUp
(
'student_training'
)
def
test_student_training_axs
(
self
):
self
.
_check_axs
()
if
__name__
==
"__main__"
:
# Configure the screenshot directory
if
'SCREENSHOT_DIR'
not
in
os
.
environ
:
tests_dir
=
os
.
path
.
dirname
(
__file__
)
os
.
environ
[
'SCREENSHOT_DIR'
]
=
os
.
path
.
join
(
tests_dir
,
'screenshots'
)
unittest
.
main
()
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