Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
E
edx-platform
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-platform
Commits
5e133044
Commit
5e133044
authored
Oct 07, 2015
by
Christine Lytwynec
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add video a11y test
parent
5e524594
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
63 additions
and
36 deletions
+63
-36
common/test/acceptance/tests/video/test_studio_video_module.py
+63
-36
No files found.
common/test/acceptance/tests/video/test_studio_video_module.py
View file @
5e133044
...
...
@@ -3,6 +3,9 @@
"""
Acceptance tests for CMS Video Module.
"""
import
os
from
mock
import
patch
from
nose.plugins.attrib
import
attr
from
unittest
import
skipIf
from
...pages.studio.auto_auth
import
AutoAuthPage
...
...
@@ -42,6 +45,38 @@ class CMSVideoBaseTest(UniqueCourseTest):
)
self
.
assets
=
[]
self
.
addCleanup
(
YouTubeStubConfig
.
reset
)
def
_create_course_unit
(
self
,
youtube_stub_config
=
None
,
subtitles
=
False
):
"""
Create a Studio Video Course Unit and Navigate to it.
Arguments:
youtube_stub_config (dict)
subtitles (bool)
"""
if
youtube_stub_config
:
YouTubeStubConfig
.
configure
(
youtube_stub_config
)
if
subtitles
:
self
.
assets
.
append
(
'subs_3_yD_cEKoCk.srt.sjson'
)
self
.
navigate_to_course_unit
()
def
_create_video
(
self
):
"""
Create Xblock Video Component.
"""
self
.
video
.
create_video
()
video_xblocks
=
self
.
video
.
xblocks
()
# Total video xblock components count should be equals to 2
# Why 2? One video component is created by default for each test. Please see
# test_studio_video_module.py:CMSVideoTest._create_course_unit
# And we are creating second video component here.
self
.
assertTrue
(
video_xblocks
==
2
)
def
_install_course_fixture
(
self
):
"""
...
...
@@ -132,42 +167,6 @@ class CMSVideoTest(CMSVideoBaseTest):
CMS Video Test Class
"""
def
setUp
(
self
):
super
(
CMSVideoTest
,
self
)
.
setUp
()
self
.
addCleanup
(
YouTubeStubConfig
.
reset
)
def
_create_course_unit
(
self
,
youtube_stub_config
=
None
,
subtitles
=
False
):
"""
Create a Studio Video Course Unit and Navigate to it.
Arguments:
youtube_stub_config (dict)
subtitles (bool)
"""
if
youtube_stub_config
:
YouTubeStubConfig
.
configure
(
youtube_stub_config
)
if
subtitles
:
self
.
assets
.
append
(
'subs_3_yD_cEKoCk.srt.sjson'
)
self
.
navigate_to_course_unit
()
def
_create_video
(
self
):
"""
Create Xblock Video Component.
"""
self
.
video
.
create_video
()
video_xblocks
=
self
.
video
.
xblocks
()
# Total video xblock components count should be equals to 2
# Why 2? One video component is created by default for each test. Please see
# test_studio_video_module.py:CMSVideoTest._create_course_unit
# And we are creating second video component here.
self
.
assertTrue
(
video_xblocks
==
2
)
def
test_youtube_stub_proxy
(
self
):
"""
Scenario: YouTube stub server proxies YouTube API correctly
...
...
@@ -320,3 +319,31 @@ class CMSVideoTest(CMSVideoBaseTest):
self
.
save_unit_settings
()
self
.
video
.
click_player_button
(
'play'
)
@attr
(
'a11y'
)
class
CMSVideoA11yTest
(
CMSVideoBaseTest
):
"""
CMS Video Accessibility Test Class
"""
def
setUp
(
self
):
browser
=
os
.
environ
.
get
(
'SELENIUM_BROWSER'
,
'firefox'
)
# the a11y tests run in CI under phantomjs which doesn't
# support html5 video or flash player, so the video tests
# don't work in it. We still want to be able to run these
# tests in CI, so override the browser setting if it is
# phantomjs.
if
browser
==
'phantomjs'
:
browser
=
'firefox'
with
patch
.
dict
(
os
.
environ
,
{
'SELENIUM_BROWSER'
:
browser
}):
super
(
CMSVideoA11yTest
,
self
)
.
setUp
()
def
test_video_player_a11y
(
self
):
# Limit the scope of the audit to the video player only.
self
.
outline
.
a11y_audit
.
config
.
set_scope
(
include
=
[
"div.video"
])
self
.
_create_course_unit
()
self
.
outline
.
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