Exemplo n.º 1
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.º 2
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.º 3
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.º 4
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.º 5
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.º 6
0
 def get_next_filter_type():
     return WebLink(Properties.get_search_page_locator_map().get_locator(
         SearchPageLocators.nextSearchType)).get_text()
Exemplo n.º 7
0
 def search_track(search_string):
     InputField(Properties.get_search_page_locator_map().get_locator(
         SearchPageLocators.searchInput)).send_keys(search_string)
     if not Properties.if_ios():
         SearchPage.click_search_button_on_keyboard()
Exemplo n.º 8
0
 def click_back():
     Button(Properties.get_search_page_locator_map().get_locator(
         SearchPageLocators.back)).click()
Exemplo n.º 9
0
 def click_first_result():
     Button(Properties.get_search_page_locator_map().get_locator(
         SearchPageLocators.clickFirstResult)).click()
Exemplo n.º 10
0
 def click_learn_more_alert_popup():
     return Button(Properties.get_search_page_locator_map().get_locator(
         SearchPageLocators.learnMorePopUpAlert)).click()
Exemplo n.º 11
0
 def play_this_album():
     Button(Properties.get_search_page_locator_map().get_locator(
         SearchPageLocators.playThisAlbum)).click()
Exemplo n.º 12
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.º 13
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.º 14
0
 def is_current_filter_type_visible():
     return WebLink(Properties.get_search_page_locator_map().get_locator(
         SearchPageLocators.currentSearchType)).is_visible()
Exemplo n.º 15
0
 def click_likes():
     Button(Properties.get_search_page_locator_map().get_locator(
         SearchPageLocators.likes)).click()
Exemplo n.º 16
0
 def return_search_option(int_x):
     locator = Properties.get_search_page_locator_map().get_locator(
         SearchPageLocators.clickXResult)
     locator.locator = locator.locator.replace("TEXT_TO_CHANGE", int_x)
     return Button(locator)
Exemplo n.º 17
0
 def return_filter_option(name):
     locator = Properties.get_search_page_locator_map().get_locator(
         SearchPageLocators.filterChooser)
     locator.locator = locator.locator.replace("TEXT_TO_CHANGE", name)
     return Button(locator)
Exemplo n.º 18
0
 def choose_filter(name):
     Button(Properties.get_search_page_locator_map().get_locator(
         SearchPageLocators.filter)).click()
     SearchPage.return_filter_option(name).click()
Exemplo n.º 19
0
 def swipe_to_bottom():
     SearchPage.swipe_down_to_element(
         WebLink(Properties.get_search_page_locator_map().get_locator(
             SearchPageLocators.pageBottom)))
Exemplo n.º 20
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.º 21
0
 def return_play_this_playlist_button():
     return Button(Properties.get_search_page_locator_map().get_locator(
         SearchPageLocators.playThisPlaylist))
Exemplo n.º 22
0
 def click_ok_alert_popup():
     return Button(Properties.get_search_page_locator_map().get_locator(
         SearchPageLocators.okPopUpAlert)).click()