def store_subs(self,sel):
        """Go to main video page and store the existing subs.

        """
        print "video has subs"
        sel.click(testvars.WebsiteUI["Subhomepage_menuitem"])
        sel.wait_for_page_to_load(testvars.timeout)
        website.store_subs(self,sel,modify=True,limit=True)
        orig_rev = website.get_current_rev(self,sel)
        print "starting revision is: "+str(orig_rev)
        return orig_rev
def store_subs(self, sel):
    """Go to main video page and store the existing subs.

        """
    print "video has subs"
    sel.click(testvars.WebsiteUI["Subhomepage_menuitem"])
    sel.wait_for_page_to_load(testvars.timeout)
    website.store_subs(self, sel, modify=True, limit=True)
    orig_rev = website.get_current_rev(self, sel)
    print "starting revision is: " + str(orig_rev)
    return orig_rev
Exemple #3
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_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))