Merge pull request #3001 from edx/anton/fix-flaky-acceptance-test

Video: Fix flaky acceptance test.
This commit is contained in:
Anton Stupak
2014-03-21 14:03:45 +02:00
2 changed files with 16 additions and 10 deletions

View File

@@ -181,11 +181,11 @@ Feature: LMS Video component
| track | download_track |
| http://example.org/ | true |
And I open the section with videos
Then I can download transcript in "srt" format and has text "00:00:00,270"
Then I can download transcript in "srt" format that has text "00:00:00,270"
And I select the transcript format "txt"
Then I can download transcript in "txt" format and has text "Hi, welcome to Edx."
Then I can download transcript in "txt" format that has text "Hi, welcome to Edx."
When I open video "B"
Then I can download transcript in "txt" format and has text "Hi, welcome to Edx."
Then I can download transcript in "txt" format that has text "Hi, welcome to Edx."
When I open video "C"
Then menu "download_transcript" doesn't exist
@@ -212,9 +212,10 @@ Feature: LMS Video component
And it has a video in "Youtube" mode:
| transcripts | sub | download_track |
| {"zh": "chinese_transcripts.srt"} | OEoXaMPEzfM | true |
Then I can download transcript in "srt" format that has text "Hi, welcome to Edx."
And I select language with code "zh"
And I see " " text in the captions
Then I can download transcript in "srt" format and has text " "
Then I can download transcript in "srt" format that has text " "
# 22
Scenario: Download button works correctly for non-english transcript in HTML5 mode of Video component
@@ -224,9 +225,10 @@ Feature: LMS Video component
And it has a video in "HTML5" mode:
| transcripts | sub | download_track |
| {"zh": "chinese_transcripts.srt"} | OEoXaMPEzfM | true |
Then I can download transcript in "srt" format that has text "Hi, welcome to Edx."
And I select language with code "zh"
And I see " " text in the captions
Then I can download transcript in "srt" format and has text " "
Then I can download transcript in "srt" format that has text " "
# 23
Scenario: Download button works correctly w/o english transcript in HTML5 mode of Video component
@@ -236,7 +238,7 @@ Feature: LMS Video component
| transcripts | download_track |
| {"zh": "chinese_transcripts.srt"} | true |
And I see " " text in the captions
Then I can download transcript in "srt" format and has text " "
Then I can download transcript in "srt" format that has text " "
# 24
Scenario: Download button works correctly w/o english transcript in Youtube mode of Video component
@@ -246,4 +248,4 @@ Feature: LMS Video component
| transcripts | download_track |
| {"zh": "chinese_transcripts.srt"} | true |
And I see " " text in the captions
Then I can download transcript in "srt" format and has text " "
Then I can download transcript in "srt" format that has text " "

View File

@@ -135,6 +135,8 @@ def add_video_to_course(course, player_mode, hashes, display_name='Video'):
})
world.scenario_dict['VIDEO'] = world.ItemFactory.create(**kwargs)
world.wait_for_present('.is-initialized')
world.wait_for_invisible('.video-wrapper .spinner')
def _get_sjson_filename(videoId, lang):
@@ -355,11 +357,13 @@ def check_text_in_the_captions(_step, text):
@step('I select language with code "([^"]*)"$')
def select_language(_step, code):
_open_menu("language")
selector = VIDEO_MENUS["language"] + ' li[data-lang-code={code}]'.format(
selector = VIDEO_MENUS["language"] + ' li[data-lang-code="{code}"]'.format(
code=code
)
world.wait_for_present(selector)
world.css_find(VIDEO_BUTTONS["CC"])[0].mouse_over()
world.wait_for_visible(selector)
world.css_click(selector)
assert world.css_has_class(selector, 'active')
@@ -435,7 +439,7 @@ def video_alignment(_step, transcript_visibility):
assert all([width, height])
@step('I can download transcript in "([^"]*)" format and has text "([^"]*)"$')
@step('I can download transcript in "([^"]*)" format that has text "([^"]*)"$')
def i_can_download_transcript(_step, format, text):
assert world.css_has_text('.video-tracks .a11y-menu-button', '.' + format, strip=True)