Commit 008c769f by Peter Fogg

Update and fix acceptance to show captions when correct.

parent 1ff72e0b
...@@ -9,12 +9,22 @@ Feature: Video Component ...@@ -9,12 +9,22 @@ Feature: Video Component
Given I have clicked the new unit button Given I have clicked the new unit button
Then creating a video takes a single click Then creating a video takes a single click
Scenario: Captions are shown correctly Scenario: Captions are hidden correctly
Given I have created a Video component Given I have created a Video component
And I have hidden captions And I have hidden captions
Then when I view the video it does not show the 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 Given I have created a Video component
And I have set "show captions" to false And I have set "show captions" to False
Then when I view the video it does not show the captions 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
...@@ -18,18 +18,31 @@ def video_takes_a_single_click(step): ...@@ -18,18 +18,31 @@ def video_takes_a_single_click(step):
assert(world.is_css_present('.xmodule_VideoModule')) assert(world.is_css_present('.xmodule_VideoModule'))
@step('I have hidden captions') @step('I have (hidden|shown) captions')
def hide_captions(step): def hide_or_show_captions(step, shown):
if shown == 'hidden':
world.css_click('a.hide-subtitles') world.css_click('a.hide-subtitles')
@step('when I view the video it does not show the captions') @step('when I view the video it (.*) show the captions')
def does_not_show_captions(step): 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') 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') # @step('when I view the video it does show the captions')
def set_show_captions_false(step): # 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.css_click('a.edit-button')
world.browser.select('Show Captions', 'False') world.browser.select('Show Captions', setting)
world.css_click('a.save-button') world.css_click('a.save-button')
...@@ -75,7 +75,7 @@ class VideoModule(VideoFields, XModule): ...@@ -75,7 +75,7 @@ class VideoModule(VideoFields, XModule):
'track': self.track, 'track': self.track,
'display_name': self.display_name_with_default, 'display_name': self.display_name_with_default,
'caption_asset_path': "/static/subs/", 'caption_asset_path': "/static/subs/",
'show_captions': self.show_captions, 'show_captions': 'true' if self.show_captions else 'false',
'start': self.start_time, 'start': self.start_time,
'end': self.end_time 'end': self.end_time
}) })
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment