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