Exemplo n.º 1
0
    def setUpClass(cls):
        super(TestCaseSubmittable, cls).setUpClass()
        cls.data_utils = data_helpers.DataHelpers()
        cls.editor_pg = editor_page.EditorPage(cls)
        cls.modal = site_modals.SiteModals(cls)
        cls.video_pg = video_page.VideoPage(cls)
        cls.video_language_pg = video_language_page.VideoLanguagePage(cls)

        cls.user = UserFactory.create(username = '******')
        cls.sub_editor = subtitle_editor.SubtitleEditor(cls)
        td = {'video_url': ('http://qa.pculture.org/amara_tests/'
                     'Birds_short.mp4')
             }
        cls.test_video = VideoFactory(**td)
        cls.video_pg.open_video_page(cls.test_video.video_id)
        cls.video_pg.log_in(cls.user.username, 'password')
 
        #Open the video page and sync the first 3 subs
        cls.video_pg.add_subtitles()
        cls.modal.add_language('English', 'English')
        cls.editor_pg.legacy_editor()
        cls.logger.info('typing subs')
        cls.typed_subs = cls.sub_editor.type_subs()
        cls.sub_editor.continue_to_next_step()
        cls.logger.info('syncing subs')
        cls.sub_editor.sync_subs(len(cls.typed_subs)+2)
        cls.timing_list = cls.sub_editor.sub_timings()
        cls.sub_editor.save_and_exit()
Exemplo n.º 2
0
    def setUp(self):
        super(TestCaseIncomplete, self).setUp()
        self.data_utils = data_helpers.DataHelpers()
        self.video_pg = video_page.VideoPage(self)
        self.user = UserFactory.create(username = '******')
        self.sub_editor = subtitle_editor.SubtitleEditor(self)
        self.editor_pg = editor_page.EditorPage(self)
        self.modal = site_modals.SiteModals(self)
        td = {'url': ('http://qa.pculture.org/amara_tests/'
                   'Birds_short.webmsd.webm')
             }

        self.test_video = VideoFactory(**td)
        self.video_pg.open_video_page(self.test_video.video_id)
        self.video_pg.log_in(self.user.username, 'password')
        self.video_pg.set_skiphowto()
 
        #Open the video page and sync the first 3 subs
        self.video_pg.add_subtitles()

        self.modal.add_language('English', 'English')
        self.editor_pg.legacy_editor()
        self.logger.info('typing subs')
        self.typed_subs = self.sub_editor.type_subs()
        self.sub_editor.continue_to_next_step()
        
        self.logger.info('syncing subs')
        self.sub_editor.sync_subs(len(self.typed_subs)+2)
        self.timing_list = self.sub_editor.sub_timings()
        self.sub_editor.continue_to_next_step()
        self.logger.info('continue to description screen')
        self.sub_editor.continue_to_next_step()
        self.logger.info('continue to review screen')
        self.sub_editor.continue_to_next_step()
Exemplo n.º 3
0
 def setUpClass(cls):
     super(TestCaseEntryExit, cls).setUpClass()
     cls.sub_editor = subtitle_editor.SubtitleEditor(cls)
     cls.editor_pg = editor_page.EditorPage(cls)
     cls.video_pg = video_page.VideoPage(cls)
     cls.video_lang_pg = video_language_page.VideoLanguagePage(cls)
     cls.data_utils = data_helpers.DataHelpers()
     cls.user = UserFactory.create()
     cls.video_pg.open_page('auth/login/')
     cls.user = UserFactory.create()
     cls.video_pg.log_in(cls.user.username, 'password')
Exemplo n.º 4
0
    def test_upload__edit(self):
        """Subs uploaded via api are editable in the subtitle editor.

        """
        #Create the language for the test video
        create_url = ('videos/%s/languages/' % self.test_video.video_id)
        create_data = {'language_code': 'en', 'is_original': True}
        status, response = self.data_utils.post_api_request(
            self.user, create_url, create_data)

        #Upload the subtitles via api request
        upload_url = ('videos/%s/languages/en/subtitles/' %
                      self.test_video.video_id)
        sub_data = open(os.path.join(self.subs_data_dir, 'Untimed_text.srt'))
        upload_data = {'subtitles': sub_data.read(), 'sub_format': 'srt'}
        status, response = self.data_utils.post_api_request(
            self.user, upload_url, upload_data)
        self.video_language_pg.open_video_lang_page(self.test_video.video_id,
                                                    'en')
        #Open the language page for the video and click Edit Subtitles
        verification_file = os.path.join(self.subs_data_dir,
                                         'Untimed_lines.txt')
        expected_list = [
            line.strip()
            for line in codecs.open(verification_file, encoding='utf-8')
        ]
        self.video_language_pg.log_in(self.user.username, 'password')
        self.video_language_pg.set_skiphowto()
        self.video_language_pg.open_video_lang_page(self.test_video.video_id,
                                                    'en')
        self.video_language_pg.edit_subtitles()
        sub_editor = subtitle_editor.SubtitleEditor(self)
        editor_sub_list = sub_editor.subtitles_list()

        #Verify uploaded subs are displayed and editable
        self.assertLess(0, len(editor_sub_list))
        typed_subs = sub_editor.edit_subs()
        sub_editor.save_and_exit()
        self.video_language_pg.open_video_lang_page(self.test_video.video_id,
                                                    'en')
        displayed_list = self.video_language_pg.displayed_lines()

        #Verify the edited text is in the sub list
        self.assertIn("I'd like to be", displayed_list[0])

        #Verify the origal unedited text is still present in the sub list.
        self.assertEqual(expected_list[-1], displayed_list[-1])
Exemplo n.º 5
0
 def setUp(self):
     super(TestCaseTranscribing, self).setUp()
     self.data_utils = data_helpers.DataHelpers()
     self.modal = site_modals.SiteModals(self)
     self.editor_pg = editor_page.EditorPage(self)
     td = {
         'video_url': ('http://qa.pculture.org/amara_tests/'
                       'Birds_short.webmsd.webm')
     }
     self.test_video = self.data_utils.create_video(**td)
     self.video_pg = video_page.VideoPage(self)
     self.user = UserFactory.create()
     self.video_pg.open_video_page(self.test_video.video_id)
     self.video_pg.log_in(self.user.username, 'password')
     self.sub_editor = subtitle_editor.SubtitleEditor(self)
     self.video_pg.log_in(self.user.username, 'password')
     self.video_pg.add_subtitles()
     self.modal.add_language('English', 'English')
     self.editor_pg.legacy_editor()
     self.typed_subs = self.sub_editor.type_subs()
Exemplo n.º 6
0
    def setUpClass(cls):
        super(TestCasePartialSync, cls).setUpClass()
        cls.data_utils = data_helpers.DataHelpers()
        cls.user = UserFactory.create(username='******')
        cls.modal = site_modals.SiteModals(cls)
        cls.editor_pg = editor_page.EditorPage(cls)
        cls.sub_editor = subtitle_editor.SubtitleEditor(cls)
        cls.video_pg = video_page.VideoPage(cls)
        cls.video_language_pg = video_language_page.VideoLanguagePage(cls)

        td = {'video_url': ('http://www.youtube.com/watch?v=WqJineyEszo')}
        cls.test_video = VideoFactory(**td)
        cls.video_pg.open_video_page(cls.test_video.video_id)
        cls.video_pg.log_in(cls.user.username, 'password')
        cls.video_pg.set_skiphowto()
        #Open the video page and sync the first 3 subs
        cls.video_pg.add_subtitles()
        cls.modal.add_language('English', 'English')
        cls.editor_pg.legacy_editor()
        cls.typed_subs = cls.sub_editor.type_subs()
        cls.sub_editor.save_and_exit()