def test_709(self): """http://litmus.pculture.org/show_test.cgi?id=709 create playlist from library search. 1. add a watched folder to get some items in the db 2. search in music tab 3. click Add to Playist button 4. accept name and verify created """ watched_feed = "TestData" playlist = "Johnson" item_list = ["Pancakes","Horizon"] reg = MiroRegions() miro = MiroApp() p = miro.get_podcasts_region(reg) miro.click_sidebar_tab(reg, "Music") miro.tab_search(reg, playlist) reg.mtb.click(Pattern("button_save_as_playlist.png")) time.sleep(3) type(Key.ENTER) miro.click_playlist(reg, playlist.upper()) miro.toggle_normal(reg) for title in item_list: miro.tab_search(reg, title,confirm_present=True)
def test_225(self): """http://litmus.pculture.org/show_test.cgi?id=225 add several items to a new playlist. 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 """ watched_feed = "TestData" playlist = "MIX LIST" reg = MiroRegions() miro = MiroApp() miro.click_sidebar_tab(reg, "Podcasts") miro.toggle_normal(reg) miro.tab_search(reg, watched_feed) reg.m.click(Pattern("sort_name_normal.png")) item_list = ["Lego", "Pancake", "Deerhunter"] keyDown(Key.SHIFT) time.sleep(1) reg.m.click("Lego") reg.m.click("Deerhunter") keyUp(Key.SHIFT) miro.add_playlist(reg, playlist,style="shortcut") miro.toggle_normal(reg) for title in item_list: miro.tab_search(reg, title,confirm_present=True)
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_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.close_prefs() url = "http://qa.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) reg.m.find(title) reg.m.click(title) reg.mtb.click("tabsearch_clear.png") filepath = miro.store_item_path(reg) if os.path.exists(filepath): print "able to verify on os level" found_file = True 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)
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_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 = MiroRegions() miro = MiroApp() 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"], ] try: #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, title) if reg.m.exists("button_download.png",10): click(reg.m.getLastMatch()) miro.wait_for_item_in_tab(reg, "Videos",item=title) miro.click_podcast(reg, feed) miro.tab_search(reg, title) reg.m.click(title) miro.edit_item_video_metadata_bulk(reg, new_metadata_list) time.sleep(2) miro.click_sidebar_tab(reg, "Videos") miro.tab_search(reg, title) reg.mtb.click("Clip") if reg.m.exists(title): reg.mtb.click("All") else: self.fail("item not found in Clips filter") finally: miro.quit_miro() myLib.config.set_def_db_and_prefs()
def test_108(self): """http://litmus.pculture.org/show_test.cgi?id=108 playback through unplayed items. 1. add a feed url feed of small items 2. download a few items 3. verify unplayed - playback through list 4. verify marked as unplayed. """ url_path = os.path.join(os.getenv("PCF_TEST_HOME"),"Miro","TestData","ShortCats.xml") url = "file:///"+url_path feed = "Short Cats" ## url = "http://qa.pculture.org/feeds_test/2stupidvideos.xml" ## feed = "TWO STUPID" reg = MiroRegions() miro = MiroApp() #Set Global Preferences miro.open_prefs(reg) prefs = PreferencesPanel() playback_tab = prefs.open_tab("Playback") playback_tab.play_continuous("on", "Podcast") playback_tab.close_prefs() miro.add_feed(reg, url, feed) miro.set_podcast_autodownload(reg, setting="All") time.sleep(15) miro.set_podcast_autodownload(reg, setting="Off") if reg.s.exists("Downloading"): reg.s.waitVanish("Downloading") miro.click_sidebar_tab(reg, "Videos") miro.toggle_normal(reg) reg.m.wait("item_play_unplayed.png") if reg.m.exists("item_play_unplayed.png"): find(Pattern("sort_name_normal.png")) doubleClick(getLastMatch().below(100)) wait(Pattern("playback_bar_video.png"),15) else: self.fail("no unplayed badges found") if exists(Pattern("playback_bar_video.png")): print "playback started" time.sleep(60) waitVanish(Pattern("playback_bar_video.png")) if reg.m.exists("item_play_unplayed.png"): self.fail("items not marked as unplayed")
def test_363(self): """http://litmus.pculture.org/show_test.cgi?id=363 edit item metadata 1. add Static List feed 2. download the Earth Eats item 3. Edit item metadata 4. Verify item played as audio item """ reg = MiroRegions() miro = MiroApp() time.sleep(5) url = "http://qa.pculture.org/feeds_test/list-of-guide-feeds.xml" feed = "Static" term = "Earth Eats" title = "Mushroom" new_type = "Video" #Set Global Preferences miro.open_prefs(reg) prefs = PreferencesPanel() general_tab = prefs.open_tab("General") general_tab.show_audio_in_music("on") general_tab.close_prefs() 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, title=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") miro.edit_item_metadata(reg, meta_field="about",meta_value="hoovercraft full of eels") miro.tab_search(reg, "hoovercraft eels") if not reg.m.exists(title): self.fail("can not verify description edited") miro.delete_feed(reg, feed)
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_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 """ #set the search regions reg = MiroRegions() miro = MiroApp() url = "http://pculture.org/feeds_test/2stupidvideos.xml" feed = "TWO STUPID" #1. Add the feed and start dl miro.add_feed(reg, url,feed) time.sleep(3) miro.toggle_normal(reg) # miro.count_images(reg, "item-context-button.png",region="mainright",num_expected=2) miro.set_podcast_autodownload(reg, setting="All") miro.wait_for_item_in_tab(reg, "videos","Flip") miro.wait_for_item_in_tab(reg, "videos","Dinosaur") miro.click_podcast(reg, feed) type(Key.DELETE) miro.remove_confirm(reg, action="keep") miro.click_sidebar_tab(reg, "videos") miro.tab_search(reg, "Flip",confirm_present=True) miro.tab_search(reg, "Dinosaur",confirm_present=True) #4. cleanup miro.delete_items(reg, "Flip","videos") miro.delete_items(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 """ #set the search regions 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.default_view_setting("Standard") podcasts_tab.close_prefs() url = "http://pculture.org/feeds_test/list-of-guide-feeds.xml" feed = "Static" feedlist = ["Center", "Earth"] #1. Add the feed and start dl miro.add_feed(reg, url,feed) for f in feedlist: miro.tab_search(reg, f) self.assertTrue(reg.m.exists("Add this")) reg.m.click("Add this") time.sleep(4) miro.tab_search(reg, "") miro.toggle_normal(reg) p = miro.get_podcasts_region(reg) miro.click_sidebar_tab(reg, "Music") miro.click_podcast(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") miro.remove_confirm(reg, "cancel") p = miro.get_podcasts_region(reg) time.sleep(5) self.assertTrue(p.exists("Static",5)) #4. Cleanup feedlist.append("Static") for x in feedlist: print x miro.delete_feed(reg, x)