@insights_regression
@insights_song
@insights_song_playlist_digest
Feature: Song Page Playlist Digest Cards

  Background: Song Page is opened in default state
    Given an orchard employee multiaccount1 for insights
    And I log in

  @IN-12310
  @id_862b9774ffe764300bb71fb1e191b2b2e8bdd0e21937713f4aa35189cbe2bf09
  Scenario: [Regression][Song][Playlist Digest] Cards verification - default view
    When I visit the insights /song/QMFME2364182 page
    And I can verify default table view Playlist Digest on Song page
    And I can verify columns values and 28 Days streams corresponds to api on table view Playlist Digest Song page

  @IN-12311
  @id_5bc40e83f2d3ad248f2b96df1a6e2c86f30c95b44e22fda26bb5440b15411528
  Scenario Outline: [Regression][Song][Playlist Digest] Cards verification - different periods
    When I visit the insights <page> page
    And I switch to card view for Playlist Digest on Song page
    And I can verify columns values and 28 Days streams corresponds to api on card view Playlist Digest Song page

    Examples:
      | page                                                       |
      | /song/QMFME2364182/?playlistAppearances=past_7_days        |
      | /song/QMFME2364182/?playlistAppearances=recent_last_7_days |

  @IN-12312
  @id_68fc89b66ab50613f5fed66bcae044fe25e30709574c2b65cc1b5c07d445ba3f
  Scenario Outline: [Regression][Song][Playlist Digest] Cards verification - change period to <column> (<page>)
    When I visit the insights <page> page
    And I switch to card view for Playlist Digest on Song page
    Then I can verify columns values and <column> streams corresponds to api on card view Playlist Digest Song page

    Examples:
      | page                                                                          | column   |
      | /song/QMFME2364182/?period=past7&playlistAppearances=recent_last_7_days       | 7 Days   |
      | /song/QMFME2364182/?period=past6Months&playlistAppearances=recent_last_7_days | 6 Months |
      | /song/QMFME2364182/?period=past365&playlistAppearances=recent_last_7_days     | 1 Year   |
      | /song/QMFME2364182/?period=allTime&playlistAppearances=recent_last_7_days     | All Time |
      | /song/QMFME2364182/?period=first7&playlistAppearances=recent_last_7_days      | All Time |

  @IN-12328
  @id_8365102d53530d7f3eb8ef3094b3c9189426ce9a9dbac1923658480015be8938
  Scenario: [Regression][Song][Playlist Digest] Cards verification - request parameters
    When I visit the insights /song/QMFME2364182 page
    And I can verify "isrc":"QMFME2364182" in @topSoundRecordingPlaylistPlacements request
    And I can verify "playlistAppearances":"current" in @topSoundRecordingPlaylistPlacements request
    And I can verify "orderBy":"streams_last_28_days" in @topSoundRecordingPlaylistPlacements request
    And I can verify "playlistTypes":["CHART","CURATED","ALGORITHMIC","EDITORIAL","PERSONALIZED","NEW_MUSIC_FRIDAY","RADIO","STATION","USER_GENERATED"] in @topSoundRecordingPlaylistPlacements request
