Commit ce7e7740 by Anton Stupak

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

Video: Fix flaky acceptance test.
parents bbf4471d f3f1aa29
...@@ -181,11 +181,11 @@ Feature: LMS Video component ...@@ -181,11 +181,11 @@ Feature: LMS Video component
| track | download_track | | track | download_track |
| http://example.org/ | true | | http://example.org/ | true |
And I open the section with videos 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" 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" 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" When I open video "C"
Then menu "download_transcript" doesn't exist Then menu "download_transcript" doesn't exist
...@@ -212,9 +212,10 @@ Feature: LMS Video component ...@@ -212,9 +212,10 @@ Feature: LMS Video component
And it has a video in "Youtube" mode: And it has a video in "Youtube" mode:
| transcripts | sub | download_track | | transcripts | sub | download_track |
| {"zh": "chinese_transcripts.srt"} | OEoXaMPEzfM | true | | {"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 select language with code "zh"
And I see "好 各位同学" text in the captions 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 # 22
Scenario: Download button works correctly for non-english transcript in HTML5 mode of Video component Scenario: Download button works correctly for non-english transcript in HTML5 mode of Video component
...@@ -224,9 +225,10 @@ Feature: LMS Video component ...@@ -224,9 +225,10 @@ Feature: LMS Video component
And it has a video in "HTML5" mode: And it has a video in "HTML5" mode:
| transcripts | sub | download_track | | transcripts | sub | download_track |
| {"zh": "chinese_transcripts.srt"} | OEoXaMPEzfM | true | | {"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 select language with code "zh"
And I see "好 各位同学" text in the captions 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 # 23
Scenario: Download button works correctly w/o english transcript in HTML5 mode of Video component Scenario: Download button works correctly w/o english transcript in HTML5 mode of Video component
...@@ -236,7 +238,7 @@ Feature: LMS Video component ...@@ -236,7 +238,7 @@ Feature: LMS Video component
| transcripts | download_track | | transcripts | download_track |
| {"zh": "chinese_transcripts.srt"} | true | | {"zh": "chinese_transcripts.srt"} | true |
And I see "好 各位同学" text in the captions 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 # 24
Scenario: Download button works correctly w/o english transcript in Youtube mode of Video component Scenario: Download button works correctly w/o english transcript in Youtube mode of Video component
...@@ -246,4 +248,4 @@ Feature: LMS Video component ...@@ -246,4 +248,4 @@ Feature: LMS Video component
| transcripts | download_track | | transcripts | download_track |
| {"zh": "chinese_transcripts.srt"} | true | | {"zh": "chinese_transcripts.srt"} | true |
And I see "好 各位同学" text in the captions 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 "好 各位同学"
\ No newline at end of file
...@@ -135,6 +135,8 @@ def add_video_to_course(course, player_mode, hashes, display_name='Video'): ...@@ -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.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): def _get_sjson_filename(videoId, lang):
...@@ -355,11 +357,13 @@ def check_text_in_the_captions(_step, text): ...@@ -355,11 +357,13 @@ def check_text_in_the_captions(_step, text):
@step('I select language with code "([^"]*)"$') @step('I select language with code "([^"]*)"$')
def select_language(_step, 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 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) world.css_click(selector)
assert world.css_has_class(selector, 'active') assert world.css_has_class(selector, 'active')
...@@ -435,7 +439,7 @@ def video_alignment(_step, transcript_visibility): ...@@ -435,7 +439,7 @@ def video_alignment(_step, transcript_visibility):
assert all([width, height]) 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): def i_can_download_transcript(_step, format, text):
assert world.css_has_text('.video-tracks .a11y-menu-button', '.' + format, strip=True) assert world.css_has_text('.video-tracks .a11y-menu-button', '.' + format, strip=True)
......
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