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
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
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
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
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_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))