Exemplo n.º 1
0
def test_play_from_likes(play_likes_playlist, first_cone_tuned):
    current_track = play_likes_playlist[0].track
    current_artist = play_likes_playlist[0].artist
    assert text_utils.smart_compare(current_artist, PlayListPage.get_artist(
    )), "Wrong currently playing artist on Playlist page"
    assert text_utils.smart_compare(current_track, PlayListPage.get_track(
    )), "Wrong currently playing track on Playlist page"
    assert text_utils.smart_compare(PlayListPage.get_artist(),
                                    first_cone_tuned.get_json_status_artist()
                                    ), "Wrong currently playing artist on cone"
    assert text_utils.smart_compare(PlayListPage.get_track(),
                                    first_cone_tuned.get_json_status_track()
                                    ), "Wrong currently playing track on cone"
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 track on Playlist page, page: " + actual + " cone: " + expected
Exemplo n.º 3
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_play_from_likes(play_likes_playlist, first_cone_tuned):
    current_artist_expected = play_likes_playlist[0].artist
    current_artist_actual = PlayListPage.get_track() + '\n' + PlayListPage.get_artist()
    assert text_utils.smart_compare(current_artist_expected,
                                    current_artist_actual), "Wrong currently playing artist on Playlist page"
    current_artist_actual = first_cone_tuned.get_json_status_track() + "\n" + first_cone_tuned.get_json_status_artist()
    assert text_utils.smart_compare(current_artist_expected,
                                    current_artist_actual), "Wrong currently playing artist on cone"
def test_play_from_next_list(play_likes_playlist, first_cone_tuned):
    previous_track = PlayListPage.get_track()
    # checking of the next track
    PlayListPage._swipe_to_next_artist()
    # the test failed due to radio not having a 'artist' element and _swipe_to was too big.
    PlayListPage.play_next_track()
    assert PlayListPage.wait_for_track_change(previous_track, 10), "Track never changed"
    actual = PlayListPage.get_track() + "\n" + PlayListPage.get_artist()
    expected = play_likes_playlist[1].artist
    assert text_utils.smart_compare(actual, expected), \
        "Wrong currently playing track on Playlist page, page: " + actual + " expected from next list: " + expected
    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 track on Playlist page, page: " + actual + " cone: " + expected
def test_next_set(first_cone_tuned):
    prev_set = first_cone_tuned.get_set()
    next_set = first_cone_tuned.get_next_set()
    prev_track = PlayListPage.get_track()
    prev_artist = PlayListPage.get_artist()
    PlayListPage.play_next_set()
    PlayListPage.wait_for_track_change(prev_track)
    assert not text_utils.smart_compare(PlayListPage.get_track(), prev_track), "Track didn't switch"
    assert not text_utils.smart_compare(PlayListPage.get_artist(), prev_artist), "Artist didn't switch"
    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_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 = first_cone_tuned.get_set()
    assert actual != prev_set, "Set not changed"
    assert actual == next_set, "Wrong next set"
Exemplo n.º 7
0
def test_play_list_details(first_cone_tuned):
    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
    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
    assert PlayListPage.get_playing_from() == "playing from Rdio", \
        "Wrong 'playing from' source on Playlist page"
    actual = PlayListPage.get_similar_to_text()
    expected = "Similar to " + first_cone_tuned.get_json_status_artist()
    assert text_utils.smart_compare(actual, expected), \
        "Wrong 'Similar to' link text on Playlist page, page: " + actual + " expected: " + expected