@insights_regression
@insights_product
@insights_product_playlists_sorting
Feature: Product Page Playlists Tab Sorting

  @IN-13781
  @id_d994396e2f5ae5dd5b09849fd38c9c84bfe9222f9e128d13608061734e8e768c
  Scenario: [Product Page> Playlists] Sorting verification. - default, non sortable columns, pagination
    Given an orchard employee multiaccount1 for insights
    And I log in
    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 Product page
    Then I click on C M column title on Playlists tab
    And I see the same playlist list on Product 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 @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_8069372bf0c8c7e0de33cc91ba9867e9b055532d956fb3acd078add0f2198b05
  Scenario Outline: [Product Page> Playlists] Sorting verification. - <column> column
    Given an orchard employee multiaccount1 for insights
    And I log in
    When I visit the insights /product/196626945068/playlists?playlistAppearancesFilter=<appearances>&offset=0&limit=10 page
    And I can apply all columns on playlists on Product page
    And I click on <column> column title on Playlists tab
    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 on Playlists tab
    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 |
