Пример #1
0
    def setUpClass(cls):
        super(TestCaseTools, cls).setUpClass()
        cls.modal = site_modals.SiteModals(cls)
        cls.user = UserFactory.create()
        data = {
            'url': 'http://www.youtube.com/watch?v=5CKwCfLUwj4',
            'video__title': 'Open Source Philosophy',
            'video__primary_audio_language_code': 'en',
            'type': 'Y'
        }

        cls.data_utils = data_helpers.DataHelpers()
        cls.video = cls.data_utils.create_video(**data)
        subs_data = {
            'language_code': 'en',
            'complete': True,
            'visibility': 'public'
        }

        cls.data_utils.add_subs(video=cls.video, **subs_data)
        management.call_command('update_index', interactive=False)
        cls.editor_pg = editor_page.EditorPage(cls)
        cls.data_utils = data_helpers.DataHelpers()
        cls.video_pg = video_page.VideoPage(cls)
        cls.video_pg.open_page('auth/login/', alert_check=True)
        cls.video_pg.log_in(cls.user.username, 'password')
Пример #2
0
    def setUpClass(cls):
        super(TestCaseProjectsAddEdit, cls).setUpClass()
        cls.data_utils = data_helpers.DataHelpers()
        cls.videos_tab = videos_tab.VideosTab(cls)
        cls.admin = UserFactory()
        cls.manager = UserFactory()
        cls.member = UserFactory()
        cls.team = TeamFactory(admin=cls.admin,
                               manager=cls.manager,
                               member=cls.member)

        cls.project1 = ProjectFactory(team=cls.team)
        cls.project2 = ProjectFactory(team=cls.team)

        cls.project1_page = ('teams/{0}/videos/?project={1}'.format(
            cls.team.slug, cls.project1.slug))
        cls.project2_page = ('teams/{0}/videos/?project={1}'.format(
            cls.team.slug, cls.project2.slug))
        test_videos = [
            'jaws.mp4', 'Birds_short.oggtheora.ogg', 'fireplace.mp4'
        ]
        cls.videos_list = []
        for vid in test_videos:
            video_url = 'http://qa.pculture.org/amara_tests/%s' % vid[0]
            tv = VideoFactory(video_url=video_url, title=vid)
            TeamVideoFactory(video=tv, team=cls.team, project=cls.project2)
            cls.videos_list.append(tv)
        management.call_command('update_index', interactive=False)
        cls.videos_tab.open_videos_tab(cls.team)
        cls.videos_tab.log_in(cls.admin.username, 'password')
Пример #3
0
    def setUpClass(cls):
        super(TestCaseFilterSort, cls).setUpClass()

        cls.data_utils = data_helpers.DataHelpers()
        cls.videos_tab = videos_tab.VideosTab(cls)

        cls.admin = UserFactory()
        cls.manager = UserFactory()
        cls.member = UserFactory()
        cls.team = TeamFactory(admin=cls.admin,
                               manager=cls.manager,
                               member=cls.member)

        cls.video = TeamVideoFactory(team=cls.team).video
        data = {
            'language_code':
            'en',
            'video':
            cls.video,
            'subtitles': ('apps/webdriver_testing/subtitle_data/'
                          'Open Source Philosophy.en.dfxp'),
            'action':
            'publish',
        }
        cls.data_utils.add_subs(**data)
        management.call_command('update_index', interactive=False)
Пример #4
0
    def setUpClass(cls):
        super(TestCaseLeftSide, 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.editor_pg = editor_page.EditorPage(cls)
        cls.data_utils = data_helpers.DataHelpers()
        cls.video_pg = video_page.VideoPage(cls)
        cls.user = UserFactory.create()
        cls.video_pg.open_page('auth/login/', alert_check=True)
        cls.video_pg.log_in(cls.user.username, 'password')
Пример #5
0
    def setUpClass(cls):
        super(TestCaseTeamTaskResource, cls).setUpClass()
        cls.data_utils = data_helpers.DataHelpers()
        cls.user = UserFactory.create(username='******', is_partner=True)

        cls.team = cls.create_workflow_team()
        cls.team2 = cls.create_workflow_team()

        langs = ['ru', 'pt-br', 'de']
        for lc in langs:
            cls.test_video, tv = cls.create_tv_with_original_subs(
                'en', cls.user, cls.team)
            cls.data_utils.complete_review_task(tv, 20, cls.user)
            cls.data_utils.complete_approve_task(tv, 20, cls.user)
            cls.add_translation(lc, cls.test_video, cls.user, complete=True)
            cls.data_utils.complete_review_task(tv, 20, cls.user)
            cls.data_utils.complete_approve_task(tv, 20, cls.user)

        cls.inc_vid, tv = cls.create_tv_with_original_subs(
            'fr', cls.user, cls.team)
        cls.data_utils.complete_review_task(tv, 20, cls.user)
        cls.data_utils.complete_approve_task(tv, 20, cls.user)
        cls.test_video2, tv = cls.create_tv_with_original_subs(
            'en', cls.user, cls.team2)
        cls.data_utils.complete_review_task(tv, 20, cls.user)
        cls.data_utils.complete_approve_task(tv, 20, cls.user)
Пример #6
0
    def setUpClass(cls):
        super(TestCaseBulkApprove, cls).setUpClass()
        cls.data_utils = data_helpers.DataHelpers()
        cls.tasks_tab = TasksTab(cls)
        #Create a partner user to own the team.
        cls.admin = UserFactory()
        cls.manager = UserFactory()
        cls.contributor = UserFactory()
        #CREATE AN OPEN TEAM WITH WORKFLOWS and AUTOTASKS
        cls.team = TeamFactory(
            member=cls.contributor,
            manager=cls.manager,
            admin=cls.admin,
            workflow_enabled=True,
        )

        cls.workflow = WorkflowFactory(team=cls.team,
                                       autocreate_subtitle=True,
                                       autocreate_translate=True,
                                       review_allowed=10,
                                       approve_allowed=10)
        lang_list = ['en', 'ru', 'pt-br', 'de', 'sv', 'fr', 'it']
        for language in lang_list:
            TeamLangPrefFactory.create(team=cls.team,
                                       language_code=language,
                                       preferred=True)
Пример #7
0
    def setUpClass(cls):
        super(TestCaseProjectsAddEdit, cls).setUpClass()
        management.call_command('flush', interactive=False)
        cls.data_utils = data_helpers.DataHelpers()
        cls.videos_tab = videos_tab.VideosTab(cls)
        cls.team_owner = UserFactory.create()
        cls.logger.info('setup: Creating team Video Test')
        cls.team = TeamMemberFactory.create(user=cls.team_owner).team

        cls.logger.info('setup: Adding a team with 2 projects.')
        cls.project1 = TeamProjectFactory.create(team=cls.team)
        cls.project2 = TeamProjectFactory.create(team=cls.team)

        test_videos = [
            'jaws.mp4', 'Birds_short.oggtheora.ogg', 'fireplace.mp4'
        ]
        cls.videos_list = []
        for vid in test_videos:
            video_url = 'http://qa.pculture.org/amara_tests/%s' % vid[0]
            tv = VideoUrlFactory(url=video_url, video__title=vid).video
            v = TeamVideoFactory(video=tv,
                                 team=cls.team,
                                 added_by=cls.team_owner,
                                 project=cls.project2).video
            cls.videos_list.append(v)
        management.call_command('update_index', interactive=False)

        cls.videos_tab.open_videos_tab(cls.team.slug)
        cls.videos_tab.log_in(cls.team_owner.username, 'password')

        cls.project1_page = ('teams/{0}/videos/?project={1}'.format(
            cls.team.slug, cls.project1.slug))
        cls.project2_page = ('teams/{0}/videos/?project={1}'.format(
            cls.team.slug, cls.project2.slug))
Пример #8
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()
    def setUpClass(cls):
        super(TestCaseTeamProjectResource, cls).setUpClass()
        cls.data_utils = data_helpers.DataHelpers()

        cls.user = UserFactory.create(username='******', is_partner=True)
        cls.team_owner = UserFactory.create(username='******')

        #create an open team with description text and 2 members
        cls.open_team = TeamMemberFactory.create(
            team__name="Cool team",
            team__slug='team-with-projects',
            team__description='this is the coolest, most creative team ever',
            user=cls.team_owner,
        ).team
        TeamMemberFactory(team=cls.open_team, role='ROLE_ADMIN', user=cls.user)
        #Open to the teams page so you can see what's there.
        cls.project1 = TeamProjectFactory(
            team=cls.open_team,
            name='team project one',
            slug='team-project-one',
            description='subtitle project number 1',
            guidelines='do a good job',
            workflow_enabled=False)

        cls.project2 = TeamProjectFactory(team=cls.open_team,
                                          name='team project two',
                                          workflow_enabled=True)

        cls.team_pg = ATeamPage(cls)
        cls.team_pg.open_team_page(cls.open_team.slug)
Пример #10
0
    def setUpClass(cls):
        super(TestCaseTeamMessages, cls).setUpClass()
        cls.data_utils = data_helpers.DataHelpers()
        cls.a_team_pg = ATeamPage(cls)
        cls.members_tab = members_tab.MembersTab(cls)
        cls.messages_tab = messages_tab.MessagesTab(cls)
        cls.user_message_pg = user_messages_page.UserMessagesPage(cls)
        cls.non_member = UserFactory.create(username='******')
        cls.team_owner = UserFactory.create(is_partner = True)

        #CREATE AN APPLICATION-ONLY TEAM 
        cls.team = TeamMemberFactory.create(
            team__membership_policy = 1,
            user = cls.team_owner,
            ).team

        cls.team_member = TeamMemberFactory.create(role="ROLE_CONTRIBUTOR",
                                           user=UserFactory(),
                                           team=cls.team).user

        #ADD THE TEST MESSAGES TO THE TEST TEAM
        cls.members_tab.open_members_page(cls.team.slug)
        cls.members_tab.log_in(cls.team_owner.username, 'password')
        cls.messages_tab.open_messages_tab(cls.team.slug)
        cls.messages_tab.edit_messages(cls._TEST_MESSAGES)
Пример #11
0
 def setUpClass(cls):
     super(TestCaseDownloadSubs, cls).setUpClass()
     cls.data_utils = data_helpers.DataHelpers()
     cls.user = UserFactory.create()
     cls.video_language_pg = video_language_page.VideoLanguagePage(cls)
     cls.subs_data_dir = os.path.join(os.getcwd(), 'apps',
                                      'webdriver_testing', 'subtitle_data')
Пример #12
0
    def setUpClass(cls):
        super(TestCasePublishedVideos, 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.create_modal = dialogs.CreateLanguageSelection(cls)
        cls.user = UserFactory(is_partner=True)
        
        #Add a team with workflows, tasks and preferred languages
        cls.logger.info('setup: Create a team with tasks enabled')
        cls.admin = UserFactory()
        cls.manager = UserFactory()
        cls.member = UserFactory()
        cls.team = TeamFactory(admin=cls.admin,
                               manager=cls.manager,
                               member=cls.member,
                               workflow_enabled=True,
                               translate_policy=20,
                               subtitle_policy=20,
                              )
        cls.team_workflow = WorkflowFactory(team = cls.team,
                                            autocreate_subtitle=True,
                                            autocreate_translate=True,
                                            approve_allowed = 10,
                                            review_allowed = 10,
                                           )
        cls.nonmember = UserFactory()

        #Add video to team with published subtitles
        cls.logger.info('Setup: Add video to team with published subs.')
        cls.published = VideoFactory()
        pipeline.add_subtitles(cls.published, 'en', SubtitleSetFactory(),
                               action='publish')
        TeamVideoFactory(team=cls.team, video=cls.published)
        cls.video_pg.open_video_page(cls.published.video_id)
Пример #13
0
    def setUpClass(cls):
        super(TestCaseTools, cls).setUpClass()
        cls.modal = site_modals.SiteModals(cls)
        cls.data_utils = data_helpers.DataHelpers()
        cls.editor_pg = editor_page.EditorPage(cls)
        cls.video_pg = video_page.VideoPage(cls)
        cls.user = UserFactory()
        cls.video_pg.open_page('auth/login/')
        cls.video_pg.log_in(cls.user.username, 'password')
        cls.video = VideoFactory(
            video_url='http://www.youtube.com/watch?v=5CKwCfLUwj4',
            title='Open Source Philosophy',
            #primary_audio_language_code='en'
        )
        cls.data_utils.add_subs(video=cls.video)
        langs = ['en', 'da', 'nl']

        for lc in langs:
            defaults = {
                'video':
                cls.video,
                'language_code':
                lc,
                'complete':
                True,
                'visibility':
                'public',
                'committer':
                cls.user,
                'subtitles': ('apps/webdriver_testing/subtitle_data/'
                              'Open Source Philosophy.%s.dfxp' % lc)
            }
            cls.data_utils.add_subs(**defaults)
        management.call_command('update_index', interactive=False)
Пример #14
0
 def setUpClass(cls):
     super(TestCaseDemandReports, cls).setUpClass()
     cls.data_utils = data_helpers.DataHelpers()
     cls.billing_pg = billing_page.BillingPage(cls)
     cls.editor_pg = editor_page.EditorPage(cls)
     cls.editor_pg.open_page("/")
     cls.admin = UserFactory()
     cls.manager = UserFactory()
     cls.terri = UserFactory.create(username='******',
                                    is_staff=True,
                                    is_superuser=True)
     langs = ['ru', 'pt-br', 'de']
     cls.team, cls.member, cls.member2 = cls.create_workflow_team()
     for lc in langs:
         video = TeamVideoFactory(
             team=cls.team, video__primary_audio_language_code='en').video
         #Add subtitles and approve tasks
         cls.add_subtitles('en', video, cls.member, complete=True)
         cls._post(cls.manager, video,
                   'en')  #post approve to actions endpoint
         cls._post(cls.admin, video,
                   'en')  #post approve to actions endpoint
         cls.add_subtitles(lc, video, cls.member, complete=True)
         cls._post(cls.manager, video,
                   lc)  #post approve to actions endpoint
         cls._post(cls.admin, video, lc)  #post approve to actions endpoint
Пример #15
0
    def setUpClass(cls):
        super(TestCaseVideoResource, cls).setUpClass()
        cls.user = UserFactory.create(username='******')
        cls.data_utils = data_helpers.DataHelpers()

        cls.test_video = cls.data_utils.create_video()
        cls.open_team = TeamMemberFactory.create(
            team__name="Cool team",
            team__slug='team-with-projects',
            team__description='this is the coolest, most creative team ever',
            user=cls.user,
        ).team
        cls.project1 = TeamProjectFactory(
            team=cls.open_team,
            name='team project one',
            slug='team-project-one',
            description='subtitle project number 1',
            guidelines='do a good job',
            workflow_enabled=False)

        cls.project2 = TeamProjectFactory(team=cls.open_team,
                                          name='team project two',
                                          workflow_enabled=True)
        cls.video_pg = video_page.VideoPage(cls)
        cls.watch_pg = watch_page.WatchPage(cls)
Пример #16
0
    def setUpClass(cls):
        super(TestCaseModeratedVideoTitles, cls).setUpClass()
        cls.data_utils = data_helpers.DataHelpers()
        cls.admin_video_pg = edit_video_page.EditVideoPage(cls)
        cls.tasks_tab = TasksTab(cls)
        cls.videos_tab = VideosTab(cls)
        cls.video_pg = video_page.VideoPage(cls)

        cls.modal = site_modals.SiteModals(cls)
        cls.editor_pg = editor_page.EditorPage(cls)
        cls.video_lang_pg = video_language_page.VideoLanguagePage(cls)

        cls.staff = UserFactory(is_staff=True, is_superuser=True)
        cls.admin = UserFactory()
        cls.manager = UserFactory()
        cls.member = UserFactory()
        cls.team = TeamFactory(admin=cls.admin,
                               manager=cls.manager,
                               member=cls.member,
                               workflow_type='O',
                               workflow_enabled=True
                              )

        cls.workflow = WorkflowFactory(
            team = cls.team,
            autocreate_subtitle = True,
            autocreate_translate = False,
            review_allowed = 10,
            approve_allowed = 20)
        #Create a member of the team
        cls.subs_file = os.path.join(os.getcwd(), 'apps','webdriver_testing',
                                    'subtitle_data', 'basic_subs.dfxp')
Пример #17
0
    def setUpClass(cls):
        super(TestCaseTasksEnabledDashboard, cls).setUpClass()
        cls.data_utils = data_helpers.DataHelpers()
        cls.editor_pg = editor_page.EditorPage(cls)
        cls.modal = site_modals.SiteModals(cls)
        cls.dashboard_tab = dashboard_tab.DashboardTab(cls)
        cls.tasks_tab = tasks_tab.TasksTab(cls)

        cls.admin = UserFactory()
        cls.manager = UserFactory()
        cls.member = UserFactory()
        cls.team = TeamFactory(admin=cls.admin,
                               manager=cls.manager,
                               member=cls.member,
                               workflow_enabled=True)
        cls.team_workflow = WorkflowFactory(team=cls.team,
                                            autocreate_subtitle=True,
                                            autocreate_translate=True,
                                            review_allowed=10)

        langs = ['en', 'ru', 'pt-br', 'fr', 'de', 'es']
        for lc in langs:
            TeamLangPrefFactory(team=cls.team,
                                language_code=lc,
                                preferred=True)

        cls.en_video = VideoFactory(primary_audio_language_code='en')
        TeamVideoFactory(team=cls.team, video=cls.en_video)
        cls.video = TeamVideoFactory(team=cls.team).video
        cls.polly_glott = TeamMemberFactory(team=cls.team, ).user

        polly_speaks = ['en', 'cs', 'ru', 'ar']
        for lang in polly_speaks:
            UserLangFactory(user=cls.polly_glott, language=lang)
Пример #18
0
 def setUpClass(cls):
     super(TestCaseWatchPageSearch, cls).setUpClass()
     management.call_command('update_index', interactive=False)
     cls.watch_pg = watch_page.WatchPage(cls)
     cls.data = data_helpers.DataHelpers()
     video = YouTubeVideoFactory(
         video_url='http://www.youtube.com/watch?v=WqJineyEszo',
         title=('X Factor Audition - Stop Looking At My '
                'Mom Rap - Brian Bradley'),
         primary_audio_language_code='en')
     data = {
         'language_code':
         'en',
         'subtitles': ('apps/webdriver_testing/subtitle_data/'
                       'Timed_text.en.srt'),
         'complete':
         True,
         'video':
         video
     }
     cls.data.add_subs(**data)
     cls.user = UserFactory()
     cls.data.create_videos_with_subs()
     VideoFactory.create(title=u'不过这四个问题')
     video = VideoFactory.create(title="my test vid")
     data = {
         'language_code':
         'zh-cn',
         'subtitles': ('apps/webdriver_testing/subtitle_data/'
                       'Timed_text.zh-cn.sbv'),
         'complete':
         True
     }
     test_video = cls.data.create_video_with_subs(cls.user, **data)
     management.call_command('update_index', interactive=False)
Пример #19
0
    def setUpClass(cls):
        super(TestCaseTeamMessages, cls).setUpClass()
        cls.data_utils = data_helpers.DataHelpers()
        cls.a_team_pg = ATeamPage(cls)
        cls.members_tab = members_tab.MembersTab(cls)
        cls.messages_tab = messages_tab.MessagesTab(cls)
        cls.modal = site_modals.SiteModals(cls)
        cls.user_message_pg = user_messages_page.UserMessagesPage(cls)
        cls.non_member = UserFactory()
        cls.admin = UserFactory()
        cls.manager = UserFactory()
        cls.member = UserFactory()

        cls.team = TeamFactory(admin=cls.admin,
                               manager=cls.manager,
                               member=cls.member,
                               )
        cls.team.membership_policy = 1
        cls.team.save()

        #ADD THE TEST MESSAGES TO THE TEST TEAM
        cls.members_tab.open_members_page(cls.team.slug)
        cls.members_tab.log_in(cls.admin.username, 'password')
        cls.messages_tab.open_messages_tab(cls.team.slug)
        cls.messages_tab.edit_messages(cls._TEST_MESSAGES)
Пример #20
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()
Пример #21
0
    def setUpClass(cls):
        super(TestCaseProjectsFilter, cls).setUpClass()
        management.call_command('flush', interactive=False)
        cls.data_utils = data_helpers.DataHelpers()
        cls.videos_tab = videos_tab.VideosTab(cls)
        cls.team_owner = UserFactory.create()
        cls.logger.info('setup: Creating team Video Test')
        cls.team = TeamMemberFactory.create(user=cls.team_owner).team

        cls.manager_user = TeamMemberFactory(role="ROLE_ADMIN",
                                             team=cls.team,
                                             user=UserFactory()).user

        cls.logger.info('setup: Adding project one and project two with '
                        'workflows enabled')
        cls.project1 = TeamProjectFactory.create(
            team=cls.team,
            workflow_enabled=True,
        )

        cls.project2 = TeamProjectFactory.create(team=cls.team,
                                                 workflow_enabled=True)

        data = json.load(open('apps/videos/fixtures/teams-list.json'))
        videos = _create_videos(data, [])
        for video in videos:
            TeamVideoFactory.create(team=cls.team,
                                    video=video,
                                    added_by=cls.manager_user,
                                    project=cls.project2)
        management.call_command('update_index', interactive=False)
        cls.videos_tab.open_videos_tab(cls.team.slug)
        cls.videos_tab.log_in(cls.manager_user.username, 'password')
Пример #22
0
    def setUpClass(cls):
        super(TestCaseFilterSort, cls).setUpClass()
        #management.call_command('flush', interactive=False)

        cls.data_utils = data_helpers.DataHelpers()
        cls.logger.info("Create team 'video-test' and add 1 video")

        cls.team_owner = UserFactory.create(is_partner=True)
        cls.team = TeamMemberFactory.create(user=cls.team_owner).team
        cls.manager_user = TeamMemberFactory(role="ROLE_ADMIN",
                                             team=cls.team,
                                             user=UserFactory()).user
        cls.videos_tab = videos_tab.VideosTab(cls)
        vidurl_data = {
            'url': 'http://www.youtube.com/watch?v=WqJineyEszo',
            'video__title': 'X Factor Audition - Stop Looking At My Mom Rap',
            'type': 'Y'
        }
        cls.test_video = cls.data_utils.create_video(**vidurl_data)
        cls.data_utils.add_subs(video=cls.test_video)
        TeamVideoFactory.create(team=cls.team,
                                video=cls.test_video,
                                added_by=cls.manager_user)

        videos = cls.data_utils.create_several_team_videos_with_subs(
            cls.team, cls.manager_user)
        management.call_command('update_index', interactive=False)
Пример #23
0
    def setUpClass(cls):
        super(TestCaseAddRemoveEdit, cls).setUpClass()

        cls.data_utils = data_helpers.DataHelpers()
        cls.logger.info("Create team and add 1 video")

        cls.team_owner = UserFactory.create()
        cls.team = TeamMemberFactory.create(user=cls.team_owner).team

        cls.manager_user = TeamMemberFactory(
            role="ROLE_ADMIN",
            team=cls.team,
            user=UserFactory(username='******')).user
        cls.videos_tab = videos_tab.VideosTab(cls)
        data = {
            'url':
            'http://www.youtube.com/watch?v=WqJineyEszo',
            'video__title': ('X Factor Audition - Stop Looking At My '
                             'Mom Rap - Brian Bradley'),
            'type':
            'Y'
        }
        cls.test_video = cls.data_utils.create_video(**data)
        cls.data_utils.add_subs(video=cls.test_video)
        TeamVideoFactory.create(team=cls.team,
                                video=cls.test_video,
                                added_by=cls.manager_user)
        management.call_command('update_index', interactive=False)
        cls.videos_tab.open_videos_tab(cls.team.slug)
Пример #24
0
    def setUpClass(cls):
        super(TestCaseTaskFreeDashboard, cls).setUpClass()

        cls.data_utils = data_helpers.DataHelpers()
        cls.dashboard_tab = dashboard_tab.DashboardTab(cls)
        cls.admin = UserFactory()
        cls.manager = UserFactory()
        cls.member = UserFactory()
        cls.team = TeamFactory(admin=cls.admin,
                               manager=cls.manager,
                               member=cls.member)

        cls.en_video = VideoFactory(primary_audio_language_code='en')
        TeamVideoFactory(team=cls.team, video=cls.en_video)
        cls.fr_video = VideoFactory(primary_audio_language_code='fr')
        TeamVideoFactory(team=cls.team, video=cls.fr_video)
        cls.video = TeamVideoFactory(team=cls.team).video
        pipeline.add_subtitles(cls.en_video,
                               'en',
                               SubtitleSetFactory(),
                               complete=True)
        pipeline.add_subtitles(cls.fr_video,
                               'fr',
                               SubtitleSetFactory(),
                               complete=True)
        cls.polly_glott = TeamMemberFactory(team=cls.team, ).user

        polly_speaks = ['en', 'cs', 'ru', 'ar']
        for lang in polly_speaks:
            UserLangFactory(user=cls.polly_glott, language=lang)
Пример #25
0
    def setUpClass(cls):
        super(TestCaseEditing, cls).setUpClass()

        cls.editor_pg = editor_page.EditorPage(cls)
        cls.data_utils = data_helpers.DataHelpers()
        cls.video_pg = video_page.VideoPage(cls)
        cls.user = UserFactory.create()
        cls.video_pg.open_page('auth/login/')
        cls.video_pg.log_in(cls.user.username, 'password')
        data = {
            'video_url': 'http://www.youtube.com/watch?v=5CKwCfLUwj4',
            'title': 'Open Source Philosophy'
        }
        url_part = 'videos/'
        r = cls.data_utils.make_request(cls.user, 'post', url_part, **data)
        cls.video, _ = Video.get_or_create_for_url(
            'http://www.youtube.com/watch?v=5CKwCfLUwj4')
        cls.data_utils.add_subs(video=cls.video)
        langs = ['en', 'da', 'ar', 'tr', 'zh-cn', 'nl']
        for lc in langs:
            defaults = {
                'video':
                cls.video,
                'language_code':
                lc,
                'complete':
                True,
                'visibility':
                'public',
                'committer':
                cls.user,
                'subtitles': ('apps/webdriver_testing/subtitle_data/'
                              'Open Source Philosophy.%s.dfxp' % lc)
            }
            cls.data_utils.add_subs(**defaults)
Пример #26
0
    def setUpClass(cls):
        super(TestCaseTasks, cls).setUpClass()
        cls.client = APIClient
        cls.data_utils = data_helpers.DataHelpers()
        cls.admin = UserFactory()
        cls.manager = UserFactory()
        cls.member = UserFactory()
        cls.team = TeamFactory(admin=cls.admin,
                               manager=cls.manager,
                               member=cls.member,
                               workflow_enabled=True)
        WorkflowFactory.create(team=cls.team,
                               review_allowed=10,
                               approve_allowed=20,
                               autocreate_subtitle=True,
                               autocreate_translate=True)
        lang_list = ['en', 'ru', 'pt-br', 'fr', 'de', 'es']
        for language in lang_list:
            TeamLangPrefFactory.create(team=cls.team,
                                       language_code=language,
                                       preferred=True)
        cls.video = VideoFactory(primary_audio_language_code="en")
        cls.tv = TeamVideoFactory(team=cls.team, video=cls.video)

        #complete transcribe task
        #add 1 draft version of subtitles
        pipeline.add_subtitles(cls.video,
                               'en',
                               SubtitleSetFactory(),
                               committer=cls.member,
                               author=cls.member,
                               complete=False)
        #add a final version of subtitles
        pipeline.add_subtitles(cls.video,
                               'en',
                               SubtitleSetFactory(),
                               committer=cls.member,
                               author=cls.member,
                               complete=True)
        cls.data_utils.complete_review_task(cls.tv, 20, cls.manager)
        cls.data_utils.complete_approve_task(cls.tv, 20, cls.manager)
        #complete french translate tasks
        pipeline.add_subtitles(cls.video,
                               'fr',
                               SubtitleSetFactory(),
                               committer=cls.member,
                               author=cls.member,
                               complete=True)
        cls.data_utils.complete_review_task(cls.tv, 20, cls.manager)
        cls.data_utils.complete_approve_task(cls.tv, 20, cls.manager)

        #german lang translate needs approve
        pipeline.add_subtitles(cls.video,
                               'de',
                               SubtitleSetFactory(),
                               committer=cls.member,
                               author=cls.member,
                               complete=True)
        cls.data_utils.complete_review_task(cls.tv, 20, cls.manager)
Пример #27
0
 def setUpClass(cls):
     super(TestCaseRevisionNotifications, cls).setUpClass()
     cls.data_utils = data_helpers.DataHelpers()
     cls.user = UserFactory.create()
     cls.video_pg = video_page.VideoPage(cls)
     cls.diffing_pg = diffing_page.DiffingPage(cls)
     cls.video_language_pg = video_language_page.VideoLanguagePage(cls)
     cls.subs_path = os.path.dirname(os.path.abspath(__file__))
Пример #28
0
    def setUpClass(cls):
        super(TestCaseDeleteLast, cls).setUpClass()
        cls.data_utils = data_helpers.DataHelpers()
        cls.editor_pg = editor_page.EditorPage(cls)
        cls.tasks_tab = TasksTab(cls)
        cls.video_pg = video_page.VideoPage(cls)
        cls.watch_pg = watch_page.WatchPage(cls)
        cls.user = UserFactory.create()
        cls.owner = UserFactory.create()
        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.owner,
                                            ).team
        cls.workflow = WorkflowFactory(team = cls.team,
                                       autocreate_subtitle=True,
                                       autocreate_translate=True,
                                       approve_allowed = 10, # manager
                                       review_allowed = 10, # peer
                                       )
        lang_list = ['en', 'ru', 'pt-br', 'de', 'sv']
        for language in lang_list:
            TeamLangPrefFactory.create(team=cls.team, language_code=language,
                                       preferred=True)

        cls.admin = TeamMemberFactory(role="ROLE_ADMIN",team=cls.team).user
        cls.contributor = TeamMemberFactory(team=cls.team).user
        cls.subs_dir = os.path.join(os.getcwd(), 'apps', 'webdriver_testing', 
                                    'subtitle_data') 
        cls.video, cls.tv = cls.create_source_with_multiple_revisions()
        translation = os.path.join(cls.subs_dir, 'Timed_text.sv.dfxp')
        
        #Upload subs - sv - incomplete, de - reviewed, ru - complete needs review
        cls.logger.info("""Uploading subs to get tasks in various stages: """)
        cls.logger.info("""
                         sv: translation started, incomplete
                         ru: translation submitted, needs review
                         de: translation reviewed, needs approve
                         pt-br: not started
                         """)

        cls._upload_lang(cls.video, translation, 'sv', cls.contributor)
        cls._upload_lang(cls.video, translation, 'de', cls.contributor,
                         complete=True)
        cls.data_utils.complete_review_task(cls.tv, 20, cls.admin)
        cls._upload_lang(cls.video, translation, 'ru', cls.contributor,
                         complete=True)

        cls.logger.info('Setting visibility override on v3 to private')
        cls.en = cls.video.subtitle_language('en')
        en_v3 = cls.en.get_tip(full=True)
        en_v3.visibility_override = 'private'
        en_v3.save() 
        cls.en.clear_tip_cache() 

        cls.tasks_tab.open_page('teams/%s/tasks/?assignee=anyone'
                                 % cls.team.slug)
Пример #29
0
    def setUpClass(cls):
        super(TestCaseSubtitlesFetch, cls).setUpClass()
        cls.data_utils = data_helpers.DataHelpers()
        cls.user = UserFactory()

        #Create the test video and path to the sub data directory.
        cls.test_video = cls.data_utils.create_video_with_subs(cls.user)
        cls.subs_data_dir = os.path.join(os.getcwd(), 'apps',
                                         'webdriver_testing', 'subtitle_data')
Пример #30
0
 def setUpClass(cls):
     super(TestCaseRevisionEdits, cls).setUpClass()
     cls.data_utils = data_helpers.DataHelpers()
     cls.video_lang_pg = video_language_page.VideoLanguagePage(cls)
     cls.video_pg = video_page.VideoPage(cls)
     cls.user1 = UserFactory()
     cls.user2 = UserFactory()
     cls.subs_dir = os.path.join(os.getcwd(), 'apps', 'webdriver_testing',
                                 'subtitle_data')