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
74f3595d
Commit
74f3595d
authored
Aug 12, 2013
by
Anton Stupak
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add acceptance tests for checking rendering.
parent
e20acee4
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
63 additions
and
30 deletions
+63
-30
cms/envs/common.py
+0
-3
lms/djangoapps/courseware/features/video.feature
+13
-2
lms/djangoapps/courseware/features/video.py
+46
-7
lms/envs/acceptance.py
+0
-4
lms/envs/acceptance_static.py
+0
-4
lms/envs/common.py
+0
-2
lms/templates/video.html
+4
-8
No files found.
cms/envs/common.py
View file @
74f3595d
...
...
@@ -39,9 +39,6 @@ MITX_FEATURES = {
'AUTH_USE_MIT_CERTIFICATES'
:
False
,
# do not display video when running automated acceptance tests
'STUB_VIDEO_FOR_TESTING'
:
False
,
# email address for studio staff (eg to request course creation)
'STUDIO_REQUEST_EMAIL'
:
''
,
...
...
lms/djangoapps/courseware/features/video.feature
View file @
74f3595d
Feature
:
Video component
As a student, I want to view course videos in LMS.
Scenario
:
Video component is fully rendered in the LMS in HTML5 mode
Given
the course has a Video component in HTML5 mode
Then
when I view the video it has rendered in HTML5 mode
And
all sources are correct
Scenario
:
Video component is fully rendered in the LMS in Youtube mode
Given
the course has a Video component in Youtube mode
Then
when I view the video it has rendered in Youtube mode
Scenario
:
Autoplay is enabled in LMS for a Video component
Given
the course has a Video component
Then
when I view the video it has autoplay enabled
Given
the course has a Video component
in HTML5 mode
Then
when I view the video it has autoplay enabled
\ No newline at end of file
lms/djangoapps/courseware/features/video.py
View file @
74f3595d
...
...
@@ -6,19 +6,24 @@ from common import i_am_registered_for_the_course, section_location
############### ACTIONS ####################
HTML5_SOURCES
=
[
'https://s3.amazonaws.com/edx-course-videos/edx-intro/edX-FA12-cware-1_100.mp4'
,
'https://s3.amazonaws.com/edx-course-videos/edx-intro/edX-FA12-cware-1_100.webm'
,
'https://s3.amazonaws.com/edx-course-videos/edx-intro/edX-FA12-cware-1_100.ogv'
]
@step
(
'when I view the (.*) it has autoplay enabled'
)
def
does_autoplay_video
(
_step
,
video_type
):
assert
(
world
.
css_find
(
'.
%
s'
%
video_type
)[
0
][
'data-autoplay'
]
==
'True'
)
@step
(
'the course has a Video component'
)
def
view_video
(
_step
):
@step
(
'the course has a Video component
in (.*) mode
'
)
def
view_video
(
_step
,
player_mode
):
coursenum
=
'test_course'
i_am_registered_for_the_course
(
step
,
coursenum
)
# Make sure we have a video
add_video_to_course
(
coursenum
)
add_video_to_course
(
coursenum
,
player_mode
.
lower
()
)
chapter_name
=
world
.
scenario_dict
[
'SECTION'
]
.
display_name
.
replace
(
" "
,
"_"
)
section_name
=
chapter_name
url
=
django_url
(
'/courses/
%
s/
%
s/
%
s/courseware/
%
s/
%
s'
%
...
...
@@ -27,9 +32,43 @@ def view_video(_step):
world
.
browser
.
visit
(
url
)
def
add_video_to_course
(
course
):
world
.
ItemFactory
.
create
(
parent_location
=
section_location
(
course
),
category
=
'video'
,
display_name
=
'Video'
)
def
add_video_to_course
(
course
,
player_mode
):
category
=
'video'
kwargs
=
{
'parent_location'
:
section_location
(
course
),
'category'
:
category
,
'display_name'
:
'Video'
}
if
player_mode
==
'html5'
:
kwargs
.
update
({
'metadata'
:
{
'youtube_id_1_0'
:
''
,
'youtube_id_0_75'
:
''
,
'youtube_id_1_25'
:
''
,
'youtube_id_1_5'
:
''
,
'html5_sources'
:
HTML5_SOURCES
}
})
world
.
ItemFactory
.
create
(
**
kwargs
)
@step
(
'when I view the video it has rendered in (.*) mode'
)
def
video_is_rendered
(
_step
,
mode
):
modes
=
{
'html5'
:
'video'
,
'youtube'
:
'iframe'
}
if
mode
.
lower
()
in
modes
:
assert
world
.
css_find
(
'.video {0}'
.
format
(
modes
[
mode
.
lower
()]))
.
first
else
:
assert
False
@step
(
'all sources are correct'
)
def
all_sources_are_correct
(
_step
):
sources
=
world
.
css_find
(
'.video video source'
)
assert
set
(
source
[
'src'
]
for
source
in
sources
)
==
set
(
HTML5_SOURCES
)
lms/envs/acceptance.py
View file @
74f3595d
...
...
@@ -75,10 +75,6 @@ XQUEUE_INTERFACE = {
"basic_auth"
:
(
'anant'
,
'agarwal'
),
}
# Do not display the YouTube videos in the browser while running the
# acceptance tests. This makes them faster and more reliable
MITX_FEATURES
[
'STUB_VIDEO_FOR_TESTING'
]
=
True
# Forums are disabled in test.py to speed up unit tests, but we do not have
# per-test control for acceptance tests
MITX_FEATURES
[
'ENABLE_DISCUSSION_SERVICE'
]
=
True
...
...
lms/envs/acceptance_static.py
View file @
74f3595d
...
...
@@ -70,10 +70,6 @@ XQUEUE_INTERFACE = {
"basic_auth"
:
(
'anant'
,
'agarwal'
),
}
# Do not display the YouTube videos in the browser while running the
# acceptance tests. This makes them faster and more reliable
MITX_FEATURES
[
'STUB_VIDEO_FOR_TESTING'
]
=
True
# Include the lettuce app for acceptance testing, including the 'harvest' django-admin command
INSTALLED_APPS
+=
(
'lettuce.django'
,)
LETTUCE_APPS
=
(
'courseware'
,)
...
...
lms/envs/common.py
View file @
74f3595d
...
...
@@ -86,8 +86,6 @@ MITX_FEATURES = {
'DISABLE_LOGIN_BUTTON'
:
False
,
# used in systems where login is automatic, eg MIT SSL
'STUB_VIDEO_FOR_TESTING'
:
False
,
# do not display video when running automated acceptance tests
# extrernal access methods
'ACCESS_REQUIRE_STAFF_FOR_COURSE'
:
False
,
'AUTH_USE_OPENID'
:
False
,
...
...
lms/templates/video.html
View file @
74f3595d
...
...
@@ -8,18 +8,14 @@
id=
"video_${id}"
class=
"video"
%
if
not
settings
.
MITX_FEATURES
['
STUB_VIDEO_FOR_TESTING
']
:
data-streams=
"${youtube_streams}"
%
endif
data-streams=
"${youtube_streams}"
${'
data-sub=
"{}"
'.
format
(
sub
)
if
sub
else
''}
${'
data-autoplay=
"{}"
'.
format
(
autoplay
)
if
autoplay
else
''}
%
if
not
settings
.
MITX_FEATURES
['
STUB_VIDEO_FOR_TESTING
']
:
${'
data-mp4-source=
"{}"
'.
format
(
sources
.
get
('
mp4
'))
if
sources
.
get
('
mp4
')
else
''}
${'
data-webm-source=
"{}"
'.
format
(
sources
.
get
('
webm
'))
if
sources
.
get
('
webm
')
else
''}
${'
data-ogg-source=
"{}"
'.
format
(
sources
.
get
('
ogv
'))
if
sources
.
get
('
ogv
')
else
''}
%
endif
${'
data-mp4-source=
"{}"
'.
format
(
sources
.
get
('
mp4
'))
if
sources
.
get
('
mp4
')
else
''}
${'
data-webm-source=
"{}"
'.
format
(
sources
.
get
('
webm
'))
if
sources
.
get
('
webm
')
else
''}
${'
data-ogg-source=
"{}"
'.
format
(
sources
.
get
('
ogv
'))
if
sources
.
get
('
ogv
')
else
''}
data-caption-data-dir=
"${data_dir}"
data-show-captions=
"${show_captions}"
...
...
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