Fix steps.
This commit is contained in:
@@ -5,7 +5,7 @@ from lettuce import world, step
|
||||
from terrain.steps import reload_the_page
|
||||
|
||||
|
||||
@step('I have set "show captions" to (.*)')
|
||||
@step('I have set "show captions" to (.*)$')
|
||||
def set_show_captions(step, setting):
|
||||
world.css_click('a.edit-button')
|
||||
world.wait_for(lambda _driver: world.css_visible('a.save-button'))
|
||||
@@ -13,7 +13,7 @@ def set_show_captions(step, setting):
|
||||
world.css_click('a.save-button')
|
||||
|
||||
|
||||
@step('when I view the (video.*) it (.*) show the captions')
|
||||
@step('when I view the (video.*) it (.*) show the captions$')
|
||||
def shows_captions(_step, video_type, show_captions):
|
||||
# Prevent cookies from overriding course settings
|
||||
world.browser.cookies.delete('hide_captions')
|
||||
@@ -39,7 +39,7 @@ def correct_video_settings(_step):
|
||||
['Youtube ID for 1.5x speed', '', False]])
|
||||
|
||||
|
||||
@step('my video display name change is persisted on save')
|
||||
@step('my video display name change is persisted on save$')
|
||||
def video_name_persisted(step):
|
||||
world.css_click('a.save-button')
|
||||
reload_the_page(step)
|
||||
|
||||
@@ -19,25 +19,25 @@ def i_created_a_video_component(step):
|
||||
)
|
||||
|
||||
|
||||
@step('when I view the (.*) it does not have autoplay enabled')
|
||||
@step('when I view the (.*) it does not have autoplay enabled$')
|
||||
def does_not_autoplay(_step, video_type):
|
||||
assert world.css_find('.%s' % video_type)[0]['data-autoplay'] == 'False'
|
||||
assert world.css_has_class('.video_control', 'play')
|
||||
|
||||
|
||||
@step('creating a video takes a single click')
|
||||
@step('creating a video takes a single click$')
|
||||
def video_takes_a_single_click(_step):
|
||||
assert(not world.is_css_present('.xmodule_VideoModule'))
|
||||
world.css_click("a[data-category='video']")
|
||||
assert(world.is_css_present('.xmodule_VideoModule'))
|
||||
|
||||
|
||||
@step('I edit the component')
|
||||
@step('I edit the component$')
|
||||
def i_edit_the_component(_step):
|
||||
world.edit_component()
|
||||
|
||||
|
||||
@step('I have (hidden|toggled) captions')
|
||||
@step('I have (hidden|toggled) captions$')
|
||||
def hide_or_show_captions(step, shown):
|
||||
button_css = 'a.hide-subtitles'
|
||||
if shown == 'hidden':
|
||||
@@ -54,7 +54,7 @@ def hide_or_show_captions(step, shown):
|
||||
world.css_click(button_css)
|
||||
|
||||
|
||||
@step('I have created a video with only XML data')
|
||||
@step('I have created a video with only XML data$')
|
||||
def xml_only_video(step):
|
||||
# Create a new video *without* metadata. This requires a certain
|
||||
# amount of rummaging to make sure all the correct data is present
|
||||
@@ -84,7 +84,7 @@ def xml_only_video(step):
|
||||
reload_the_page(step)
|
||||
|
||||
|
||||
@step('The correct Youtube video is shown')
|
||||
@step('The correct Youtube video is shown$')
|
||||
def the_youtube_video_is_shown(_step):
|
||||
ele = world.css_find('.video').first
|
||||
assert ele['data-streams'].split(':')[1] == world.scenario_dict['YOUTUBE_ID']
|
||||
|
||||
Reference in New Issue
Block a user