@frontend_homepage
@graphql_product
Feature: Homepage Global Search
  To find products and projects
  As a label user
  I want to be able to use Global Search feature

  # DIG-6983
  @id_b74c7be2a1ab7e4b003b2852020fc3f2b0c167932c9c3031f5ce7f5c43ce681b
  Scenario: Search product by product code and select
    Given an orchard employee label_15063_admin for workstation
    And I log in
    And I am successfully logged in to workstation
    And my product name is Crunk Juice
    When I search for a product with a product code of 016581670815
    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 product
    And I log out of workstation

  # DIG-5111
  @id_72978caada05417f635377beb380be4513f2a5e65133085de6fcb759a5784079
  Scenario: Search project by project code and select
    Given an orchard employee label_15063_admin for workstation
    And I log in
    And I am successfully logged in to workstation
    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
    And I log out of workstation

  # DIG-5131 DIG-5132 DIG-5118 DIG-5120 DIG-5128
  @id_6087e0291842bd2925c5e1adb109bddd4535e01b0016485cfea265d578033cfe
  Scenario: Search returns both products and projects
    Given an orchard employee label_7123_admin for workstation
    And I log in
    And I am successfully logged in to workstation
    When I search by partial name
    Then I should see both digital and physical products in the 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 the results dropdown
