'Scenario: Translations uploading works correctly
Given I have created a Video component
And I edit the component
And I open tab "Advanced"
And I upload transcript file "simplified_chinese.srt" for "zh_HANS" language code
And I save changes
Then when I view the video it does show the captions
And I see "åšçº¿å­Šä¹ æ¯é©" text in the captions
And I edit the component
And I open tab "Advanced"
And I upload transcript file "traditional_chinese.srt" for "zh_HANT" language code
And I save changes
Then when I view the video it does show the captions
And I see "åšç·å­žç¿æ¯é©" text in the captions
And video subtitle menu has \'zh_HANS\', \'zh_HANT\' translations for \'Simplified Chinese\'
and \'Traditional Chinese\' respectively'

def test_simplified_and_traditional_chinese_transcripts_uploading(self):

    self._create_video_component()
    langs_info = [('zh_HANS', 'simplified_chinese.srt', '\xe5\x9c\xa8\xe7\xba\xbf\xe5\xad\xa6\xe4\xb9\xa0\xe6\x98\xaf\xe9\x9d\xa9'), ('zh_HANT', 'traditional_chinese.srt', '\xe5\x9c\xa8\xe7\xb7\x9a\xe5\xad\xb8\xe7\xbf\x92\xe6\x98\xaf\xe9\x9d\xa9')]
    for (lang_code, lang_file, lang_text) in langs_info:
        self.edit_component()
        self.open_advanced_tab()
        self.video.upload_translation(lang_file, lang_code)
        self.save_unit_settings()
        self.assertTrue(self.video.is_captions_visible())
        if (lang_code == 'zh_HANT'):
            self.video.select_language(lang_code)
        unicode_text = lang_text.decode('utf-8')
        self.assertIn(unicode_text, self.video.captions_text)
    self.assertEqual(self.video.caption_languages, {'zh_HANS': 'Simplified    Chinese', 'zh_HANT': 'Traditional    Chinese'})
