Feature: React Homepage Global Search
  In order to find products and projects
  As a label user
  I want to be able to use Global Search feature

  @frontend_homepage
  # DIG-6983
  Scenario: Search product by product code and select
    Given I am on the ReactWorkstation::ReactHomePage
    And my product name is Crunk Juice (D2C)
    When I search for a product with a product code of TV67081
    Then I should see my product in the result list
    When I select the first result in the results dropdown
    Then I should be on the overview page of my selected project

  @frontend_homepage
  # DIG-5111
  Scenario: Search project by project code and select
    Given I am on the ReactWorkstation::ReactHomePage
    And my project name is Sundowner
    When I search for a project with a project code of LMMBMP19 00041
    Then I should see my project in the result list
    When I select the first result in the results dropdown
    Then I should be on the overview page of my selected project

  @frontend_homepage
  # DIG-5131 DIG-5132 DIG-5118 DIG-5120 DIG-5128
  Scenario: Search returns both products and projects
    Given I am on the ReactWorkstation::ReactHomePage
    When I search products by partial name
    Then I should see both digital and physical products in results dropdown
    When I search by UPC
    Then I should only see the matching product in the results dropdown
    When I search by artist name
    Then I should see both projects and products matching the criteria in results dropdown
