Welcome to mirror list, hosted at ThFree Co, Russian Federation.

search_helpers.rb « helpers « support « spec - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 2cf3f4b83c4f6a4412ce42594223807ffc358331 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
# frozen_string_literal: true

module SearchHelpers
  def submit_search(query, scope: nil)
    page.within('.search-form, .search-page-form') do
      field = find_field('search')
      field.fill_in(with: query)

      if javascript_test?
        field.send_keys(:enter)
      else
        click_button('Search')
      end
    end
  end

  def select_search_scope(scope)
    page.within '.search-filter' do
      click_link scope
    end
  end
end