module OA
  class LabelCopySearchPage < OA::BasePage
    page_url("/search/search_lbl_copy.php")

    text_field(:artist_name, name: "varArtistName")
    text_field(:release_name, name: "varReleaseName")
    select_list(:product_type, name: "varProductType[]")
    select_list(:label_country, name: "varVendorCountry")
    button(:search_button, name: "EditSubmit")

    # Public: Fills out the specified fields on the Label Copy Search Page and clicks the search button
    #
    # search_params - hash of parameters to fill out with their corresponding values
    #
    # Example
    #
    #   on(OA::LabelCopySearchPage).search_for(
    #           release_name: 'watir',
    #           product_type: 'Music',
    #           label_country: 'Barbados')
    #
    # Returns nothing
    def search_for(search_params)
      populate_page_with(search_params)
      search_button
    end
  end
end
