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
ef06932d
Commit
ef06932d
authored
Jun 20, 2013
by
Will Daly
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #197 from edx/will/fix-video-acceptance-tests
Will/fix video acceptance tests
parents
0d3b7edd
dbd2716e
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
83 additions
and
99 deletions
+83
-99
lms/djangoapps/courseware/features/video.feature
+7
-3
lms/djangoapps/courseware/features/video.py
+22
-0
lms/djangoapps/courseware/features/videoalpha.feature
+0
-6
lms/djangoapps/courseware/features/videoalpha.py
+0
-36
lms/templates/video.html
+22
-26
lms/templates/videoalpha.html
+32
-28
No files found.
lms/djangoapps/courseware/features/video.feature
View file @
ef06932d
Feature
:
Video component
As a student, I want to view course videos in LMS.
Scenario
:
Autoplay is enabled in LMS
Given
the course has a Video component
Then
when I view the video it has autoplay enabled
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
Scenario
:
Autoplay is enabled in the LMS for a VideoAlpha component
Given
the course has a VideoAlpha component
Then
when I view the video it has autoplay enabled
lms/djangoapps/courseware/features/video.py
View file @
ef06932d
...
...
@@ -27,8 +27,30 @@ def view_video(_step):
world
.
browser
.
visit
(
url
)
@step
(
'the course has a VideoAlpha component'
)
def
view_videoalpha
(
step
):
coursename
=
TEST_COURSE_NAME
.
replace
(
' '
,
'_'
)
i_am_registered_for_the_course
(
step
,
coursename
)
# Make sure we have a videoalpha
add_videoalpha_to_course
(
coursename
)
chapter_name
=
TEST_SECTION_NAME
.
replace
(
" "
,
"_"
)
section_name
=
chapter_name
url
=
django_url
(
'/courses/edx/Test_Course/Test_Course/courseware/
%
s/
%
s'
%
(
chapter_name
,
section_name
))
world
.
browser
.
visit
(
url
)
def
add_video_to_course
(
course
):
template_name
=
'i4x://edx/templates/video/default'
world
.
ItemFactory
.
create
(
parent_location
=
section_location
(
course
),
template
=
template_name
,
display_name
=
'Video'
)
def
add_videoalpha_to_course
(
course
):
template_name
=
'i4x://edx/templates/videoalpha/Video_Alpha'
world
.
ItemFactory
.
create
(
parent_location
=
section_location
(
course
),
template
=
template_name
,
display_name
=
'Video Alpha'
)
lms/djangoapps/courseware/features/videoalpha.feature
deleted
100644 → 0
View file @
0d3b7edd
Feature
:
Video Alpha component
As a student, I want to view course videos in LMS.
Scenario
:
Autoplay is enabled in LMS
Given
the course has a Video component
Then
when I view the video it has autoplay enabled
lms/djangoapps/courseware/features/videoalpha.py
deleted
100644 → 0
View file @
0d3b7edd
#pylint: disable=C0111
#pylint: disable=W0613
#pylint: disable=W0621
from
lettuce
import
world
,
step
from
lettuce.django
import
django_url
from
common
import
TEST_COURSE_NAME
,
TEST_SECTION_NAME
,
i_am_registered_for_the_course
,
section_location
############### ACTIONS ####################
@step
(
'when I view the video it has autoplay enabled'
)
def
does_autoplay
(
step
):
assert
(
world
.
css_find
(
'.videoalpha'
)[
0
][
'data-autoplay'
]
==
'True'
)
@step
(
'the course has a Video component'
)
def
view_videoalpha
(
step
):
coursename
=
TEST_COURSE_NAME
.
replace
(
' '
,
'_'
)
i_am_registered_for_the_course
(
step
,
coursename
)
# Make sure we have a videoalpha
add_videoalpha_to_course
(
coursename
)
chapter_name
=
TEST_SECTION_NAME
.
replace
(
" "
,
"_"
)
section_name
=
chapter_name
url
=
django_url
(
'/courses/edx/Test_Course/Test_Course/courseware/
%
s/
%
s'
%
(
chapter_name
,
section_name
))
world
.
browser
.
visit
(
url
)
def
add_videoalpha_to_course
(
course
):
template_name
=
'i4x://edx/templates/videoalpha/default'
world
.
ItemFactory
.
create
(
parent_location
=
section_location
(
course
),
template
=
template_name
,
display_name
=
'Video Alpha 1'
)
lms/templates/video.html
View file @
ef06932d
...
...
@@ -2,37 +2,33 @@
<h2>
${display_name}
</h2>
% endif
%if settings.MITX_FEATURES['STUB_VIDEO_FOR_TESTING']:
<div
id=
"stub_out_video_for_testing"
>
<div
class=
"video"
data-autoplay=
"${settings.MITX_FEATURES['AUTOPLAY_VIDEOS']}"
>
<section
class=
"video-controls"
>
<div
class=
"slider"
></div>
<div>
<ul
class=
"vcr"
>
<li><a
class=
"video_control"
href=
"#"
></a></li>
<li>
<div
class=
"vidtime"
>
0:00 / 0:00
</div>
</li>
</ul>
<div
class=
"secondary-controls"
>
<a
href=
"#"
class=
"add-fullscreen"
title=
"Fill browser"
>
Fill Browser
</a>
</div>
</div>
</section>
</div>
</div>
%elif settings.MITX_FEATURES.get('USE_YOUTUBE_OBJECT_API') and normal_speed_video_id:
%if settings.MITX_FEATURES.get('USE_YOUTUBE_OBJECT_API') and normal_speed_video_id:
<object
width=
"640"
height=
"390"
>
<param
name=
"movie"
value=
"https://www.youtube.com/v/${normal_speed_video_id}?version=3&autoplay=1&rel=0"
></param>
%
if
not
settings
.
MITX_FEATURES
['
STUB_VIDEO_FOR_TESTING
']
:
value=
"https://www.youtube.com/v/${normal_speed_video_id}?version=3&autoplay=1&rel=0"
>
% endif
</param>
<param
name=
"allowScriptAccess"
value=
"always"
></param>
<embed
src=
"https://www.youtube.com/v/${normal_speed_video_id}?version=3&autoplay=1&rel=0"
type=
"application/x-shockwave-flash"
allowscriptaccess=
"always"
width=
"640"
height=
"390"
></embed>
<embed
%
if
not
settings
.
MITX_FEATURES
['
STUB_VIDEO_FOR_TESTING
']
:
src=
"https://www.youtube.com/v/${normal_speed_video_id}?version=3&autoplay=1&rel=0"
%
endif
type=
"application/x-shockwave-flash"
allowscriptaccess=
"always"
width=
"640"
height=
"390"
></embed>
</object>
%else:
<div
id=
"video_${id}"
class=
"video"
data-streams=
"${streams}"
data-show-captions=
"${show_captions}"
data-start=
"${start}"
data-end=
"${end}"
data-caption-asset-path=
"${caption_asset_path}"
data-autoplay=
"${settings.MITX_FEATURES['AUTOPLAY_VIDEOS']}"
>
<div
id=
"video_${id}"
class=
"video"
%
if
not
settings
.
MITX_FEATURES
['
STUB_VIDEO_FOR_TESTING
']
:
data-streams=
"${streams}"
%
endif
data-show-captions=
"${show_captions}"
data-start=
"${start}"
data-end=
"${end}"
data-caption-asset-path=
"${caption_asset_path}"
data-autoplay=
"${settings.MITX_FEATURES['AUTOPLAY_VIDEOS']}"
>
<div
class=
"tc-wrapper"
>
<article
class=
"video-wrapper"
>
<section
class=
"video-player"
>
...
...
lms/templates/videoalpha.html
View file @
ef06932d
...
...
@@ -2,34 +2,38 @@
<h2>
${display_name}
</h2>
% endif
%if settings.MITX_FEATURES['STUB_VIDEO_FOR_TESTING']:
<div
id=
"stub_out_video_for_testing"
></div>
%else:
<div
id=
"video_${id}"
class=
"video"
data-streams=
"${youtube_streams}"
${'
data-sub=
"{}"
'.
format
(
sub
)
if
sub
else
''}
${'
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}"
data-start=
"${start}"
data-end=
"${end}"
data-caption-asset-path=
"${caption_asset_path}"
data-autoplay=
"${autoplay}"
>
<div
class=
"tc-wrapper"
>
<article
class=
"video-wrapper"
>
<section
class=
"video-player"
>
<div
id=
"${id}"
></div>
</section>
<section
class=
"video-controls"
></section>
</article>
</div>
</div>
%endif
<div
id=
"video_${id}"
class=
"video"
%
if
not
settings
.
MITX_FEATURES
['
STUB_VIDEO_FOR_TESTING
']
:
data-streams=
"${youtube_streams}"
%
endif
${'
data-sub=
"{}"
'.
format
(
sub
)
if
sub
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-caption-data-dir=
"${data_dir}"
data-show-captions=
"${show_captions}"
data-start=
"${start}"
data-end=
"${end}"
data-caption-asset-path=
"${caption_asset_path}"
data-autoplay=
"${autoplay}"
>
<div
class=
"tc-wrapper"
>
<article
class=
"video-wrapper"
>
<section
class=
"video-player"
>
<div
id=
"${id}"
></div>
</section>
<section
class=
"video-controls"
></section>
</article>
</div>
</div>
% if sources.get('main'):
<div
class=
"video-sources"
>
...
...
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