@insights_regression
@insights_product
Feature: Product Page Playlists Tab Sorting

  @IN-13781
  @id_cf206e7e374304a1a3e264d58e5af284b4524a3436b676be82b9fd47f60ca49d
  Scenario: [Product Page> Playlists] 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 /product/196626945068/playlists?offset=0&limit=10 page
    Then I can verify "orderBy":"streams_last_7_days" in @productPlaylistPlacements request
    And I can verify "orderDir":"desc" in @productPlaylistPlacements 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 @productPlaylistPlacements request
    And I can verify "orderDir":"asc" in @productPlaylistPlacements request
    And I can click on next arrow popover in the grid
    Then I can verify "orderBy":"days_on_playlist" in @productPlaylistPlacements request
    And I can verify "orderDir":"asc" in @productPlaylistPlacements request

  @IN-13781
  @id_65e9f5f5a1b8c385e9d894a910785d00b28ea493fcdae29c19313509cceacf4d
  Scenario Outline: [Product Page> Playlists] Sorting verification. - <column> column
    Given an orchard employee multiaccount1 for insights
    When I log in to Insights silently
    When I visit the insights /product/196626945068/playlists?playlistAppearancesFilter=<appearances>&offset=0&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 @productPlaylistPlacements request
    And I can verify "orderDir":"<sort1>" in @productPlaylistPlacements request
    And I can verify playlists list on Playlists tab on the product page
    And I click on <column> column title
    Then I can verify "orderBy":"<orderByColumn>" in @productPlaylistPlacements request
    And I can verify "orderDir":"<sort2>" in @productPlaylistPlacements request
    And I can verify playlists list on Playlists tab on the product 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          |
      | past        | Date Removed      | desc  | asc   | removed_on                  |
      | current     | Genre             | asc   | desc  | playlist_genres             |
      | current     | 7dCompletion Rate | desc  | asc   | completion_rate_last_7_days |
