@insights_regression
@insights_song
Feature: Song Playlists Tab Sorting

  @IN-13264
  @id_9ef778e833a537802be130a94a388edd135d023679853019c6b8fb8b20c62b30
  Scenario: [Song> Playlists tab] Sorting verification. - default, non sortable columns, pagination
    Given an orchard employee multiaccount1 for insights
    And I log in to Insights silently
    When I visit the insights /song/QM6MZ2214888/playlists?offset=0&playlistAppearances=current&limit=10 page
    Then I can verify "orderBy":"streams_last_7_days" in @soundRecordingPlaylistPlacements request
    And I can verify "orderDir":"desc" in @soundRecordingPlaylistPlacements request
    And I save the list of playlists on Song page
    Then I click on C M column title
    And I see the same playlist list on Song page
    Then I click on Days On column title
    And I refresh the page
    Then I can verify "orderBy":"days_on_playlist" in @soundRecordingPlaylistPlacements request
    And I can verify "orderDir":"asc" in @soundRecordingPlaylistPlacements request
    And I can click on next arrow popover in the grid
    Then I can verify "orderBy":"days_on_playlist" in @soundRecordingPlaylistPlacements request
    And I can verify "orderDir":"asc" in @soundRecordingPlaylistPlacements request

  @IN-13264
  @id_73ae80cacd731491e5c5ca6240a8e07c199c35ad4c974c74dff7f384aaad49f0
  Scenario Outline: [Song> Playlists tab] Sorting verification. - <column> column
    Given a user from single_label for Insights
    When I log in to Insights silently
    When I visit the insights /song/QM6MZ2214888/playlists?offset=0&playlistAppearances=<appearances>&limit=10 page
    And I can apply all columns on playlists on Song page
    And I click on <column> column title
    Then I can verify "orderBy":"<orderByColumn>" in @soundRecordingPlaylistPlacements request
    And I can verify "orderDir":"<sort1>" in @soundRecordingPlaylistPlacements request
    And I can verify data playlists on Song page
    And I click on <column> column title
    Then I can verify "orderBy":"<orderByColumn>" in @soundRecordingPlaylistPlacements request
    And I can verify "orderDir":"<sort2>" in @soundRecordingPlaylistPlacements request
    And I can verify data playlists on Song page

    Examples:
      | appearances | column            | sort1 | sort2 | orderByColumn                       |
      | past        | Playlist          | asc   | desc  | playlist_name                       |
      | current     | Position          | asc   | desc  | current_position                    |
      | past        | Trend             | desc  | asc   | position_change                     |
      | current     | Days On           | asc   | desc  | days_on_playlist                    |
      | past        | Followers         | desc  | asc   | playlist_follower_count             |
      | current     | Peak Position     | asc   | desc  | peak_position                       |
      | past        | Last Added        | desc  | asc   | last_added_on_date                  |
      | current     | First Play        | desc  | asc   | first_play                          |
      | past        | Date Removed      | desc  | asc   | removed_on                          |
      | current     | Genre             | asc   | desc  | playlist_genres                     |
      | past        | 28dEntity Streams | desc  | asc   | total_playlist_streams_last_28_days |
      | current     | 7dCompletion Rate | desc  | asc   | completion_rate_last_7_days         |
