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
008c769f
Commit
008c769f
authored
Jun 12, 2013
by
Peter Fogg
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update and fix acceptance to show captions when correct.
parent
1ff72e0b
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
36 additions
and
13 deletions
+36
-13
cms/djangoapps/contentstore/features/video.feature
+13
-3
cms/djangoapps/contentstore/features/video.py
+22
-9
common/lib/xmodule/xmodule/video_module.py
+1
-1
No files found.
cms/djangoapps/contentstore/features/video.feature
View file @
008c769f
...
...
@@ -9,12 +9,22 @@ Feature: Video Component
Given
I have clicked the new unit button
Then
creating a video takes a single click
Scenario
:
Captions are
show
n correctly
Scenario
:
Captions are
hidde
n correctly
Given
I have created a Video component
And
I have hidden captions
Then
when I view the video it does not show the captions
Scenario
:
something
Scenario
:
Captions are shown correctly
Given
I have created a Video component
And
I have shown captions
Then
when I view the video it does show the captions
Scenario
:
Captions are hidden when "show captions" is false
Given
I have created a Video component
And
I have set
"show captions"
to
f
alse
And
I have set
"show captions"
to
F
alse
Then
when I view the video it does not show the captions
Scenario
:
Captions are shown when "show captions" is true
Given
I have created a Video component
And
I have set
"show captions"
to True
Then
when I view the video it does show the captions
cms/djangoapps/contentstore/features/video.py
View file @
008c769f
...
...
@@ -18,18 +18,31 @@ def video_takes_a_single_click(step):
assert
(
world
.
is_css_present
(
'.xmodule_VideoModule'
))
@step
(
'I have hidden captions'
)
def
hide_captions
(
step
):
world
.
css_click
(
'a.hide-subtitles'
)
@step
(
'I have (hidden|shown) captions'
)
def
hide_or_show_captions
(
step
,
shown
):
if
shown
==
'hidden'
:
world
.
css_click
(
'a.hide-subtitles'
)
@step
(
'when I view the video it does not show the captions'
)
def
does_not_show_captions
(
step
):
assert
world
.
css_find
(
'.video'
)[
0
]
.
has_class
(
'closed'
)
@step
(
'when I view the video it (.*) show the captions'
)
def
does_not_show_captions
(
step
,
show_captions
):
# Prevent cookies from overriding course settings
world
.
browser
.
cookies
.
delete
(
'hide_captions'
)
if
show_captions
==
'does not'
:
assert
world
.
css_find
(
'.video'
)[
0
]
.
has_class
(
'closed'
)
else
:
assert
not
world
.
css_find
(
'.video'
)[
0
]
.
has_class
(
'closed'
)
@step
(
'I have set "show captions" to false'
)
def
set_show_captions_false
(
step
):
# @step('when I view the video it does show the captions')
# def shows_captions(step):
# # Prevent cookies from overriding course settings
# world.browser.cookies.delete('hide_captions')
# assert not world.css_find('.video')[0].has_class('closed')
@step
(
'I have set "show captions" to (.*)'
)
def
set_show_captions_false
(
step
,
setting
):
world
.
css_click
(
'a.edit-button'
)
world
.
browser
.
select
(
'Show Captions'
,
'False'
)
world
.
browser
.
select
(
'Show Captions'
,
setting
)
world
.
css_click
(
'a.save-button'
)
common/lib/xmodule/xmodule/video_module.py
View file @
008c769f
...
...
@@ -75,7 +75,7 @@ class VideoModule(VideoFields, XModule):
'track'
:
self
.
track
,
'display_name'
:
self
.
display_name_with_default
,
'caption_asset_path'
:
"/static/subs/"
,
'show_captions'
:
self
.
show_captions
,
'show_captions'
:
'true'
if
self
.
show_captions
else
'false'
,
'start'
:
self
.
start_time
,
'end'
:
self
.
end_time
})
...
...
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