def test_7(self): """http://litmus.pculture.org/show_test.cgi?id=7 add feed. 1. Open Ryan is Hungry 2. click one-click link 3. Verify feed added 4. Cleanup """ reg = mirolib.AppRegions() feed = "Ryan" try: url = "http://ryanishungry.com/subscribe/" switchApp(mirolib.open_ff()) if reg.t.exists("Firefox",45): click(reg.t.getLastMatch()) mirolib.shortcut("l") time.sleep(2) type(url + "\n") time.sleep(20) find(testvars.one_click_badge) click(testvars.one_click_badge) time.sleep(25) mirolib.close_ff() #Start Miro mirolib.close_one_click_confirm(self) mirolib.shortcut("r",shift=True) mirolib.click_podcast(self,reg,feed) finally: mirolib.delete_feed(self,reg,feed)
def test_6(self): """http://litmus.pculture.org/show_test.cgi?id=6 add feed from MiroGuide. 1. Open Miro 2. search for a feed and add it. 3. Verify feed added 4. Cleanup """ setAutoWaitTimeout(60) pass #set the search regions reg = mirolib.AppRegions() feed = "StupidVideos" try: mirolib.click_sidebar_tab(self,reg,"Miro") time.sleep(5) gr = Region(reg.mtb) gr.setH(300) gr.click(Pattern("guide_search.png")) type("StupidVideos\n") time.sleep(5) reg.m.find(Pattern("add_feed.png")) click(reg.m.getLastMatch()) time.sleep(5) mirolib.click_podcast(self,reg,feed) finally: #4. cleanup mirolib.delete_feed(self,reg,"StupidVideos")
def test_339(self): """http://litmus.pculture.org/show_test.cgi?id=339 delete feed with dl items. Litmus Test Title:: 339 - channels delete a feed with downloaded items Description: 1. Add the 2-stupid-videos feed, and download both items in the feed. 2. Remove Feed and Keep the videos. 3. Verify videos are displayed in the non-feed section of the Library 4. Cleanup """ setAutoWaitTimeout(testvars.timeout) #set the search regions reg = mirolib.AppRegions() url = "http://pculture.org/feeds_test/2stupidvideos.xml" feed = "TwoStupid" #1. Add the feed and start dl mirolib.add_feed(self,reg,url,feed) time.sleep(3) mirolib.toggle_normal(reg) # mirolib.count_images(self,reg, "item-context-button.png",region="mainright",num_expected=2) mirolib.set_podcast_autodownload(self,reg,setting="All") mirolib.wait_for_item_in_tab(self,reg,"videos","Flip") mirolib.wait_for_item_in_tab(self,reg,"videos","Dinosaur") mirolib.click_podcast(self,reg,feed) type(Key.DELETE) mirolib.remove_confirm(self,reg,action="keep") mirolib.click_sidebar_tab(self,reg,"videos") mirolib.tab_search(self,reg,"Flip",confirm_present=True) mirolib.tab_search(self,reg,"Dinosaur",confirm_present=True) #4. cleanup mirolib.delete_items(self,reg,"Flip","videos") mirolib.delete_items(self,reg,"Dinosaur","videos")
def test_117(self): """http://litmus.pculture.org/show_test.cgi?id=117 delete multiple feeds then cancel. Litmus Test Title:: 117 - delete multiple feeds then cancel Description: 1. Add several feeds from list of guide feeds 2. Select them all 3. Delete, the cancel the delete 4. Cleanup """ setAutoWaitTimeout(testvars.timeout) #set the search regions reg = mirolib.AppRegions() prefs.set_autodownload(self,reg,setting="Off") prefs.set_default_view(self,reg,setting="Standard") url = "http://pculture.org/feeds_test/list-of-guide-feeds.xml" feed = "Static" feedlist = ["Center", "Earth"] #1. Add the feed and start dl mirolib.add_feed(self,reg,url,feed) for f in feedlist: mirolib.tab_search(self,reg,f) self.assertTrue(reg.m.exists("Add this")) reg.m.click("Add this") time.sleep(4) mirolib.tab_search(self,reg,"") mirolib.toggle_normal(reg) p = mirolib.get_podcasts_region(reg) mirolib.click_sidebar_tab(self,reg,"Music") mirolib.click_podcast(self,reg,feed) #2. Select them all keyDown(Key.SHIFT) for x in feedlist: if p.exists(x): p.click(x) else: print "could not find feed" +str(x) time.sleep(2) keyUp(Key.SHIFT) #3. Delete then cancel. Verify still exists Static List if reg.m.exists("Delete",4) or reg.m.exists("button_mv_delete_all.png",4): click(reg.m.getLastMatch()) else: self.fail("Can't find Delete All button in main view") mirolib.remove_confirm(self,reg,"cancel") p = mirolib.get_podcasts_region(reg) time.sleep(5) self.assertTrue(p.exists("Static",5)) #4. Cleanup feedlist.append("Static") for x in feedlist: print x mirolib.delete_feed(self,reg,x)
def test_725(self): """http://litmus.pculture.org/show_test.cgi?id=725 item click actions, list view. 1. add 3-blip-videos feed 2. download the Joo Joo 3. verify varios item click scenerios """ reg = mirolib.AppRegions() time.sleep(5) url = "http://pculture.org/feeds_test/3blipvideos.xml" feed = "ThreeBlip" title1 = "The Joo" title2 = "York" title3 = "Accessing" mirolib.delete_feed(self,reg,feed) prefs.set_autodownload(self,reg,setting="Off") prefs.set_default_view(self,reg,setting="List") time.sleep(2) #add feed and download joo joo item mirolib.add_feed(self,reg,url,feed) mirolib.tab_search(self,reg,title1) #double-click starts download reg.m.find(title1) title_loc = reg.m.getLastMatch() doubleClick(title_loc) if reg.m.exists("video-download-pause.png"): mirolib.log_result("122","list view double-click starts download") else: self.fail("list view double-click starts download, failed") #double-click pauses download doubleClick(title_loc) if reg.m.exists("video-download-resume.png"): mirolib.log_result("122","list view double-click pauses download") else: self.fail("list view double-click pause download, failed") #double-click resumes download doubleClick(title_loc) if exists("video-download-pause.png"): mirolib.log_result("122","list view double-click resumes download") else: self.fail("list view double-click resume download, failed") #double-click starts playback mirolib.wait_for_item_in_tab(self,reg,tab="Videos",item=title1) mirolib.click_podcast(self,reg,feed) mirolib.tab_search(self,reg,title1) doubleClick(title1) if exists(Pattern("playback_bar_video.png")): mirolib.log_result("122","list view double-click starts playback") else: self.fail("list view double-click start playback, failed") mirolib.verify_video_playback(self,reg) #cleanup mirolib.delete_feed(self,reg,feed)
def test_657(self): """http://litmus.pculture.org/show_test.cgi?id=657 edit multiple fields 1. add Static List feed 2. download the Earth Eats item 3. Edit item metadata """ reg = mirolib.AppRegions() time.sleep(5) url = "http://ringtales.com/nyrss.xml" feed = "The New" title = "Cat" new_metadata_list = [["show","Animated Cartoons", "658"], ["episode_id","nya", "670"], ["season_no","25", "671"], ["episode_no","43", "672"], ["video_kind","Clip", "652"], ] #start clean mirolib.delete_feed(self,reg,feed) #add feed and download earth eats item mirolib.add_feed(self,reg,url,feed) mirolib.toggle_normal(reg) mirolib.tab_search(self,reg,title) if reg.m.exists("button_download.png",10): click(reg.m.getLastMatch()) mirolib.wait_for_item_in_tab(self,reg,"Videos",item=title) mirolib.click_podcast(self,reg,feed) reg.m.click(title) mirolib.edit_item_video_metadata_bulk(self,reg,new_metadata_list) time.sleep(2) mirolib.click_sidebar_tab(self,reg,"Videos") mirolib.tab_search(self,reg,title) reg.mtb.click("Clip") if reg.m.exists(title): reg.mtb.click("All") else: self.fail("item not found in Clips filter") #cleanup mirolib.delete_feed(self,reg,feed)
def test_138(self): #shortened as there no more feed counter and can't count too much stuff. """http://litmus.pculture.org/show_test.cgi?id=138 clear out old items. Litmus Test Title:: 138 Channels - clear out old items Description: 1. Add a feed that adds five new items each time it's updated. 2. Update the feed to add new items. 3. Modify old items settings to verify items cleared. 4. Cleanup """ setAutoWaitTimeout(testvars.timeout) #set the search regions reg = mirolib.AppRegions() url = "http://bluesock.org/~willg/cgi-bin/newitemsfeed.cgi" feed = "my feed" mirolib.add_feed(self,reg,url,feed) mirolib.get_podcasts_region(reg) mirolib.tab_search(self,reg,"my feed") mirolib.toggle_list(reg) mirolib.count_images(self,reg,img="my feed",region="list",num_expected=5) mirolib.click_podcast(self,reg,feed) mirolib.shortcut("r") time.sleep(10) mirolib.get_podcasts_region(reg) if mirolib.count_images(self,reg,img="my feed",region="list",num_expected=10) == 10: mirolib.log_result("99","test_92") #verifies update podcast shortcut mirolib.click_podcast(self,reg,feed) for x in range(0,3): mirolib.shortcut("r") time.sleep(3) mirolib.open_podcast_settings(self,reg) mirolib.change_podcast_settings(self,reg,option="Podcast Items",setting="Keep 0") time.sleep(2) mirolib.get_podcasts_region(reg) mirolib.count_images(self,reg,img="my feed",region="list",num_expected=5) #4. cleanup mirolib.delete_feed(self,reg,"my feed")
def test_116(self): """http://litmus.pculture.org/show_test.cgi?id=116 add multiple feeds to a folder Litmus Test Title:: 116 - add multiple feeds to a new folder Description: 1. Import 2 OPML file of some feeds and folders 2. select several feeds and add to new folder 3. confirm feeds in folders 4. Cleanup """ setAutoWaitTimeout(testvars.timeout) #set the search regions reg = mirolib.AppRegions() mirolib.delete_all_podcasts(self,reg) opml_path = os.path.join(os.getenv("PCF_TEST_HOME"),"Miro","TestData","folder-test.opml") opml_path2 = os.path.join(os.getenv("PCF_TEST_HOME"),"Miro","TestData","folder-test2.opml") feed_list = ["Google", "Onion","two ronnies","Vimeo"] added_feeds = [] new_folder = "multi folder" #1. Add the feeds mirolib.import_opml(self,reg,opml_path) time.sleep(15) #give a chance to add and update mirolib.import_opml(self,reg,opml_path2) time.sleep(15) #give a chance to add and update #expand all the folders mirolib.expand_feed_folder(self,reg,"GEEKY") mirolib.expand_feed_folder(self,reg,"FUN") #set the feeds region p = mirolib.get_podcasts_region(reg) #select multiple feeds for the folders p.click("Birchbox") added_feeds = mirolib.multi_select(self,region=p,item_list=feed_list) if len(added_feeds) > 0: added_feeds.append("Birchbox") else: self.fail("feeds not selected properly for adding to a folder") time.sleep(5) reg.m.click("New Folder") time.sleep(2) type(new_folder + "\n") time.sleep(5) feed_match = mirolib.click_podcast(self,reg,new_folder) rightClick(Location(feed_match)) if exists("Update",2): click(getLastMatch()) for feed in added_feeds: mirolib.tab_search(self,reg,title=feed,confirm_present=True) #cleanup mirolib.delete_all_podcasts(self,reg)
def test_191(self): """http://litmus.pculture.org/show_test.cgi?id=191 Add rss feed to sidebar. 1. Add ClearBits.net as a source 2. Open Netlabel Music page and add RSS feed 3. Verify feed added to the sidebar 4. Cleanup """ site_url = "http://clearbits.net" site = "ClearBits" feed = "ClearBits" reg = mirolib.AppRegions() mirolib.add_source(self,reg,site_url,site) mirolib.click_source(self,reg,site) reg.m.click("Netlabel Music") reg.m.click(testvars.clearbits_rss) mirolib.click_podcast(self,reg,site) mirolib.log_result("29","test_191 verify 1-click add site from source.") time.sleep(3) mirolib.delete_feed(self,reg,feed) mirolib.delete_site(self,reg,site)
def test_196(self): """http://litmus.pculture.org/show_test.cgi?id=196 create new empty feed folder. Litmus Test Title:: 198 - new feed folder Description: 1. Import OPML file of some feeds and folders 2. 1 feed and 1 folder 3. Delete, verify confirm dialog, and delete 4. Cleanup """ setAutoWaitTimeout(testvars.timeout) #set the search regions folder = "GREAT STUFF" reg = mirolib.AppRegions() reg.t.click("Sidebar") reg.t.click("Folder") time.sleep(2) type(folder + "\n") time.sleep(10) #give it 10 seconds to add the folder mirolib.click_podcast(self,reg,folder) mirolib.delete_feed(self,reg,"GREAT")
def test_69(self): """http://litmus.pculture.org/show_test.cgi?id=69 Add rss feed via browser. 1. Add feed The AV Club via the browser (assumes the browser is set to automatically add the feed). 2. Verify the feed is added 3. Cleanup Assumes that Miro is configured as the default application to open rss feeds in FF. """ try: reg = mirolib.AppRegions() feed = "The AV" prefs.set_autodownload(self,reg,setting="Off") url = "http://feeds.feedburner.com/theavclub/mainline" mirolib.browser_to_miro(self,reg,url) #3. verify feed added mirolib.click_podcast(self,reg,feed) finally: #cleanup mirolib.delete_feed(self,reg,feed)
def test_722(self): """http://litmus.pculture.org/show_test.cgi?id=722 delete feeds and folders confirm dialog. Litmus Test Title:: 722 - delete feeds confirm dialog Description: 1. Import OPML file of some feeds and folders 2. 1 feed and 1 folder 3. Delete, verify confirm dialog, and delete 4. Cleanup """ setAutoWaitTimeout(testvars.timeout) #set the search regions reg = mirolib.AppRegions() mirolib.delete_all_podcasts(self,reg) opml_path = os.path.join(os.getenv("PCF_TEST_HOME"),"Miro","TestData","folder-test.opml") feed = "Featured" folder = "GEEKY" feedlist = ["Google", "Make","GEEKY","Featured"] #1. Add the feeds mirolib.import_opml(self,reg,opml_path) p = mirolib.get_podcasts_region(reg) mirolib.click_podcast(self,reg,feed) #2. Select the folder too keyDown(Key.SHIFT) p.click(folder) keyUp(Key.SHIFT) #3. Delete then cancel. Verify still exists Static List type(Key.DELETE) for x in feedlist: mirolib.count_images(self,reg,img=x,region="main",num_expected=1) type(Key.ENTER) time.sleep(2) #4. Cleanup mirolib.delete_all_podcasts(self,reg) p = mirolib.get_podcasts_region(reg) for x in feedlist: if not p.exists(x): mirolib.log_result("202","test_722")
def test_197(self): """http://litmus.pculture.org/show_test.cgi?id=197 drag feeds to a folder Litmus Test Title:: 197 - drag feeds to a folder Description: 1. Import OPML file of some feeds and folders 2. drag feeds to the folder 3. verify feeds in folder 4. Cleanup """ setAutoWaitTimeout(testvars.timeout) #set the search regions mirolib.quit_miro(self) config.set_def_db_and_prefs() mirolib.restart_miro(confirm=False) time.sleep(10) reg = mirolib.AppRegions() opml_path = os.path.join(os.getenv("PCF_TEST_HOME"),"Miro","TestData","folder-test2.opml") folder = "Best Feeds" feedlist = ["Vimeo", "BirchboxTV"] #1. Add the feeds mirolib.import_opml(self,reg,opml_path) p = mirolib.get_podcasts_region(reg) for feed in feedlist: x = p.find(feed) y = p.find(folder) dragDrop(x,y) time.sleep(2) feed_match = mirolib.click_podcast(self,reg,folder) rightClick(Location(feed_match)) if exists("Update",2): click(getLastMatch()) for feed in feedlist: mirolib.tab_search(self,reg,title=feed,confirm_present=True) #cleanup mirolib.delete_all_podcasts(self,reg)
def test_198(self): """http://litmus.pculture.org/show_test.cgi?id=198 rename folder. Litmus Test Title:: 198 - rename feed folder Description: 1. Import OPML file of some feeds and folders 2. 1 feed and 1 folder 3. Delete, verify confirm dialog, and delete 4. Cleanup """ setAutoWaitTimeout(testvars.timeout) #set the search regions folder = "Great Stuff" new_name1 = "INCREDIBLE" new_name2 = "ThisSux" reg = mirolib.AppRegions() reg.t.click("Sidebar") reg.t.click("Folder") time.sleep(2) type(folder + "\n") time.sleep(10) #give it 10 seconds to add the folder mirolib.click_podcast(self,reg,feed=folder) time.sleep(3) reg.t.click("Sidebar") reg.t.click("Rename") time.sleep(2) type(new_name1 + "\n") mirolib.click_podcast(self,reg,feed=new_name1) mirolib.restart_miro() p = mirolib.get_podcasts_region(reg) if not p.exists(new_name1): self.fail("rename did not persist after restart") else: p.rightClick(new_name1) p1 = Region(p.getLastMatch().nearby(200)) p1.click("Rename") time.sleep(2) type(new_name2 + "\n") mirolib.click_podcast(self,reg,feed=new_name2) mirolib.delete_feed(self,reg,new_name2)
def test_122(self): """http://litmus.pculture.org/show_test.cgi?id=122 item click actions, normal view. 1. add 3-blip-videos feed 2. download the Joo Joo 3. verify varios item click scenerios """ reg = mirolib.AppRegions() time.sleep(5) url = "http://pculture.org/feeds_test/3blipvideos.xml" feed = "ThreeBlip" title1 = "The Joo" title2 = "York" title3 = "Accessing" mirolib.delete_feed(self,reg,feed) prefs.set_autodownload(self,reg,setting="Off") time.sleep(2) prefs.set_default_view(self,reg,setting="Standard") #add feed and download joo joo item mirolib.add_feed(self,reg,url,feed) mirolib.tab_search(self,reg,title1) if reg.m.exists("button_download.png",10): click(reg.m.getLastMatch()) mirolib.click_podcast(self,reg,feed) mirolib.tab_search(self,reg,title2,confirm_present=True) #double-click starts download doubleClick(title2) if mirolib.confirm_download_started(self,reg,title=title2) == "in_progress": mirolib.log_result("122","normal view double-click starts download") else: self.fail("normal view double-click starts download, failed") #double-click pauses download mirolib.click_podcast(self,reg,feed) doubleClick(title2) if exists("item-renderer-download-resume.png"): mirolib.log_result("122","normal view double-click pauses download") else: self.fail("normal view double-click pause download, failed") #double-click resumes download doubleClick(title2) if exists("item-renderer-download-pause.png"): mirolib.log_result("122","normal view double-click resume download") else: self.fail("normal view double-click resume download, failed") #double-click starts playback mirolib.wait_for_item_in_tab(self,reg,tab="Videos",item=title1) mirolib.click_podcast(self,reg,feed) mirolib.tab_search(self,reg,title1) doubleClick(title1) if exists(Pattern("playback_bar_video.png")): mirolib.log_result("122","normal view double-click starts playback") else: self.fail("normal view double-click start playback, failed") mirolib.verify_video_playback(self,reg) #single click thumb starts download mirolib.tab_search(self,reg,title3) if reg.m.exists("thumb-default-video.png"): print "using default thumb" click(reg.m.getLastMatch()) else: print "can't find thumb, best guess" reg.m.find(title1) click(reg.m.getLastMatch().left(50)) if mirolib.confirm_download_started(self,reg,title=title3) == "in_progress": mirolib.log_result("122","normal view click starts download") else: self.fail("normal view double-click starts download, failed") #single click thumb starts playback mirolib.click_podcast(self,reg,feed) mirolib.tab_search(self,reg,title1) if reg.m.exists("thumb-default-video.png"): print "using default thumb" click(reg.m.getLastMatch()) elif reg.m.exists("thumb-joojoo.png"): print "found joo joo thumb" click(reg.m.getLastMatch()) else: print "can't find thumb, best guess" reg.m.find(title1) click(reg.m.getLastMatch().left(50)) if exists("playback_bar_video.png"): mirolib.log_result("122","normal view double-click starts playback") else: self.fail("normal view double-click start playback, failed") mirolib.verify_video_playback(self,reg) #cleanup mirolib.delete_feed(self,reg,feed)
def test_441(self): """http://litmus.pculture.org/show_test.cgi?id=441 delete podcast item outside of miro 1. add TwoStupid feed 2. download the Flip Faceitem 3. restart miro 4. delete the item 5. restart miro 6. verify item still deleted """ reg = mirolib.AppRegions() remember = False try: prefs.set_preference_checkbox(self,reg,tab="General",option="When starting",setting="on") remember = True except: remember = False type(Key.ESC) #close the dialog if it didn't work time.sleep(5) url = "http://pculture.org/feeds_test/2stupidvideos.xml" feed = "TwoStupid" title = "Flip" # item title updates when download completes #add feed and download flip face item mirolib.add_feed(self,reg,url,feed) mirolib.toggle_normal(reg) mirolib.tab_search(self,reg,title) if reg.m.exists("button_download.png",10): click(reg.m.getLastMatch()) mirolib.wait_for_item_in_tab(self,reg,tab="Videos",item=title) mirolib.click_podcast(self,reg,feed) mirolib.tab_search(self,reg,title) reg.m.click(title) filepath = mirolib.store_item_path(self,reg) if os.path.exists(filepath): print "able to verify on os level" found_file = True mirolib.quit_miro(self,reg) mirolib.restart_miro() if remember == True and reg.m.exists("title",15): #check the remember last tab setting mirolib.log_result("698","test_441") else: mirolib.click_podcast(self,reg,feed) mirolib.tab_search(self,reg,title) reg.m.click(title) type(Key.DELETE) if found_file == True: if os.path.exists(filepath): self.fail("file not deleted from filesystem") else: mirolib.quit_miro(self,reg) mirolib.restart_miro() mirolib.click_podcast(self,reg,feed) mirolib.tab_search(self,reg,term) if not reg.m.exists(Pattern("button_download.png")): self.fail("no download button, file not deleted") else: reg.m.click(Pattern("button_download.png")) if mirolib.confirm_download_started(self,reg,title) != "in_progress": self.fail("item not properely deleted") #cleanup mirolib.delete_feed(self,reg,feed)