Exemplo n.º 1
0
def test_next_track_click_and_previous_element_check(play_x_rdio_playlist,
                                                     first_cone_tuned):
    previous_track = play_x_rdio_playlist[0].track
    previous_artist = play_x_rdio_playlist[0].artist
    next_playing_track = play_x_rdio_playlist[1].track
    next_playing_artist = play_x_rdio_playlist[1].artist
    # next track in list validation
    assert text_utils.smart_compare(
        next_playing_track, PlayListPage.next_track()), "Next list wrong track"
    # next track check

    PlayListPage.play_next_artist()
    assert PlayListPage.wait_for_track_change(
        previous_track), "Track never changed"
    actual = PlayListPage.get_track()
    expected = first_cone_tuned.get_json_status_track()
    assert text_utils.smart_compare(actual, expected), \
        "Currently playing track from cone:  and application are different: " + actual + " cone: " + expected
    assert text_utils.smart_compare(actual, next_playing_track), \
        "Wrong currently playing track on Playlist page: ->" + actual + " expected: " + next_playing_track
    actual = PlayListPage.get_artist()
    assert text_utils.smart_compare(actual, next_playing_artist), \
        "Wrong currently playing artist on Playlist page: ->" + actual + " expected: " + next_playing_artist
    # previous track check
    assert PlayListPage.last_artist(
    ) == previous_artist, "Last artist not appeared in list"
    assert PlayListPage.last_track(
    ) == previous_track, "Last track not appeared in list"
def test_next_track_list(play_likes_playlist):
    PlayListPage._swipe_to_current_artist()
    i = 1
    while i < play_likes_playlist.__len__():
        assert text_utils.smart_compare(play_likes_playlist[i].artist,  PlayListPage.next_track(i-1)), "Wrong tack in next tracks playlist"
        i = i + 1