Ejemplo n.º 1
0
    def test_495(self):
        """Revisions - original - history diffs

        http://litmus.pculture.org/show_test.cgi?id=495
        """
        sel = self.selenium
        sel.set_timeout(testvars.MSTestVariables["TimeOut"])
        website.SiteLogIn(self, sel, testvars.siteuser, testvars.passw)
        #get a video and open page
        test_video_url = website.get_video_with_translations(self, sel)
        print test_video_url
        sel.open(test_video_url)
        sel.wait_for_page_to_load(testvars.MSTestVariables["TimeOut"])
        sel.click(testvars.video_original)
        sel.wait_for_page_to_load(testvars.MSTestVariables["TimeOut"])

        sel.click(testvars.history_tab)
        rev_num = website.get_current_rev(self, sel)
        row_num = 2

        while sel.is_element_present(
                "//div[@id='revisions-tab']/table/tbody/tr[" + str(row_num) +
                "]"):
            website.check_the_box(self, sel, row_num)  #check the box
            old_rev = rev_num - 1
            sel.click(testvars.video_compare_revisions)
            website.verify_compare_revisions(self, sel, str(old_rev),
                                             str(rev_num))
            row_num += 1
            if row_num == 4:
                break
Ejemplo n.º 2
0
    def test_605(self):
        """Team Edit Description

        http://litmus.pculture.org/show_test.cgi?id=605.      
        """
        sel = self.selenium
        sel.set_timeout(testvars.timeout)

        #login
        website.SiteLogIn(self, sel, testvars.siteuser, testvars.passw)
        #locate or create your team
        team = website.get_own_team(self, sel)
        print "testing team: " + team
        #open team manager settings and edit the description
        sel.open("teams/" + team)
        sel.click(testvars.manage_team)
        sel.wait_for_page_to_load(testvars.timeout)
        timestamp = time.strftime("%m%d%H%M%S", time.gmtime())
        print timestamp
        new_text = "Test 605: edit description for http://pculture.org "
        sel.type("id_description", new_text + timestamp)
        website.save_team_settings(self, sel)
        sel.wait_for_page_to_load(testvars.timeout)
        # logout and verify team no longer displayed
        sel.open("teams/" + team)
        self.assertTrue(sel.is_text_present(new_text))
Ejemplo n.º 3
0
    def test_493(self):
        """Revisions - original - invalid comparison selection

        http://litmus.pculture.org/show_test.cgi?id=493
        """
        sel = self.selenium
        sel.set_timeout(testvars.MSTestVariables["TimeOut"])
        website.SiteLogIn(self, sel, testvars.siteuser, testvars.passw)
        #get a video and open page
        test_video_url = website.get_video_with_translations(self, sel)
        print test_video_url
        sel.open(test_video_url)
        sel.wait_for_page_to_load(testvars.MSTestVariables["TimeOut"])
        print "open original lang"
        sel.click(testvars.video_original)
        sel.wait_for_page_to_load(testvars.MSTestVariables["TimeOut"])
        print "go to history tab"
        sel.click(testvars.history_tab)
        row_num = 1
        #uncheck default 1st box checked
        website.check_the_box(self, sel, row_num)  #uncheck the box
        print "verifing invalid message when 1 box checked"
        while sel.is_element_present(
                "//div[@id='revisions-tab']/table/tbody/tr[" + str(row_num) +
                "]"):
            website.check_the_box(self, sel, row_num)
            sel.click(testvars.video_compare_revisions)
            self.assertEqual("Select two revisions to compare, please",
                             sel.get_alert())
            website.check_the_box(self, sel, row_num)  #uncheck the box
            row_num += 1
            if row_num == 3:
                break
Ejemplo n.º 4
0
    def test_486(self):
        """Revisions - edit subtitles timing and verify in history table.

        http://litmus.pculture.org/show_test.cgi?id=486
        """
        sel = self.selenium
        sel.set_timeout(testvars.MSTestVariables["TimeOut"])
        sel.open("/")
        subtextfile = os.path.join(testvars.MSTestVariables["DataDirectory"],
                                   "OctopusGarden.txt")
        print "submitting a youtube video, format: "
        vid_url = offsite.get_youtube_video_url(self)
        # Submit Video
        print "logging in and submitting video"
        website.SiteLogIn(self, sel, testvars.siteuser, testvars.passw)
        website.submit_video(self, sel, vid_url)
        # Verify embed and player
        print "verifying embed"
        unisubs_url = website.verify_submitted_video(self,
                                                     sel,
                                                     vid_url,
                                                     embed_type="youtube")
        # Start sub widget
        print "starting sub widget"
        website.start_sub_widget(self, sel)
        # Transcribe
        print "transcribing video"
        widget.transcribe_video(self, sel, subtextfile)
        # Sync
        print "syncing video"
        widget.sync_video(self, sel, subtextfile)
        # Review
        print "review step - just submitting video"
        widget.submit_sub_edits(self, sel)
        mslib.wait_for_element_present(self, sel, testvars.video_video_info)
        sel.select_frame("relative=top")
        sel.click(testvars.video_original)
        sel.wait_for_page_to_load(testvars.MSTestVariables["TimeOut"])
        # Verify subtitles
        website.verify_subs(self, sel, subtextfile)
        sel.click(testvars.video_add_translation)
        widget.starter_dialog_edit_orig(self, sel)
        widget.goto_step(self, sel, "2")
        widget.resync_video(self, sel, subtextfile)
        widget.submit_sub_edits(self, sel)
        time.sleep(2)
        sel.select_frame("relative=top")
        # Click History tab
        sel.click(testvars.video_original)
        sel.wait_for_page_to_load(testvars.MSTestVariables["TimeOut"])
        sel.click(testvars.history_tab)
        rev_num = website.get_current_rev(self, sel)
        website.verify_latest_history(self,
                                      sel,
                                      rev=str(rev_num),
                                      user="******",
                                      tm="100%",
                                      text="0%")
        website.admin_delete_video(self, sel, unisubs_url)
    def test_488(self):
        """Add comments on a translation
        
        http://litmus.pculture.org/show_test.cgi?id=488
        """

        sel = self.selenium
        sel.set_timeout(testvars.MSTestVariables["TimeOut"])
        #get a video and open page
        website.SiteLogout(self, sel)
        test_video_url = website.get_video_with_translations(self, sel)
        print test_video_url
        sel.open(test_video_url)
        language = website.get_translated_lang(self, sel)

        #Open the Language tab / then the comments
        mslib.wait_for_element_present(
            self, sel, testvars.video_lang + ":contains('" + language + "')")
        sel.click(testvars.video_lang + ":contains('" + language + "')")
        mslib.wait_for_element_present(
            self, sel,
            testvars.video_lang_hd + ":contains('" + language + "')")
        sel.click(testvars.comments_tab)

        #Not logged in, enter a comment
        print "1. trying to enter a comment when not logged in"
        ctext = "this comment should never post"
        website.enter_comment_text(self, sel, ctext)
        website.verify_comment_text(self, sel, ctext, result="login")

        #Login and go to language comments page
        website.SiteLogIn(self, sel, testvars.siteuser, testvars.passw)
        sel.open(test_video_url)
        mslib.wait_for_element_present(
            self, sel, testvars.video_lang + ":contains('" + language + "')")
        sel.click(testvars.video_lang + ":contains('" + language + "')")
        mslib.wait_for_element_present(
            self, sel,
            testvars.video_lang_hd + ":contains('" + language + "')")
        sel.click(testvars.comments_tab)

        #Enter a 1-char comment
        print "2. entering a 1-char comment on Video Info"
        website.enter_comment_text(self, sel, "d")
        website.verify_comment_text(self, sel, "d")
        #Enter a normal comment
        print "3. entering a normal comment on Video Info"
        website.enter_comment_text(self, sel,
                                   comments_text.normal_comment_text)
        website.verify_comment_text(self, sel,
                                    comments_text.normal_comment_text)
        print "4. entering a too-long comment on Video Info"
        #Enter a too long comment
        website.enter_comment_text(self, sel,
                                   comments_text.normal_comment_text * 10)
        website.verify_comment_text(self,
                                    sel,
                                    comments_text.normal_comment_text,
                                    result="too long")
Ejemplo n.º 6
0
    def test_693(self):
        """Launch widget from Teams page.

        Currently testing on al-jazeera teams page.

        """
        sel = self.selenium
        sel.set_timeout(testvars.timeout)

        #login
        website.SiteLogIn(self, sel, testvars.siteuser, testvars.passw)
        team = "al-jazeera"
        subtextfile = os.path.join(testvars.MSTestVariables["DataDirectory"],
                                   "OctopusGarden.txt")

        #Edit original language
        print "testing edit original lang"
        sel.open("/teams/" + team)
        sel.wait_for_page_to_load(testvars.timeout)
        #        website.teampage_lang_select(self,sel)
        mslib.wait_for_element_present(self, sel, testvars.vid_add_subs_button)
        sel.click(testvars.vid_add_subs_button)
        time.sleep(5)
        widget.starter_dialog_edit_orig(self, sel)
        widget.transcribe_video(self, sel, subtextfile)
        widget.close_sub_widget(self, sel)

        #Edit translation
        print "testing edit translation"
        sel.open("/teams/" + team)
        sel.wait_for_page_to_load(testvars.timeout)
        #        website.teampage_lang_select(self,sel)
        mslib.wait_for_element_present(self, sel, testvars.vid_add_subs_button)
        sel.click(testvars.vid_add_subs_button)
        time.sleep(5)
        widget.starter_dialog_translate_from_orig(self, sel, to_lang='hr')
        widget.edit_translation(self, sel, subtextfile)
        widget.close_sub_widget(self, sel)

        #New fork
        print "testing new fork"
        sel.open("teams/" + team)
        sel.wait_for_page_to_load(testvars.timeout)
        #        website.teampage_lang_select(self,sel)
        mslib.wait_for_element_present(self, sel, testvars.vid_add_subs_button)
        sel.click(testvars.vid_add_subs_button)
        time.sleep(5)
        widget.starter_dialog_fork(self, sel, to_lang='pl')
        print "transcribing video"
        widget.transcribe_video(self, sel, subtextfile)
        # Sync
        print "syncing video"
        widget.sync_video(self, sel, subtextfile, 3, 4)
        # Review
        print "review step - just submitting video"
        widget.submit_sub_edits(self, sel, offsite=True)
Ejemplo n.º 7
0
    def test_609(self):
        """Team Privacy Settings.

        http://litmus.pculture.org/show_test.cgi?id=609.      
        """
        sel = self.selenium
        sel.set_timeout(testvars.timeout)

        #login
        website.SiteLogIn(self, sel, testvars.siteuser, testvars.passw)
        #locate or create your team
        team = website.get_own_team(self, sel)
        print "testing with team: " + team
        #open team manager settings and mark as not public
        sel.open("teams/" + team)
        sel.click(testvars.manage_team)
        sel.wait_for_page_to_load(testvars.timeout)
        if str(sel.get_value("is_visible")) == "on":
            sel.click("is_visible")
            time.sleep(1)
        self.failIf(
            str(sel.get_value("is_visible")) == "on",
            "is_visible not set to off")
        website.save_team_settings(self, sel)
        # logout and verify team no longer displayed
        sel.click(testvars.WebsiteUI["Logout_Button"])
        website.open_teams_page(self, sel)
        website.search_teams(self, sel, team)
        self.failIf(sel.is_element_present("link=" + team))
        website.SiteLogIn(self, sel, testvars.siteuser, testvars.passw)
        website.open_teams_page(self, sel)
        website.search_teams(self, sel, team)
        self.assertTrue(
            sel.is_element_present("css=a[href*='/teams/" + team.lower() +
                                   "']"))
        # reset setting
        sel.open("teams/" + team.lower())
        sel.click(testvars.manage_team)
        sel.wait_for_page_to_load(testvars.timeout)
        if sel.get_value("id_is_visible") == "off":
            sel.click("id_is_visible")
            website.save_team_settings(self, sel)
    def test_378(self):
        """Site login using site account.

        http://litmus.pculture.org/show_test.cgi?id=378.      
        """
        sel = self.selenium
        sel.set_timeout(testvars.MSTestVariables["TimeOut"])
        #login
        website.SiteLogIn(self, sel, testvars.siteuser, testvars.passw)
        # verify
        website.verify_login(self, sel, testvars.siteuser)
        # logout
        sel.open("logout/")
Ejemplo n.º 9
0
    def test_507(self):
        """Invalid or unsupported formats
        
        http://litmus.pculture.org/show_test.cgi?id=507
        """

        sel = self.selenium
        sel.set_timeout(testvars.MSTestVariables["TimeOut"])
        try:
            #get a video and open page
            website.SiteLogIn(self, sel, testvars.siteuser, testvars.passw)
            test_video_url = website.submit_random_youtube(self, sel)
            print test_video_url
            sel.open(test_video_url)
            #Original is the default tab when video opened.
            print "1. invalid ttml"
            sub_file = os.path.join(testvars.MSTestVariables["DataDirectory"],
                                    "sg81_fakesub.xml")
            website.upload_subtitles(self, sel, sub_file)
            mslib.wait_for_element_present(self, sel, "css=p.error_list")
            self.assertTrue(
                sel.is_element_present(
                    "css=p.error_list:contains('Can not detect file encoding')"
                ))
            sel.click("css=a.close")

            print "2. invalid srt"
            sub_file = os.path.join(testvars.MSTestVariables["DataDirectory"],
                                    "sg81_invalid.srt")
            website.upload_subtitles(self, sel, sub_file)
            time.sleep(5)
            mslib.wait_for_element_present(self, sel, "css=p.error_list")
            self.assertTrue(
                sel.is_element_present(
                    "css=p.error_list:contains('Incorrect subtitles format')"))
            sel.click("css=a.close")

            print "3. unsupported format"
            sub_file = os.path.join(testvars.MSTestVariables["DataDirectory"],
                                    "sg81_text.txt")
            website.upload_subtitles(self, sel, sub_file)
            time.sleep(5)
            mslib.wait_for_element_present(self, sel, "css=p.error_list")
            self.assertTrue(
                sel.is_element_present(
                    "css=p.error_list:contains('Incorrect format.')"))
            sel.click("css=a.close")

        finally:
            # check for Site Error notification and submit
            website.handle_error_page(self, sel, self.id())
Ejemplo n.º 10
0
    def test_506(self):
        """Upload subtitle files sbv format.
        
        http://litmus.pculture.org/show_test.cgi?id=506
        """

        sel = self.selenium
        sel.set_timeout(testvars.MSTestVariables["TimeOut"])

        #get a video and open page
        try:
            website.SiteLogIn(self, sel, testvars.siteuser, testvars.passw)
            test_video_url = website.submit_random_youtube(self, sel)
            print test_video_url
            sel.open(test_video_url)

            #Original is the default tab when video opened.
            print "1. english sbv upload"
            sub_file = os.path.join(testvars.MSTestVariables["DataDirectory"],
                                    "sg81_en_subs.sbv")
            sub_text = os.path.join(testvars.MSTestVariables["DataDirectory"],
                                    "sg81_en_subs.txt")
            website.upload_subtitles(self, sel, sub_file)
            website.verify_sub_upload(self, sel, sub_text)

            print "2. polish sbv upload"
            sub_file = os.path.join(testvars.MSTestVariables["DataDirectory"],
                                    "sg81_pl_subs.sbv")
            sub_text = os.path.join(testvars.MSTestVariables["DataDirectory"],
                                    "sg81_pl_subs.txt")
            website.upload_subtitles(self, sel, sub_file, lang="pl")
            website.verify_sub_upload(self, sel, sub_text, lang="Polish")

            print "3. arabic sbv upload"
            sub_file = os.path.join(testvars.MSTestVariables["DataDirectory"],
                                    "sg81_ar_subs.sbv")
            sub_text = os.path.join(testvars.MSTestVariables["DataDirectory"],
                                    "sg81_ar_subs.txt")
            website.upload_subtitles(self, sel, sub_file, lang="ar")
            website.verify_sub_upload(self, sel, sub_text, lang="Arabic")

            print "4. macedonian sbv upload"
            sub_file = os.path.join(testvars.MSTestVariables["DataDirectory"],
                                    "sg81_mk_subs.sbv")
            sub_text = os.path.join(testvars.MSTestVariables["DataDirectory"],
                                    "sg81_mk_subs.txt")
            website.upload_subtitles(self, sel, sub_file, lang="mk")
            website.verify_sub_upload(self, sel, sub_text, lang="Macedonian")
        finally:
            # check for Site Error notification and submit
            website.handle_error_page(self, sel, self.id())
Ejemplo n.º 11
0
    def test_494(self):
        """Revisions - translation - invalid comparison selection

        http://litmus.pculture.org/show_test.cgi?id=494
        """
        sel = self.selenium
        sel.set_timeout(testvars.MSTestVariables["TimeOut"])
        subtextfile = os.path.join(testvars.MSTestVariables["DataDirectory"],
                                   "OctopusGarden.txt")
        website.SiteLogIn(self, sel, testvars.siteuser, testvars.passw)
        #get a video and open page
        test_video_url = website.get_video_with_translations(self, sel)
        print test_video_url
        sel.open(test_video_url)
        language = website.get_translated_lang(self, sel)
        website.click_lang_tab(self, sel, language)

        ## if not enough revisions for comparison, edit the sub text.
        rev_num = website.get_current_rev(self, sel)
        print rev_num
        while rev_num < 2:
            print "only 2 or less revs - editing text first"
            #edit text
            sel.click(testvars.video_edit_subtitles)
            mslib.wait_for_element_present(self, sel,
                                           "css=div.unisubs-help-heading")
            if sel.is_element_present(
                    "css=h2:contains('Editing Translation')"):
                widget.edit_translation(self, sel, subtextfile)
            else:
                widget.goto_step(self, sel, step="3")
                widget.edit_text(self, sel, subtextfile)

            widget.submit_sub_edits(self, sel)
            rev_num = website.get_current_rev(self, sel)

        sel.click(testvars.history_tab)
        row_num = 1
        website.check_the_box(self, sel, row_num)  #uncheck the box to start
        while sel.is_element_present(
                "//div[@id='revisions-tab']/table/tbody/tr[" + str(row_num) +
                "]"):
            website.check_the_box(self, sel, row_num)
            sel.click(testvars.video_compare_revisions)
            self.assertEqual("Select two revisions to compare, please",
                             sel.get_alert())
            website.check_the_box(self, sel, row_num)  #uncheck the box
            row_num += 1
            if row_num == 3:
                break
 def test_384(self):
     """Login from widget using site account.
     
     http://litmus.pculture.org/show_test.cgi?id=384
     """
     sel = self.selenium
     sel.set_timeout(testvars.MSTestVariables["TimeOut"])
     #login
     website.SiteLogIn(self, sel, testvars.siteuser, testvars.passw)
     # verify
     website.verify_login(self, sel, testvars.siteuser)
     # logout
     website.SiteLogout(self, sel)
     return self.session
Ejemplo n.º 13
0
    def test_492(self):
        """Revisions - compare translation revisions.

        http://litmus.pculture.org/show_test.cgi?id=492
        """
        sel = self.selenium
        sel.set_timeout(testvars.MSTestVariables["TimeOut"])
        website.SiteLogIn(self, sel, testvars.siteuser, testvars.passw)
        #get a video and open page
        test_video_url = website.get_video_with_translations(self, sel)
        print test_video_url
        sel.open(test_video_url)
        language = website.get_translated_lang(self, sel)
        website.click_lang_tab(self, sel, language)

        website.store_subs(self, sel)
        rev_num = website.get_current_rev(self, sel)
        subtextfile = "subs.txt"
        #If there is only 1 revision - edit the subs to make a new revision
        if int(rev_num) < 1:
            print "only 1 rev - editing text first"
            sel.click(testvars.video_edit_subtitles)
            widget.goto_step(self, sel, step="3")
            widget.edit_text(self, sel, subtextfile)
            widget.submit_sub_edits(self, sel)
            website.click_lang_tab(self, sel, language)
            sel.select_frame("relative=top")

        sel.click(testvars.history_tab)
        mslib.wait_for_element_present(self, sel,
                                       testvars.video_compare_revisions)
        #get the checkbox value for comparing
        row_num = 2
        website.check_the_box(self, sel, row_num)  #check the box
        sel.click(testvars.video_compare_revisions)
        website.verify_compare_revisions(self, sel, str(int(rev_num) - 1),
                                         str(rev_num))
        if sel.get_value("//div[@id='revisions-tab']/table/tbody/tr[" +
                         str(row_num) + "]/td[1]/input") == "on":
            website.check_the_box(self, sel, row_num)  #uncheck the box

        #If there are more than 2 revision, test another compare
        if int(rev_num) > 2:
            row_num = 3
            old_rev = int(rev_num) - 2
            website.check_the_box(self, sel, row_num)
            sel.click(testvars.video_compare_revisions)
            website.verify_compare_revisions(self, sel, old_rev, str(rev_num))
    def test_536(self):
        """Add comments on Video Info tab
        
        http://litmus.pculture.org/show_test.cgi?id=536
        """

        sel = self.selenium
        sel.set_timeout(testvars.MSTestVariables["TimeOut"])
        #get a video and open page
        website.SiteLogout(self, sel)
        test_video_url = website.get_video_with_translations(self, sel)
        print test_video_url
        sel.open(test_video_url)
        sel.click(testvars.video_video_info)
        mslib.wait_for_element_present(self, sel, testvars.info_comments_tab)
        sel.click(testvars.info_comments_tab)
        #Open the Original tab / then comments tab

        #Not logged in, enter a comment

        print "1. trying to enter a comment when not logged in"
        ctext = "this comment should never post"
        website.enter_comment_text(self, sel, ctext)
        website.verify_comment_text(self, sel, ctext, result="login")
        #Login
        website.SiteLogIn(self, sel, testvars.siteuser, testvars.passw)
        sel.open(test_video_url)
        sel.click(testvars.video_video_info)
        mslib.wait_for_element_present(self, sel, testvars.comments_tab)
        sel.click(testvars.comments_tab)
        #Enter a 1-char comment
        print "2. entering a 1-char comment on Video Info"
        website.enter_comment_text(self, sel, "d")
        website.verify_comment_text(self, sel, "d")
        #Enter a normal comment
        print "3. entering a normal comment on Video Info"
        website.enter_comment_text(self, sel,
                                   comments_text.normal_comment_text)
        website.verify_comment_text(self, sel,
                                    comments_text.normal_comment_text)
        print "4. entering a too-long comment on Video Info"
        #Enter a too long comment
        website.enter_comment_text(self, sel,
                                   comments_text.normal_comment_text * 10)
        website.verify_comment_text(self,
                                    sel,
                                    comments_text.normal_comment_text,
                                    result="too long")
    def test_487(self):
        """Add comments on original language
        
        http://litmus.pculture.org/show_test.cgi?id=487
        """

        sel = self.selenium
        sel.set_timeout(testvars.MSTestVariables["TimeOut"])

        #get a video and open page
        website.SiteLogout(self, sel)
        test_video_url = website.get_video_with_translations(self, sel)
        print test_video_url
        sel.open(test_video_url)
        sel.wait_for_page_to_load(testvars.MSTestVariables["TimeOut"])
        #Open the Original is the default tab when  video opened.
        sel.click(testvars.comments_tab)
        #Not logged in, enter a comment
        print "1. trying to enter a comment when not logged in"
        ctext = "this comment should never post"
        website.enter_comment_text(self, sel, ctext)
        website.verify_comment_text(self, sel, ctext, result="login")
        #Login
        website.SiteLogIn(self, sel, testvars.siteuser, testvars.passw)
        sel.open(test_video_url)
        sel.click(testvars.comments_tab)
        #Enter a 1-char comment
        print "2. entering a 1-char comment on original"
        website.enter_comment_text(self, sel, "d")
        website.verify_comment_text(self, sel, "d")
        #Enter a normal comment
        print "3. entering a normal comment on original"
        website.enter_comment_text(self, sel,
                                   comments_text.normal_comment_text)
        website.verify_comment_text(self, sel,
                                    comments_text.normal_comment_text)
        print "4. entering a too-long comment on original"
        #Enter a too long comment
        website.enter_comment_text(self, sel,
                                   comments_text.normal_comment_text * 10)
        website.verify_comment_text(self,
                                    sel,
                                    comments_text.normal_comment_text,
                                    result="too long")
Ejemplo n.º 16
0
    def test_604(self):
        """Create a new team - required fields.

        http://litmus.pculture.org/show_test.cgi?id=604.      
        """
        sel = self.selenium
        sel.set_timeout(testvars.timeout)
        #test data
        team = ""
        url = "http://blip.tv/file/get/Miropcf-Miro20Introduction771.ogv"
        team_logo_path = os.path.join(
            testvars.MSTestVariables["DataDirectory"], "sheep.png")

        #login
        website.SiteLogIn(self, sel, testvars.siteuser, testvars.passw)
        #create team
        website.open_teams_page(self, sel)
        sel.click(testvars.start_team)
        sel.wait_for_page_to_load(testvars.timeout)
        website.create_team(self, sel, team, team_logo_path)
Ejemplo n.º 17
0
    def test_603(self):
        """Create a new team - open membership.

        http://litmus.pculture.org/show_test.cgi?id=603.      
        """
        sel = self.selenium
        sel.set_timeout(testvars.timeout)
        #test data
        team = "miro" + time.strftime("%m%d%H%M%S", time.gmtime())
        team_logo_path = os.path.join(
            testvars.MSTestVariables["DataDirectory"], "sheep.png")

        #login
        website.SiteLogIn(self, sel, testvars.siteuser, testvars.passw)
        #create team
        website.open_teams_page(self, sel)
        sel.click(testvars.start_team)
        sel.wait_for_page_to_load(testvars.timeout)
        website.create_team(self, sel, team, team_logo_path)
        sel.open("teams/" + team)
        # logout
        sel.click(testvars.WebsiteUI["Logout_Button"])
    def test_537(self):
        """Add comments on a translation using non-ascii characters
        
        http://litmus.pculture.org/show_test.cgi?id=537
        """

        sel = self.selenium
        sel.set_timeout(testvars.MSTestVariables["TimeOut"])
        #get a video and open page
        website.SiteLogout(self, sel)
        test_video_url = website.get_video_with_translations(self, sel)
        print test_video_url
        sel.open(test_video_url)
        language = website.get_translated_lang(self, sel)

        #Login and go to language comments page
        website.SiteLogIn(self, sel, testvars.siteuser, testvars.passw)
        sel.open(test_video_url)
        mslib.wait_for_element_present(
            self, sel, testvars.video_lang + ":contains('" + language + "')")
        sel.click(testvars.video_lang + ":contains('" + language + "')")
        mslib.wait_for_element_present(
            self, sel,
            testvars.video_lang_hd + ":contains('" + language + "')")
        sel.click(testvars.comments_tab)

        #Enter some non-ascii comments
        print "1. entering croatian comment text"
        website.enter_comment_text(self, sel, comments_text.hr_comment_text)
        website.verify_comment_text(self, sel, comments_text.hr_comment_text)
        print "2. entering japanese comment text"
        website.enter_comment_text(self, sel, comments_text.jp_comment_text)
        website.verify_comment_text(self, sel, comments_text.jp_comment_text)
        print "3. entering russian comment text"
        website.enter_comment_text(self, sel, comments_text.ru_comment_text)
        website.verify_comment_text(self, sel, comments_text.ru_comment_text)
Ejemplo n.º 19
0
    def test_613(self):
        """Submit a video and add to team.

        http://litmus.pculture.org/show_test.cgi?id=613.      
        """
        sel = self.selenium
        sel.set_timeout(testvars.timeout)
        #login
        website.SiteLogIn(self, sel, testvars.siteuser, testvars.passw)
        #create team
        team = "miro" + time.strftime("%m%d%H%M%S", time.gmtime())
        team_logo_path = os.path.join(
            testvars.MSTestVariables["DataDirectory"], "sheep.png")
        website.open_teams_page(self, sel)
        sel.click(testvars.start_team)
        sel.wait_for_page_to_load(testvars.timeout)
        website.create_team(self, sel, team, team_logo_path)

        #submit video
        sel.window_maximize()
        test_video_url = website.submit_random_youtube(self, sel)
        print test_video_url
        mslib.wait_for_element_present(
            self, sel, "css=span.sort_label strong:contains('Add video')")
        vid_title = sel.get_text(testvars.vid_title)
        #add video to team and verify values
        teamli = "add/video/" + team

        sel.click(testvars.video_add_to_team)
        ##        sel.click_at("css=span.sort_label strong:contains('Add video')","")
        sel.click_at("css=a[href*='" + teamli + "']", "")

        sel.wait_for_page_to_load(testvars.timeout)
        print "verifying the inital add page"

        if sel.is_element_present("css=.errorlist") == True:
            print "error adding video to team"
            self.fail()
        else:
            mslib.wait_for_text_present(self, sel, "Video language")
            sel.select("id_language", "value=en")
            sel.click(testvars.teams_save)
            sel.wait_for_page_to_load(testvars.timeout)
        self.assertTrue(
            sel.is_element_present("css=li.active a:contains('" + team + "')"))
        sel.click(testvars.teams_video_tab)
        sel.wait_for_page_to_load(testvars.timeout)
        print "verifying team videos list"
        self.assertTrue(
            sel.is_element_present("css=tr.video-container td a[href*='" +
                                   test_video_url + "info/']"),
            "test_video_url error")
        #        self.assertTrue(sel.is_element_present("css=tr.video-container td:contains('"+vid_title[0:10]+"')"),"vid_title error")
        # delete the video from the team
        sel.click("css=td a:contains('" + vid_title[0:10] +
                  "') +div +div +div.small.grey a.remove-video")
        self.failUnless(
            re.search(r"^Remove this video[\s\S]$", sel.get_confirmation()))

        # logout
        sel.click(testvars.WebsiteUI["Logout_Button"])