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)
    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")
Beispiel #3
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
Beispiel #4
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_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")
    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_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_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)