Exemplo n.º 1
0
 def is_artists_type_exists():
     if Properties.if_ios():
         return WebLink(
             Properties.get_search_page_locator_map().get_locator(
                 SearchPageLocators.artistsSearchType)).is_presented()
     return SearchPage.swipe_down_to_element(
         WebLink(Properties.get_search_page_locator_map().get_locator(
             SearchPageLocators.artistsSearchType)))
Exemplo n.º 2
0
 def get_current_filter_type():
     if Properties.if_ios():
         element = WebLink(
             Properties.get_search_page_locator_map().get_locator(
                 SearchPageLocators.currentSearchType))
         return element.get_elements()[2].get_attribute("name")
     return WebLink(Properties.get_search_page_locator_map().get_locator(
         SearchPageLocators.currentSearchType)).get_text()
Exemplo n.º 3
0
 def get_artist_from_search(number):
     artists = WebLink(Properties.get_search_page_locator_map().get_locator(
         SearchPageLocators.searchArtist))
     artist = artists.get_elements()
     if len(artist) <= number:
         return ''
     if Properties.if_ios():
         return artist[number].get_attribute('name')
     return artist[number].text
Exemplo n.º 4
0
 def is_filter_type_exists(filter_type):
     if Properties.if_ios():
         element = WebLink(
             Properties.get_search_page_locator_map().get_locator(
                 SearchPageLocators.filterSearchType))
         element.locator.locator = element.locator.locator.replace(
             "TEXT_TO_CHANGE", filter_type)
         return element.is_presented()
     return SearchPage.swipe_down_to_element(
         WebLink(Properties.get_search_page_locator_map().get_locator(
             SearchPageLocators.artistsSearchType)))
Exemplo n.º 5
0
 def is_search_result_exists(name):
     if Properties.if_ios():
         return WebLink(
             Properties.get_play_list_page_locator_map().get_locator(
                 SearchPageLocators.resultChooser)).is_presented()
     return SearchPage.swipe_down_to_element(
         SearchPage.return_search_result(name).click())
Exemplo n.º 6
0
 def get_playlist_content():
     """:rtype: list of framework_entries.Track.Track"""
     if Properties.if_ios():
         SearchPage.swipe_to_bottom()
     artists = WebLink(Properties.get_search_page_locator_map().get_locator(
         SearchPageLocators.playlistArtist))
     artists_list = artists.get_elements()
     size = len(artists_list)
     songs = []
     if not Properties.if_ios():
         tracks = WebLink(
             Properties.get_search_page_locator_map().get_locator(
                 SearchPageLocators.playlistTrack))
         tracks_list = tracks.get_elements()
         for i in range(size):
             songs.append(
                 Track.Track(artists_list[i].text, tracks_list[i].text))
     else:
         for i in range(size):
             songs.append(Track.Track(artists_list[i].text, ""))
     return songs
Exemplo n.º 7
0
 def get_next_filter_type():
     return WebLink(Properties.get_search_page_locator_map().get_locator(
         SearchPageLocators.nextSearchType)).get_text()
Exemplo n.º 8
0
 def return_artist_from_playlist(number):
     # 0 Will be played when play_this_playlist clicked, 1 is first in next list
     artists = WebLink(Properties.get_search_page_locator_map().get_locator(
         SearchPageLocators.playlistArtist))
     artist = artists.get_elements()[number]
     return artist.text
Exemplo n.º 9
0
 def return_track_from_playlist(number):
     # 0 Will be played when play_this_playlist clicked, 1 is first in next list
     tracks = WebLink(Properties.get_search_page_locator_map().get_locator(
         SearchPageLocators.playlistTrack))
     track = tracks.get_elements()[number]
     return track.text
Exemplo n.º 10
0
 def return_top_albums_section():
     return WebLink(Properties.get_more_info_page_locator_map().get_locator(
         MoreInfoPageLocators.topAlbums))
Exemplo n.º 11
0
 def get_album_from_search(number):
     artists = WebLink(Properties.get_search_page_locator_map().get_locator(
         SearchPageLocators.searchAlbum))
     artist = artists.get_elements()[number]
     return artist.text
Exemplo n.º 12
0
 def play_next_artist(number=0):
     if not Properties.if_ios():
         PlayListPage._swipe_to_next_artist()
     artists = WebLink(Properties.get_play_list_page_locator_map().get_locator(PlayListPageLocators.nextTracks))
     artist = artists.get_elements()[number]
     artist.click()
Exemplo n.º 13
0
 def next_track(number=0):
     if not Properties.if_ios():
         PlayListPage._swipe_to_next_track()
     tracks = WebLink(Properties.get_play_list_page_locator_map().get_locator(PlayListPageLocators.nextTracks))
     track = tracks.get_elements()[number]
     return track.text
Exemplo n.º 14
0
 def last_track():
     PlayListPage._swipe_to_last_track()
     tracks = WebLink(Properties.get_play_list_page_locator_map().get_locator(PlayListPageLocators.prevTracks))
     track = tracks.get_elements()[tracks.get_elements().__len__() - 1]
     return track.text
Exemplo n.º 15
0
 def last_artist():
     if not Properties.if_ios():
         PlayListPage._swipe_to_last_artist()
     artists = WebLink(Properties.get_play_list_page_locator_map().get_locator(PlayListPageLocators.prevArtists))
     artist = artists.get_elements()[artists.get_elements().__len__() - 1]
     return artist.text
Exemplo n.º 16
0
 def swipe_to_bottom():
     SearchPage.swipe_down_to_element(
         WebLink(Properties.get_search_page_locator_map().get_locator(
             SearchPageLocators.pageBottom)))
Exemplo n.º 17
0
 def is_current_filter_type_visible():
     return WebLink(Properties.get_search_page_locator_map().get_locator(
         SearchPageLocators.currentSearchType)).is_visible()
Exemplo n.º 18
0
 def return_description():
     return WebLink(Properties.get_more_info_page_locator_map().get_locator(
         MoreInfoPageLocators.artistDescription))