@insights
Feature: Insights Search

  @id_e3196c28d08923cf0dcb5bf52d8558112a5a0b8ee3056f54cd420f0a553224d9
  Scenario Outline: Search - User type can/cannot see the correct data
    Given a user from <user> for Insights
    When I log in to Insights as <profile> silently
    And I search for <search_term> term in my catalog
    Then I <expect> see <results> in results

    Examples:
      | user         | profile    | search_term | results    | expect |
      | user_profile | Label      | The drums   | The Drums  | can    |
      | user_profile | D3         | Jim Fowler  | Jim Fowler | can't  |
      | user_profile | Subaccount | Helix       | Helix      | can't  |
      | user_profile | Artist     | Ozuna       | Ozuna      | can    |

  # IN-16267
  @wip
  @id_d36a148bc40f7a0030ad28620ec3350fbacbb96a7e26d3a0bcc1dd144a17c7d6
  @donotfail
  Scenario Outline: Search page records visits to recently searched <entity_type> page
    Given an orchard employee single_label for Insights
    And I log in to Insights silently
    And I have cleared recently visited pages
    When I search for <title> term in my catalog
    And I click on <entity_type> name Search page
    When I am on the insights search page
    Then I can see a tile for <page>
    And the tile has the title <title>
    And I can click the link to go to <page>

    Examples:
      | page                                         | title                                               | entity_type |
      | song/GBZUZ0900064/                           | Wide Eyes                                           | song        |
      | artist/95ee273c-09cb-411c-ae00-8806e9ca938e/ | Local Natives                                       | artist      |
      | channel/UCPmyZyhKT6mZdB8HbfGHY1Q/            | Diet Cig                                            | channel     |
      | video/LSnhReVZsro/                           | The Antlers - Hospice (Full Album - Official Audio) | video       |
      | product/194491282172/                        | Conduit                                             | product     |

  @id_487a62203fb300cd9b206f651eb31987ef825fc7e207d905947f4f32e59f7bb3
  Scenario: Search page records no more than 15, in order of most recently visited
    Given an orchard employee insightsreal for insights
    And I log in to Insights silently
    When I visit 17 different songs
    And I am on the insights search page
    Then I only see the 15 most recently visited songs displayed
