Feature: Engagement

  @frontend_engagement
  @id_8289df9db9182c43aac51064e9c9fbe6999805244b54293bb17ab84904f21032
  Scenario: Engagement top playlist placements add up
    Given an orchard employee react_homepage_flow_15063 for workstation
    And I login silently to workstation and visit the analytics engagement page
    When I search the engagement page for the Home track
    And I get the number of placements after adding the first track in Engagement page
    And I search the engagement page for the Salt Shaker track
    And I get the number of placements after adding the second track in Engagement page
    And I remove a track search from the Engagement page
    Then The playlist placements totals should have subtracted correctly in Engagement page

  @id_d48700c89cad07a6fd292f9824a8a6cfb091fdf2d98a5d63d6bd4d8614e349cf
  Scenario: Engagement filter placements tracks
    Given an orchard employee react_homepage_flow_15063 for workstation
    And I login silently to workstation and visit the analytics engagement page
    When I search the engagement page for the get low lil track
    Then I should see Get Low in the search field in Engagement page

  # And in Engagement page the filtered placements table contains data
  # And in Engagement page the placement tiles should contain the track Get Low
  # And in Engagement page the placement tiles should contain background images
  # And in Engagement page the placement tiles should contain followers
  @frontend_engagement
  @id_bddfbbc04a951531a3cea7c146b51d744563595d4808daac10cbdaf19129df31
  Scenario: Engagement filter placements artists
    Given an orchard employee react_homepage_flow_15063 for workstation
    And I login silently to workstation and visit the analytics engagement page
    When I search the engagement page for the Lil Jon artist
    And I search the engagement page for the Ying Yang Twins, Pitbull artist
    And I set the dates from 2023-02-01 to 2023-06-01 in Engagement page
    Then I should see Lil Jon in the search field in Engagement page
    Then I should see Ying Yang Twins, Pitbull in the search field in Engagement page

  # And in Engagement page the filtered placements table contains data
  # And in Engagement page the placement tiles should contain the artist Lil Jon
  # And in Engagement page the placement tiles should contain background images
  # And in Engagement page the placement tiles should contain followers
  @frontend_engagement
  @id_bad4d5bd249dd892764d31c66674af21fa29b36f810456ceef4c63d83dce9154
  Scenario: Engagement switching between artist and track filter clears search
    Given an orchard employee react_homepage_flow_15063 for workstation
    And I login silently to workstation and visit the analytics engagement page
    When I search the engagement page for the USTV10200105 track
    And I search the engagement page for the In Da Club track
    And I set the dates from 2023-02-01 to 2023-07-01 in Engagement page
    # Then in Engagement page the placement tiles should contain the track Get Low
    And I search the engagement page for the Lil Jon And The East Side Boyz artist
    And I search the engagement page for the Ying Yang Twins, Pitbull artist
    And in Engagement page I set the date filter to Last 7 Days
    Then in Engagement page I should not see either Get Low or In Da Club in the search field

  @frontend_engagement
  @id_511635eb13c0d6577d2d3a6cd6bb633a419c853599d7074ee2c4af64bd21fbfa
  Scenario: Engagement data loads with date filters
    Given an orchard employee react_homepage_flow_15063 for workstation
    And I login silently to workstation and visit the analytics engagement page
    When in Engagement page I set the date filter to Last 12 Months
    Then the engagement table should be populated
    When in Engagement page I set the date filter to Last 30 Days
    Then the engagement table should be populated
    When in Engagement page I set the date filter to Last 7 Days
    Then the engagement table should be populated

  @frontend_engagement
  @id_e07711781d8b0df56cc4cd9939124f09476fc5f04886165bfcdcf5d07bbb7aa5
  Scenario: Engagement Custom date range
    Given an orchard employee react_homepage_flow_15063 for workstation
    And I login silently to workstation and visit the analytics engagement page
    When I set the dates from 2023-02-01 to 2023-06-01 in Engagement page
    Then the engagement table should be populated
    When I search the engagement page for the USTV10400126 track

  # Then in Engagement page the placement tiles should contain the track Culo
  @frontend_engagement
  @id_b09a2c6e2d5bee461ca1e9e3cb99bb23ee29ec562e927971194b0dda85cb56f1
  Scenario: Engagement Streaming summary numbers decrease when date range is decreased
    Given an orchard employee react_homepage_flow_15063 for workstation
    And I login silently to workstation and visit the analytics engagement page
    When in Engagement page I get the streams count
    And in Engagement page I get the saves count
    And in Engagement page I get the listeners collection count
    And in Engagement page I get the active discovery count
    And in Engagement page I get the passive discovery count
    And in Engagement page I set the date filter to Last 7 Days
    Then in Engagement page streams decreases
    And in Engagement page saves decreases
    And in Engagement page listeners collection decreases
    And in Engagement page active discovery decreases
    And in Engagement page passive discovery decreases

  @frontend_engagement
  @id_acb01728681a41976083e3c155dc57a503255a2f80c3d4fa299cce172f97cbd8
  Scenario Outline: Search for multiple tracks and artists
    Given an orchard employee <user> for workstation
    And I login silently to workstation and visit the analytics engagement page
    When I search the engagement page for the <track_1> track
    And I search the engagement page for the <track_2> track
    Then I should see <track_1> in the search field in Engagement page
    Then I should see <track_2> in the search field in Engagement page
    When I search the engagement page for the <artist_1> artist
    And I search the engagement page for the <artist_2> artist
    Then I should see <artist_1> in the search field in Engagement page
    Then I should see <artist_2> in the search field in Engagement page

    Examples:
      | user            | track_1       | track_2       | artist_1                | artist_2       |
      # catalog: tvt
      | label_15063     | Salt Shaker   | Get Low       | Pitbull                 | Sevendust      |
      # frontline: frenchkiss
      # | label_6971      | Ride          | In Between Stars | Local Natives           | The Drums      |
      # d3: thirty tigers
      | label_21989     | Jealous Sun   | I Am the Moon | White Buffalo           | Parker Millsap |
      # subaccount: lightning rod records
      | subaccount_7584 | Alabama Pines | Mockingbird   | Quaker City Night Hawks | Paul Cauthen   |
