Esempio 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"
Esempio n. 2
0
def test_play_next_track(first_cone_tuned):
    previous_track = PlayListPage.get_track()
    previous_artist = PlayListPage.get_artist()
    # checking of the next track
    PlayListPage.play_next_track()
    assert PlayListPage.wait_for_track_change(previous_track,
                                              10), "Track never changed"
    actual = PlayListPage.get_track()
    expected = first_cone_tuned.get_json_status_track()
    assert text_utils.smart_compare(actual, expected), \
        "Wrong currently playing track on Playlist page, page: " + actual + " cone: " + expected
    actual = PlayListPage.get_artist()
    expected = first_cone_tuned.get_json_status_artist()
    assert text_utils.smart_compare(actual, expected), \
        "Wrong currently playing artist on Playlist page, page: " + actual + " cone: " + expected
    # checking of the previous track
    assert text_utils.smart_compare(
        PlayListPage.last_track(),
        previous_track), "Last track not appeared in list"
    assert text_utils.smart_compare(
        PlayListPage.last_artist(),
        previous_artist), "Last artist not appeared in list"