Addresses latest comments on pull request #132. In particular:

- Make 1.0x speed default Youtube ID Lyla's introduction video.
- Add acceptance tests for toggling captions on/off.
- Move captions settings acceptance tests into video-editor.feature.
- Rename acceptance test methods to reflect their function.
- Remove undefined variable from video Jasmine tests.
- Test VideoDescriptor.from_xml when no attributes are set.
- Convert Stringy* to non-Stringy equivalents.
- Test parsing of Youtube ID strings and times in more cases.
- Remove some commented-out code.
This commit is contained in:
Peter Fogg
2013-06-14 14:08:28 -04:00
parent 206f582503
commit 6035d0a23a
7 changed files with 79 additions and 37 deletions

View File

@@ -11,3 +11,13 @@ Feature: Video Component Editor
And I edit and select Settings
Then I can modify the display name
And my display name change is persisted on save
Scenario: Captions are hidden when "show captions" is false
Given I have created a Video component
And I have set "show captions" to False
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

View File

@@ -16,15 +16,9 @@ Feature: Video Component
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
Scenario: Captions are toggled correctly
Given I have created a Video component
And I have set "show captions" to False
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
And I have toggled captions
Then when I view the video it does show the captions

View File

@@ -18,31 +18,33 @@ def video_takes_a_single_click(step):
assert(world.is_css_present('.xmodule_VideoModule'))
@step('I have (hidden|shown) captions')
@step('I have (hidden|toggled) captions')
def hide_or_show_captions(step, shown):
button_css = 'a.hide-subtitles'
if shown == 'hidden':
world.css_click('a.hide-subtitles')
world.css_click(button_css)
if shown == 'toggled':
world.css_click(button_css)
# When we click the first time, a tooltip shows up. We want to
# click the button rather than the tooltip, so move the mouse
# away to make it disappear.
button = world.css_find(button_css)
button.mouse_out()
world.css_click(button_css)
@step('when I view the video it (.*) show the captions')
def does_not_show_captions(step, show_captions):
def shows_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('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')
assert world.is_css_not_present('.video.closed')
@step('I have set "show captions" to (.*)')
def set_show_captions_false(step, setting):
def set_show_captions(step, setting):
world.css_click('a.edit-button')
world.browser.select('Show Captions', setting)
world.css_click('a.save-button')