@insights_regression
@insights_song
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 to Insights silently

  @IN-12310
  @id_d0a373de3af312fcbc7d58b33567fb5a73ba4bf356e26dd851854bf5b5918fa2
  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_bc7ec304ea6247aa565888d38b85d187f975b56865408fad280f46d0c2564dfb
  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_cef33e6d5930faf59676ce29ee62b20ef5db07acc6097c2f678a36baf9fba84a
  Scenario Outline: [Regression][Song][Playlist Digest] Cards verification. - change period to <column>
    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_c616bcac9ab9adc2ca76d6a214ba6460eaf4853ef61916479aeb5cd7ca4e39ea
  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
