def test_search(search_dialogue):
    search_string = "Daft Punk"
    SearchPage.search_track(search_string)
    time.sleep(5)
    actual = SearchPage.get_artist_from_search(0).__contains__(search_string) or SearchPage.get_album_from_search(
        0).__contains__(search_string)
    assert actual, "No search string in search result"
    assert SearchPage.get_artist_from_search(0).__contains__(search_string), "No search string in search result"
Ejemplo n.º 2
0
def search_dialogue():
    PlayListPage.click_on_search()
    yield
    while not PlayListPage.is_this_a_play_list_page():
        if Properties.if_ios():
            SearchPage.click_back()
        else:
            SearchPage.back()
        time.sleep(1)
Ejemplo n.º 3
0
def test_search_filters(search_dialogue):
    SearchPage.search_track("P")
    SearchPage.back()
    time.sleep(5)
    assert SearchPage.get_current_filter_type(
    ) == "albums", "Wrong current filter type"
    assert SearchPage.is_artists_type_exists(), "Missing Artists filter type"
    assert SearchPage.is_tracks_type_exists(), "Missing Tracks filter type"
    assert SearchPage.get_current_filter_type(
    ) == "artists", "Wrong current filter type"
    SearchPage.swipe_to_bottom()
def test_search_triggered_modal():
    # add fixture to force app out of 'search' page if previous test fails
    PlayListPage.click_on_search()
    search_text = "gold on the ceiling"
    SearchPage.search_track(search_text)
    SearchPage.choose_filter('track')
    SearchPage.is_filter_type_exists('tracks')
    SearchPage.is_search_result_exists('Gold on The Ceiling')
    SearchPage.click_first_result()
    assert PlayListPage.is_alert_present(
    ), "Error, no alert popup for prev tracks"
    PlayListPage.alert_accept_alt()
    assert text_utils.smart_compare(PlayListPage.get_alert_text(),
                                    "You'll need an Rdio Unlimited account to request a specific song. Visit"
                                    " rdio.com to upgrade. Meanwhile, Cone will play something similar."), "Wrong " \
                                                                                                           "alert " \
                                                                                                           "message"
Ejemplo n.º 5
0
def play_x_rdio_playlist(int_x='5'):
    PlayListPage.click_on_search()
    SearchPage.click_search_result_x(int_x)
    tracks = SearchPage.get_playlist_content()
    SearchPage.swipe_to_play_this_playlist()
    SearchPage.play_this_playlist()
    return tracks
Ejemplo n.º 6
0
def play_likes_playlist():
    PlayListPage.click_on_search()
    SearchPage.click_likes()
    tracks = SearchPage.get_playlist_content()
    SearchPage.swipe_to_play_this_playlist()
    SearchPage.play_this_playlist()
    return tracks
def test_radio_stream_not_counted():
    skip_count = PlayListPage.get_skips_left()
    search_string = "KQED"
    PlayListPage.click_on_search()
    SearchPage.search_track(search_string)
    SearchPage.choose_filter("radio")
    SearchPage.click_first_result()
    assert PlayListPage.get_skips_left(
    ) == skip_count, "Radio stream should NOT remove 'skip' from count"
def test_search_filters(search_dialogue):
    search_string = "Rock"
    SearchPage.search_track(search_string)
    time.sleep(5)
    assert SearchPage.is_filter_type_exists("artists"), "Missing Artists filter type"
    assert SearchPage.is_filter_type_exists("tracks"), "Missing Tracks filter type"
    SearchPage.choose_filter("track")
    assert SearchPage.is_in_search_results(search_string, "Will"), "Missing tracks with Will and " + search_string
    assert SearchPage.is_filter_type_exists("tracks"), "Missing Tracks filter type"
    assert not SearchPage.is_filter_type_exists("artists"), "Artists filter type presented while should not"
    SearchPage.choose_filter("artist")
    actual = SearchPage.get_artist_from_search(0).__contains__("albums") and SearchPage.get_artist_from_search(
        0).__contains__(search_string)
    assert actual, "No search string in search result!!"
    assert SearchPage.is_filter_type_exists("artists"), "Missing Artists filter type"
    assert not SearchPage.is_filter_type_exists("tracks"), "Tracks filter type presented while should not"
    SearchPage.choose_filter("radio")
    assert SearchPage.is_in_search_results(search_string, "0"), "Missing tracks with 0 and " + search_string
    assert SearchPage.is_filter_type_exists("radio"), "Missing Radio filter type"
    assert not SearchPage.is_filter_type_exists("album"), "Album filter type presented while should not"
    SearchPage.choose_filter("album")
    actual = SearchPage.get_artist_from_search(0).__contains__("tracks") and SearchPage.get_artist_from_search(
        0).__contains__(search_string)
    assert actual, "No search string in search result!!!!"
    assert SearchPage.is_filter_type_exists("album"), "Missing Album filter type"
    assert not SearchPage.is_filter_type_exists("radio"), "Radio filter type presented while should not"
    SearchPage.choose_filter("none")
    assert SearchPage.is_filter_type_exists("artists"), "Missing Artists filter type"
    assert SearchPage.is_filter_type_exists("album"), "Missing Album filter type"
    assert SearchPage.is_filter_type_exists("radio"), "Missing Radio filter type"
    assert SearchPage.is_filter_type_exists("tracks"), "Missing Tracks filter type"