Exemple #1
0
    def setUpClass(cls):
        super(TestCaseSubmittable, cls).setUpClass()
        cls.data_utils = data_helpers.DataHelpers()

        cls.video_pg = video_page.VideoPage(cls)
        cls.video_language_pg = video_language_page.VideoLanguagePage(cls)

        cls.user = UserFactory.create(username='******')
        cls.create_modal = dialogs.CreateLanguageSelection(cls)
        cls.sub_editor = subtitle_editor.SubtitleEditor(cls)
        cls.unisubs_menu = unisubs_menu.UnisubsMenu(cls)
        td = {'url': ('http://qa.pculture.org/amara_tests/' 'Birds_short.mp4')}
        cls.test_video = cls.data_utils.create_video(**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.create_modal.create_original_subs('English', 'English')

        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()
Exemple #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.create_modal = dialogs.CreateLanguageSelection(self)
        self.sub_editor = subtitle_editor.SubtitleEditor(self)
        self.unisubs_menu = unisubs_menu.UnisubsMenu(self)
        td = {
            'url': ('http://qa.pculture.org/amara_tests/'
                    'Birds_short.webmsd.webm')
        }

        self.test_video = self.data_utils.create_video(**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.create_modal.create_original_subs('English', 'English')

        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()
    def setUpClass(cls):
        super(TestCaseSubtitles, cls).setUpClass()
        cls.data_utils = data_helpers.DataHelpers()
        cls.menu = unisubs_menu.UnisubsMenu(cls)

        cls.user = UserFactory.create()
        cls.video_pg = video_page.VideoPage(cls)
        cls.video_language_pg = video_language_page.VideoLanguagePage(cls)
        cls.subs_data_dir = os.path.join(os.getcwd(), 'apps',
                                         'webdriver_testing', 'subtitle_data')
    def setUpClass(cls):
        super(TestCaseEntryExit, cls).setUpClass()
        fixt_data = [
            'apps/webdriver_testing/fixtures/editor_auth.json',
            'apps/webdriver_testing/fixtures/editor_videos.json',
            'apps/webdriver_testing/fixtures/editor_subtitles.json'
        ]
        for f in fixt_data:
            management.call_command('loaddata', f, verbosity=0)
        cls.logger.info("""Default Test Data - loaded from fixtures

                        English, source primary v2 -> v6
                                 v1 -> deleted

                        Chinese v1 -> v3
                                v3 {"zh-cn": 2, "en": 6}

                        Danish v1 --> v4
                               v4 {"en": 5, "da": 3}
                               
                        Swedish v1 --> v3 FORKED
                                v3 {"sv": 2}
                                v1 --> private

                        Turkish (tr) v1 incomplete {"en": 5}
                       """)

        cls.create_modal = dialogs.CreateLanguageSelection(cls)
        cls.sub_editor = subtitle_editor.SubtitleEditor(cls)
        cls.unisubs_menu = unisubs_menu.UnisubsMenu(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.tasks_tab = TasksTab(cls)

        cls.user = UserFactory.create()
        cls.video_pg.open_page('auth/login/')
        cls.video_pg.log_in(cls.user.username, 'password')

        #Create a workflow enabled team to check review/approve dialog switching.
        cls.team = TeamMemberFactory.create(
            team__workflow_enabled=True,
            team__translate_policy=20,  #any team
            team__subtitle_policy=20,  #any team
            team__task_assign_policy=10,  #any team
            user=cls.user,
        ).team
        cls.workflow = WorkflowFactory(
            team=cls.team,
            autocreate_subtitle=True,
            autocreate_translate=True,
            approve_allowed=10,  # manager
            review_allowed=10,  # peer
        )
        cls.user = UserFactory.create()
    def setUpClass(cls):
        super(TestCaseViewSubtitles, cls).setUpClass()
        cls.data_utils = data_helpers.DataHelpers()
        cls.menu = unisubs_menu.UnisubsMenu(cls)

        cls.user = UserFactory.create()
        cls.video_pg = video_page.VideoPage(cls)
        cls.video_language_pg = video_language_page.VideoLanguagePage(cls)
        cls.subs_dir = os.path.join(os.getcwd(), 'apps', 'webdriver_testing',
                                    'subtitle_data')
        cls.video = VideoUrlFactory().video

        #Upload original language de
        complete = True
        data = {
            'language_code': 'de',
            'video': cls.video.pk,
            'primary_audio_language_code': 'de',
            'draft': open(os.path.join(cls.subs_dir, 'Timed_text.en.srt')),
            'is_complete': complete,
            'complete': int(complete)
        }
        user_auth = dict(username=cls.user.username, password='******')
        cls.data_utils.upload_subs(cls.video, data, user_auth)
        #Upload sv, translated from de, complete
        data = {
            'language_code': 'sv',
            'video': cls.video.pk,
            'translated_from': 'de',
            'draft': open(os.path.join(cls.subs_dir, 'Timed_text.sv.dfxp')),
            'is_complete': complete,
            'complete': int(complete)
        }
        cls.data_utils.upload_subs(cls.video, data, user_auth)
        complete = False
        #Upload ar, translated from de, incomplete
        data = {
            'language_code': 'ar',
            'video': cls.video.pk,
            'draft': open(os.path.join(cls.subs_dir, 'Timed_text.ar.xml')),
            'is_complete': complete,
            'complete': int(complete)
        }
        cls.data_utils.upload_subs(cls.video, data, user_auth)
        #Upload hu, translated from sv, incomplete
        data = {
            'language_code': 'hu',
            'video': cls.video.pk,
            'translated_from': 'sv',
            'draft': open(os.path.join(cls.subs_dir, 'Timed_text.hu.ssa')),
            'is_complete': complete,
            'complete': int(complete)
        }
        cls.data_utils.upload_subs(cls.video, data, user_auth)
        cls.video_pg.open_video_page(cls.video.video_id)
    def setUpClass(cls):
        super(TestCaseDraftVideos, cls).setUpClass()
        cls.data_utils = data_helpers.DataHelpers()
        cls.video_pg = video_page.VideoPage(cls)
        cls.video_lang_pg = video_language_page.VideoLanguagePage(cls)
        cls.menu = unisubs_menu.UnisubsMenu(cls)
        cls.create_modal = dialogs.CreateLanguageSelection(cls)

        cls.user = UserFactory(username='******', is_partner=True)
        cls.data_utils.create_user_api_key(cls.user)
        #Add a team with workflows, tasks and preferred languages
        cls.logger.info('setup: Create a team with tasks enabled')
        cls.team = TeamMemberFactory.create(
            team__workflow_enabled=True,
            team__subtitle_policy=20,
            team__translate_policy=20,
            user=cls.user,
        ).team
        cls.team_workflow = WorkflowFactory(
            team=cls.team,
            autocreate_subtitle=True,
            autocreate_translate=True,
            approve_allowed=10,
            review_allowed=10,
        )
        cls.member = TeamContributorMemberFactory.create(
            team=cls.team, user=UserFactory(username='******')).user
        cls.nonmember = UserFactory()

        #Add video to team with draft subtitles
        cls.logger.info('Setup: Add video to team with draft subs.')
        cls.draft = TeamVideoFactory.create(
            team=cls.team,
            video=cls.data_utils.create_video(),
            added_by=cls.user).video
        cls.data_utils.upload_subs(cls.draft,
                                   data=None,
                                   user=dict(username=cls.user.username,
                                             password='******'))

        cls.video_pg.open_video_page(cls.draft.video_id)
        cls.video_pg.set_skiphowto()
Exemple #7
0
 def setUp(self):
     super(TestCaseTranscribing, self).setUp()
     self.data_utils = data_helpers.DataHelpers()
     td = {
         '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.video_pg.set_skiphowto()
     self.create_modal = dialogs.CreateLanguageSelection(self)
     self.sub_editor = subtitle_editor.SubtitleEditor(self)
     self.unisubs_menu = unisubs_menu.UnisubsMenu(self)
     self.video_pg.log_in(self.user.username, 'password')
     self.video_pg.add_subtitles()
     self.create_modal.create_original_subs('English', 'English')
     self.typed_subs = self.sub_editor.type_subs()
    def setUp(self):
        super(TestCaseSyncBrowserError, self).setUp()
        self.data_utils = data_helpers.DataHelpers()
        self.user = UserFactory.create(username='******')
        self.create_modal = dialogs.CreateLanguageSelection(self)
        self.sub_editor = subtitle_editor.SubtitleEditor(self)
        self.unisubs_menu = unisubs_menu.UnisubsMenu(self)
        self.video_pg = video_page.VideoPage(self)
        self.video_language_pg = video_language_page.VideoLanguagePage(self)

        td = {'url': ('http://qa.pculture.org/amara_tests/' 'Birds_short.mp4')}
        self.test_video = self.data_utils.create_video(**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.create_modal.create_original_subs('English', 'English')
        self.typed_subs = self.sub_editor.type_subs()
        self.sub_editor.continue_to_next_step()
        num_synced_subs = 3
        self.sub_editor.sync_subs(num_synced_subs)