def test_721(self): """http://litmus.pculture.org/show_test.cgi?id=721 Menu New Search Watched 1. Add list of guide feeds (Static List) 2. From Sidebar -> New Search feed, create saved search channel 3. Verify Search saved 4. Cleanup """ reg = MiroRegions() miro = MiroApp() feed = "TestData" term = "monkey" folder_path = os.path.join(os.getenv("PCF_TEST_HOME"),"Miro","TestData","WatchTest") #1. add feed miro.add_watched_folder(reg, folder_path) if reg.s.exists("WatchTest"): miro.log_result("678","test_721") #2. search miro.tab_search(reg, term) miro.new_search_feed(reg, term,radio="Podcast",source=feed,watched=True) #Remove Watched Folder miro.open_prefs(reg) prefs = PreferencesPanel() folder_tab = prefs.open_tab("Folders") folder_tab.remove_watched_folder("ArtTest") folder_tab.close_prefs()
def test_679(self): """http://litmus.pculture.org/show_test.cgi?id=679 create a playlist via menu. Also verifies test_222, remove playlist (via context menu) 1. add a watched folder to get some items in the db 2. select the items and create a new playlist from menu 3. verify items in list 4. repeat with context menu and verify """ playlist = "EMPTY LIST" reg = MiroRegions() miro = MiroApp() miro.add_playlist(reg, playlist,style="menu") p = miro.get_playlists_region(reg) list_loc = miro.click_playlist(reg, playlist) rightClick(Location(list_loc)) p.click("Remove") miro.remove_confirm(reg, "remove") time.sleep(2) if p.exists(playlist): print "remove failed" else: miro.log_result("222","verified remove playlist via context menu")
def test_458(self): """http://litmus.pculture.org/show_test.cgi?id=458 edit blank item description 1. add TWO STUPID feed 2. download the Flip Faceitem 3. Edit item description 4. Cleanup """ reg = MiroRegions() miro = MiroApp() time.sleep(5) url = "http://pculture.org/feeds_test/2stupidvideos.xml" feed = "TWO STUPID" title = "Flip" # item title updates when download completes #add feed and download flip face item miro.add_feed(reg, url,feed) miro.toggle_normal(reg) miro.tab_search(reg, title) if reg.m.exists("button_download.png",10): click(reg.m.getLastMatch()) miro.wait_for_item_in_tab(reg, "Videos",item=title) reg.m.click(title) miro.edit_item_metadata(reg, meta_field="about",meta_value="Blank description edited") miro.tab_search(reg, "blank description") if reg.m.exists(title): miro.log_result("656","test_458") else: miro.log_result("656","test_458",status="fail") #cleanup miro.delete_feed(reg, feed)
def test_728(self): """http://litmus.pculture.org/show_test.cgi?id=728 edit metadata for mulitple items 1. add Static List feed 2. download the Earth Eats item 3. Edit item metadata """ reg = MiroRegions() miro = MiroApp() miro.open_prefs(reg) prefs = PreferencesPanel() general_tab = prefs.open_tab("General") general_tab.show_audio_in_music("on") general_tab.close_prefs() url = "http://qa.pculture.org/feeds_test/list-of-guide-feeds.xml" feed = "Static" term = "Earth Eats" title = "Mushroom" # item title updates when download completes new_type = "Video" edit_itemlist = [ ["name", "Earth Day Everyday", "647"], ["artist", "Oliver and Katerina", "648"], ["album", "Barki Barks", "649"], ["genre", "family", "650"], ["track_num" ,"1", "673"], ["track_of" ,"2", "673"], ["year", "2010", "655"], ["rating", "5", "651"], ] #start clean miro.delete_feed(reg, feed) #add feed and download earth eats item miro.add_feed(reg, url,feed) miro.toggle_normal(reg) miro.tab_search(reg, term) if reg.m.exists("button_download.png",10): click(reg.m.getLastMatch()) miro.wait_for_item_in_tab(reg, "Music",item=title) reg.m.find(title) reg.m.click(title) reg.mtb.click("tabsearch_clear.png") for x in edit_itemlist: miro.edit_item_metadata(reg, meta_field=x[0],meta_value=x[1]) try: miro.log_result(x[2],"test_647") finally: time.sleep(2) if not miro.tab_search(reg, "Earth Day",confirm_present=True) == True: self.fail("new title not saved") #cleanup miro.delete_feed(reg, feed)
def test_24(self): """http://litmus.pculture.org/show_test.cgi?id=24 edit remembered search. 1. Add 2-stupid-videos feed 2. Perform a search 3. Type in search box the delete key 4. Cleanup """ reg = MiroRegions() miro = MiroApp() url = "http://pculture.org/feeds_test/2stupidvideos.xml" feed = "TWO STUPID" term = "Face" title = "Flip" #1. add feed miro.add_feed(reg, url,feed) miro.set_podcast_autodownload(reg, setting="All") #2. search miro.tab_search(reg, term) self.assertTrue(reg.m.exists(title)) url2 = "http://pculture.org/feeds_test/list-of-guide-feeds.xml" feed2 = "Static" term2 = "FilmWeek" miro.add_feed(reg, url2,feed2) miro.tab_search(reg, "Brooklyn") miro.wait_for_item_in_tab(reg, "Videos",title) reg.m.click(title) type(Key.ENTER) time.sleep(2) type(" ") self.assertTrue(exists("playback_controls.png")) miro.shortcut("d") reg.s.click(feed2) self.assertTrue(reg.mtb.exists("BROOKLYN")) miro.tab_search(reg, term2) reg.mtb.click("button_save_as_podcast.png") miro.click_last_podcast(reg) miro.tab_search(reg, term2,confirm_present=True) miro.clear_search(reg) time.sleep(3) if not reg.mtb.exists(term2.upper()): miro.log_result("324","test_24",status="pass") #4. cleanup miro.delete_feed(reg, "stupid") miro.click_last_podcast(reg) miro.delete_current_selection(reg) miro.delete_feed(reg, "Static List")
def test_322(self): """http://litmus.pculture.org/show_test.cgi?id=322 search and save as a podcast 1. Perform a search 2. Click off the tab 3. Click back and verify the search is remembered. 4. Cleanup """ setAutoWaitTimeout(60) reg = MiroRegions() miro = MiroApp() #Set Global Preferences miro.open_prefs(reg) prefs = PreferencesPanel() podcasts_tab = prefs.open_tab("Podcasts") podcasts_tab.autodownload_setting("Off") podcasts_tab.close_prefs() searches = {"blip": "python", "YouTube": "cosmicomics", "Revver": "Beiber", "Yahoo": "Canada", "DailyMotion": "Russia", "Metavid": "africa", "Mininova": "Creative Commons", "Goog": "Toronto"} for engine, term in searches.iteritems(): miro.click_sidebar_tab(reg, "search") miro.search_tab_search(reg, term, engine) time.sleep(10) reg.mtb.click("button_save_as_podcast.png") if engine == "blip": saved_search = engine else: saved_search = engine +" for" time.sleep(10) #give some time for everything to load up miro.click_podcast(reg, saved_search) miro.shortcut("r") time.sleep(5) miro.get_podcasts_region(reg) miro.tab_search(reg, term) try: self.assertTrue(reg.m.exists(engine)) miro.delete_feed(reg, engine) except: miro.log_result("322","test 322, failed for " +engine+": "+term, status="fail") #cleanup for x in searches.keys(): miro.delete_feed(reg, x)
def test_620(self): """http://litmus.pculture.org/show_test.cgi?id=620 dl youtube video and convert. 1. Download youtube video 2. Convert to video formats 3. Verify playback 4. Convert to audio formats 5. Verify playback 6. Cleanup """ reg = MiroRegions() miro = MiroApp() # 1. Download youtube vidoe vid_url = "http://www.youtube.com/watch?v=baJ43ByylbM&feature=fvw" item_title = "Zoom" reg.tl.click("File") reg.tl.click("Download from") time.sleep(4) type(vid_url) time.sleep(2) type("\n") miro.confirm_download_started(reg, item_title) miro.wait_for_item_in_tab(reg, "videos",item_title) if reg.m.exists(item_title,3): miro.log_result("9","test_620 file external download verified.") reg.m.click(item_title) # 2. Convert to audio formats try: aconvertList = ("MP3","Vorbis") for x in aconvertList: miro.convert_file(reg, x) time.sleep(2) miro.click_sidebar_tab(reg, "Converting") miro.wait_conversions_complete(reg, item_title,x) # 3. Verify playback miro.click_sidebar_tab(reg, "music") aplaybackList = ("MP3",) for x in aplaybackList: miro.tab_search(reg, "Converted to "+str(x),False) if reg.m.exists(Pattern("item_play_unplayed.png")): doubleClick(reg.m.getLastMatch()) self.assertTrue(miro.verify_audio_playback(reg, title)) miro.stop_audio_playback(reg, title) else: self.fail("converted item not found") except FindFailed, debugging: self.verificationErrors.append(debugging)
def test_221(self): """http://litmus.pculture.org/show_test.cgi?id=221 rename playlist. """ playlist = "TAB LIST" reg = MiroRegions() miro = MiroApp() miro.add_playlist(reg, playlist,style="tab") miro.log_result("708","test_221 - added playlist via Playlist top level tab") list_loc = miro.click_playlist(reg, playlist) print list_loc rightClick(Location(list_loc)) type(Key.DOWN) type(Key.ENTER) time.sleep(2) type("NEW NAME \n") miro.click_playlist(reg, playlist="NEW NAME")
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 """ #set the search regions reg = MiroRegions() miro = MiroApp() url = "http://bluesock.org/~willg/cgi-bin/newitemsfeed.cgi" feed = "my feed" miro.add_feed(reg, url,feed) miro.get_podcasts_region(reg) miro.tab_search(reg, "my feed") miro.toggle_list(reg) miro.count_images(reg, img="my feed",region="list",num_expected=5) miro.click_podcast(reg, feed) miro.shortcut("r") time.sleep(10) miro.get_podcasts_region(reg) if miro.count_images(reg, img="my feed",region="list",num_expected=10) == 10: miro.log_result("99","test_92") #verifies update podcast shortcut miro.click_podcast(reg, feed) for x in range(0,3): miro.shortcut("r") time.sleep(3) miro.open_podcast_settings(reg) miro.change_podcast_settings(reg, option="Podcast Items",setting="Keep 0") time.sleep(2) miro.get_podcasts_region(reg) miro.count_images(reg, img="my feed",region="list",num_expected=5) #4. cleanup miro.delete_feed(reg, "my 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(myLib.testvars.timeout) #set the search regions reg = MiroRegions() miro = MiroApp() miro.delete_all_podcasts(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 miro.import_opml(reg, opml_path) p = miro.get_podcasts_region(reg) miro.click_podcast(reg, feed) #2. Select the folder too keyDown(Key.SHIFT) p.click(folder) keyUp(Key.SHIFT) #3. Delete type(Key.DELETE) for x in feedlist: miro.count_images(reg, img=x,region="main",num_expected=1) type(Key.ENTER) time.sleep(2) #4. Cleanup miro.delete_all_podcasts(reg) p = miro.get_podcasts_region(reg) for x in feedlist: if not p.exists(x): miro.log_result("202","test_722")
def test_653(self): """http://litmus.pculture.org/show_test.cgi?id=653 edit album art 1. add watched folder 2. Edit artwork for 1 item 3. Edit artwork for multiple items 4. Cleanup """ reg = MiroRegions() miro = MiroApp() time.sleep(5) folder_path = os.path.join(os.getenv("PCF_TEST_HOME"),"Miro","TestData","ArtTest") title = "Pancakes" title2 = "summer" title3="deerhunter" #1. add watched folder miro.add_watched_folder(reg, folder_path) if reg.s.exists("ArtTest"): click(reg.s.getLastMatch()) miro.log_result("157","test_653") art_file = os.path.join(os.getenv("PCF_TEST_HOME"),"Miro","TestData","album_art1.jpg") #add feed and download flip face item miro.toggle_normal(reg) miro.tab_search(reg, title) try: reg.m.find(title) reg.m.click(title) reg.mtb.click("tabsearch_clear.png") miro.edit_item_metadata(reg, meta_field="art",meta_value=art_file) ## Verify new image here: reg.m.find(Pattern("album_art1.png")) finally: miro.open_prefs(reg) prefs = PreferencesPanel() folder_tab = prefs.open_tab("Folders") folder_tab.remove_watched_folder("ArtTest") folder_tab.close_prefs()
def test_79(self): """http://litmus.pculture.org/show_test.cgi?id=79 Search - New Search Podcast: Engine Steps to Perform: 1. Select Sidebar -> New Search Podcast 2. Enter a search term 3. Select the Search Engine radio button 4. Select a search engine from the pulldown menu 5. Select Create Podcast """ reg = MiroRegions() miro = MiroApp() #Set Global Preferences miro.open_prefs(reg) prefs = PreferencesPanel() podcasts_tab = prefs.open_tab("Podcasts") podcasts_tab.autodownload_setting("Off") podcasts_tab.close_prefs() searches = { "Yahoo": "Canada", "DailyMotion": "Ontario", "YouTube": "toronto"} radio = "Search" for source, term in searches.iteritems(): miro.new_search_feed(reg, term,radio,source,defaults=False,watched=False) time.sleep(10) #give some time for everything to load up miro.click_podcast(reg, source) miro.shortcut("r") time.sleep(5) miro.tab_search(reg, term) try: self.assertTrue(reg.m.exists(source)) miro.delete_feed(reg, source) except: miro.log_result("79","test_79, failed for " +source+": "+term, status="fail") #cleanup for x in searches.keys(): miro.delete_feed(reg, x)
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 = MiroRegions() miro = MiroApp() miro.add_source(reg, site_url,site) miro.click_source(reg, site) reg.m.click("Netlabel Music") reg.m.click(myLib.testvars.clearbits_rss) miro.click_podcast(reg, site) miro.log_result("29","test_191 verify 1-click add site from source.") time.sleep(3) miro.delete_feed(reg, feed) miro.delete_site(reg, site)
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 = MiroRegions() miro = MiroApp() time.sleep(5) url = "http://pculture.org/feeds_test/3blipvideos.xml" feed = "ThreeBlip" title1 = "The Joo" title2 = "York" title3 = "Accessing" miro.delete_feed(reg, feed) miro.open_prefs(reg) prefs = PreferencesPanel() podcasts_tab = prefs.open_tab("Podcasts") podcasts_tab.autodownload_setting("Off") podcasts_tab.default_view_setting("Standard") podcasts_tab.close_prefs() #add feed and download joo joo item miro.add_feed(reg, url,feed) miro.tab_search(reg, title1) if reg.m.exists("button_download.png",10): click(reg.m.getLastMatch()) miro.click_podcast(reg, feed) miro.tab_search(reg, title2,confirm_present=True) #double-click starts download doubleClick(title2) if miro.confirm_download_started(reg, title=title2) == "in_progress": miro.log_result("122","normal view double-click starts download") else: self.fail("normal view double-click starts download, failed") #double-click pauses download miro.click_podcast(reg, feed) doubleClick(title2) if exists("item-renderer-download-resume.png"): miro.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"): miro.log_result("122","normal view double-click resume download") else: self.fail("normal view double-click resume download, failed") #double-click starts playback miro.wait_for_item_in_tab(reg, tab="Videos",item=title1) miro.click_podcast(reg, feed) miro.tab_search(reg, title1) doubleClick(title1) if exists(Pattern("playback_bar_video.png")): miro.log_result("122","normal view double-click starts playback") else: self.fail("normal view double-click start playback, failed") miro.verify_video_playback(reg) #single click thumb starts download miro.tab_search(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 miro.confirm_download_started(reg, title=title3) == "in_progress": miro.log_result("122","normal view click starts download") else: self.fail("normal view double-click starts download, failed") #single click thumb starts playback miro.click_podcast(reg, feed) miro.tab_search(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"): miro.log_result("122","normal view double-click starts playback") else: self.fail("normal view double-click start playback, failed") miro.verify_video_playback(reg) #cleanup miro.delete_feed(reg, feed)
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 = MiroRegions() miro = MiroApp() time.sleep(5) url = "http://pculture.org/feeds_test/3blipvideos.xml" feed = "ThreeBlip" title1 = "The Joo" title2 = "York" title3 = "Accessing" miro.delete_feed(reg, feed) #Set Global Preferences miro.open_prefs(reg) prefs = PreferencesPanel() podcasts_tab = prefs.open_tab("Podcasts") podcasts_tab.autodownload_setting("Off") podcasts_tab.default_view_setting("List") podcasts_tab.close_prefs() time.sleep(2) #add feed and download joo joo item miro.add_feed(reg, url,feed) miro.tab_search(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"): miro.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"): miro.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"): miro.log_result("122","list view double-click resumes download") else: self.fail("list view double-click resume download, failed") #double-click starts playback miro.wait_for_item_in_tab(reg, tab="Videos",item=title1) miro.click_podcast(reg, feed) miro.tab_search(reg, title1) doubleClick(title1) if exists(Pattern("playback_bar_video.png")): miro.log_result("122","list view double-click starts playback") else: self.fail("list view double-click start playback, failed") miro.verify_video_playback(reg) #cleanup miro.delete_feed(reg, feed)
def test_441(self): """http://litmus.pculture.org/show_test.cgi?id=441 delete podcast item outside of miro 1. add TWO STUPID feed 2. download the Flip Faceitem 3. restart miro 4. delete the item 5. restart miro 6. verify item still deleted """ reg = MiroRegions() miro = MiroApp() #Set Global Preferences miro.open_prefs(reg) prefs = PreferencesPanel() general_tab = prefs.open_tab("General") general_tab.remember_last_screen_on_startup("on") general_tab.close_prefs() url = "http://pculture.org/feeds_test/2stupidvideos.xml" feed = "TWO STUPID" title = "Flip" # item title updates when download completes #add feed and download flip face item miro.add_feed(reg, url,feed) miro.toggle_normal(reg) miro.tab_search(reg, title) if reg.m.exists("button_download.png",10): click(reg.m.getLastMatch()) miro.wait_for_item_in_tab(reg, tab="Videos",item=title) miro.click_podcast(reg, feed) miro.tab_search(reg, title) reg.m.click(title) filepath = miro.store_item_path(reg) if os.path.exists(filepath): print "able to verify on os level" found_file = True miro.quit_miro() miro.restart_miro() if reg.m.exists("title",15): #check the remember last tab setting miro.log_result("698","test_441") else: miro.click_podcast(reg, feed) miro.tab_search(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: miro.quit_miro() miro.restart_miro() miro.click_podcast(reg, feed) miro.tab_search(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 miro.confirm_download_started(reg, title) != "in_progress": self.fail("item not properely deleted") #cleanup miro.delete_feed(reg, feed)