diff --git a/lms/djangoapps/courseware/features/video.feature b/lms/djangoapps/courseware/features/video.feature index 002da92636..c1e0c7f501 100644 --- a/lms/djangoapps/courseware/features/video.feature +++ b/lms/djangoapps/courseware/features/video.feature @@ -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 "好 各位同学" \ No newline at end of file + Then I can download transcript in "srt" format that has text "好 各位同学" diff --git a/lms/djangoapps/courseware/features/video.py b/lms/djangoapps/courseware/features/video.py index e48a7627d5..414371c36f 100644 --- a/lms/djangoapps/courseware/features/video.py +++ b/lms/djangoapps/courseware/features/video.py @@ -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)