@insights_regression
@insights_artist
@insights_artist_playlists
@IN-14550
Feature: Artist Playlists Tab Sorting

  @id_664d882301e76b242563e0b8234482c6ad890b6e6ec1fa0a3cb4e20af4de2324
  Scenario: [Artist> Playlists tab] Sorting verification. - default, non sortable columns, pagination
    Given an orchard employee multiaccount1 for insights
    And I log in
    When I visit the insights /artist/e49ea9f9-0a74-4623-b3c6-ff819c7c0a4d/playlists?offset=0&playlistAppearances=current&limit=10 page
    Then I can verify "orderBy":"streams_last_7_days" in @globalParticipantPlaylistPlacements request
    And I can verify "orderDir":"desc" in @globalParticipantPlaylistPlacements request
    And I save the list of playlists on Artist page
    Then I click on C M column title on Playlists tab
    And I see the same playlist list on Artist page
    Then I click on Days On column title on Playlists tab
    And I refresh the page
    Then I can verify "orderBy":"days_on_playlist" in @globalParticipantPlaylistPlacements request
    And I can verify "orderDir":"asc" in @globalParticipantPlaylistPlacements request
    And I can click on next arrow popover in the grid
    Then I can verify "orderBy":"days_on_playlist" in @globalParticipantPlaylistPlacements request
    And I can verify "orderDir":"asc" in @globalParticipantPlaylistPlacements request

  @id_a52f9b921494369f6b123b8dd74d04941710f1bb6cce28828f714d8a51d7facd
  Scenario Outline: [Artist> Playlists tab] Sorting verification. - <column> column (<appearances>)
    Given a user from single_label for insights
    And I log in
    When I visit the insights /artist/e49ea9f9-0a74-4623-b3c6-ff819c7c0a4d/playlists?offset=0&playlistAppearances=<appearances>&limit=10 page
    And I click on <column> column title on Playlists tab
    Then I can verify "orderBy":"<orderByColumn>" in @globalParticipantPlaylistPlacements request
    And I can verify "orderDir":"<sort1>" in @globalParticipantPlaylistPlacements request
    And I can verify data playlists on Artist page
    And I click on <column> column title on Playlists tab
    Then I can verify "orderBy":"<orderByColumn>" in @globalParticipantPlaylistPlacements request
    And I can verify "orderDir":"<sort2>" in @globalParticipantPlaylistPlacements request
    And I can verify data playlists on Artist page

    Examples:
      | appearances | column    | sort1 | sort2 | orderByColumn           |
      | past        | Playlist  | asc   | desc  | playlist_name           |
      | current     | Position  | asc   | desc  | current_position        |
      | current     | Days On   | asc   | desc  | days_on_playlist        |
      | past        | Followers | desc  | asc   | playlist_follower_count |
