updload/download/replace transcripts

EDUCATOR-2167
EDUCATOR-2168
EDUCATOR-2169
This commit is contained in:
Qubad786
2018-04-01 16:02:17 +05:00
committed by muhammad-ammar
parent 26a1f4506f
commit cadd4378c7
8 changed files with 356 additions and 195 deletions

View File

@@ -295,67 +295,6 @@ class VideoEditorTest(CMSVideoBaseTest):
self.save_unit_settings()
self.assertFalse(self.video.is_captions_visible())
def test_translations_clearing_works_w_saving(self):
"""
Scenario: Translations clearing works correctly w/ preliminary saving
Given I have created a Video component
And I edit the component
And I open tab "Advanced"
And I upload transcript files:
|lang_code|filename |
|uk |uk_transcripts.srt |
|zh |chinese_transcripts.srt|
And I save changes
Then when I view the video it does show the captions
And I see "Привіт, edX вітає вас." text in the captions
And video language menu has "uk, zh" translations
And I edit the component
And I open tab "Advanced"
And I see translations for "uk, zh"
And I click button "Clear"
And I save changes
Then when I view the video it does not show the captions
"""
self._create_video_component()
self.edit_component()
self.open_advanced_tab()
self.video.upload_translation('uk_transcripts.srt', 'uk')
self.video.upload_translation('chinese_transcripts.srt', 'zh')
self.save_unit_settings()
self.assertTrue(self.video.is_captions_visible())
unicode_text = "Привіт, edX вітає вас.".decode('utf-8')
self.assertIn(unicode_text, self.video.captions_text)
self.assertEqual(self.video.caption_languages.keys(), ['zh', 'uk'])
self.edit_component()
self.open_advanced_tab()
self.assertEqual(self.video.translations(), ['zh', 'uk'])
self.video.click_button('translations_clear')
self.save_unit_settings()
self.assertFalse(self.video.is_captions_visible())
def test_translations_clearing_works_wo_saving(self):
"""
Scenario: Translations clearing works correctly w/o preliminary saving
Given I have created a Video component
And I edit the component
And I open tab "Advanced"
And I upload transcript files:
|lang_code|filename |
|uk |uk_transcripts.srt |
|zh |chinese_transcripts.srt|
And I click button "Clear"
And I save changes
Then when I view the video it does not show the captions
"""
self._create_video_component()
self.edit_component()
self.open_advanced_tab()
self.video.upload_translation('uk_transcripts.srt', 'uk')
self.video.upload_translation('chinese_transcripts.srt', 'zh')
self.video.click_button('translations_clear')
self.save_unit_settings()
self.assertFalse(self.video.is_captions_visible())
def test_cannot_upload_sjson_translation(self):
"""
Scenario: User cannot upload translations in sjson format