Fix acceptance tests.

This commit is contained in:
polesye
2013-10-02 20:23:42 +03:00
parent a3525875fd
commit 960c2ec472
5 changed files with 46 additions and 173 deletions

View File

@@ -25,12 +25,13 @@ def go_to_uploads(_step):
world.css_click(uploads_css)
@step(u'I upload the file "([^"]*)"$')
def upload_file(_step, file_name):
@step(u'I upload the (.*)file "([^"]*)"$')
def upload_file(_step, is_test_file, file_name):
upload_css = 'a.upload-button'
world.css_click(upload_css)
_write_test_file(file_name, "test file")
if not is_test_file:
_write_test_file(file_name, "test file")
# uploading the file itself
path = os.path.join(TEST_ROOT, 'uploads/', file_name)

View File

@@ -23,6 +23,10 @@ def shows_captions(_step, show_captions):
else:
assert world.is_css_not_present('div.video.closed')
# Prevent cookies from overriding course settings
world.browser.cookies.delete('hide_captions')
world.browser.cookies.delete('current_player_mode')
@step('I see the correct video settings and default values$')
def correct_video_settings(_step):

View File

@@ -16,24 +16,28 @@ def i_created_a_video_component(step):
)
@step('I have created a Video component with subtitles$')
def i_created_a_video_component_subtitles(step):
step.given('I have created a Video component')
@step('I have created a Video component with (.*)subtitles$')
def i_created_a_video_with_subs(_step, sub_id):
_step.given('I have created a Video component')
# Store the current URL so we can return here
video_url = world.browser.url
# Upload subtitles for the video using the upload interface
step.given('I have uploaded subtitles')
_step.given('I have uploaded {} subtitles'.format(sub_id))
# Return to the video
world.visit(video_url)
@step('I have uploaded subtitles')
def i_have_uploaded_subtitles(step):
step.given('I go to the files and uploads page')
step.given('I upload the file "subs_OEoXaMPEzfM.srt.sjson"')
@step('I have uploaded (.*) subtitles')
def i_have_uploaded_subtitles(_step, sub_id):
_step.given('I go to the files and uploads page')
sub_id = sub_id.strip()
if not sub_id:
sub_id = 'OEoXaMPEzfM'
_step.given('I upload the test file "subs_{}.srt.sjson"'.format(sub_id))
@step('when I view the (.*) it does not have autoplay enabled$')