'Scenario: User can see Abkhazian (ab) language option at the first position
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     |
|table    |chinese_transcripts.srt|
And I save changes
Then when I view the video it does show the captions
And I see "å¥œ åäœåå­Š" text in the captions
And video language menu has "table, uk" translations
And I see video language with code "table" at position "0"'

def test_table_of_contents(self):

    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', 'ab')
    self.save_unit_settings()
    self.assertTrue(self.video.is_captions_visible())
    unicode_text = '\xe5\xa5\xbd    \xe5\x90\x84\xe4\xbd\x8d\xe5\x90\x8c\xe5\xad\xa6'.decode('utf-8')
    self.assertIn(unicode_text, self.video.captions_text)
    self.assertEqual(self.video.caption_languages.keys(), [u'ab', u'uk'])
    self.assertEqual(self.video.caption_languages.keys()[0], 'ab')
