Commit 004b72fe authored by Mark Lapierre's avatar Mark Lapierre

Merge branch 'qa-create-elasticsearch' into 'master'

CE backport for changes in EE MR 14646

See merge request gitlab-org/gitlab-ce!30932
parents 14e7cbe5 7906503d
Pipeline #73661271 passed with stages
in 36 minutes and 10 seconds
......@@ -13,7 +13,8 @@
tabindex: '1',
autocomplete: 'off',
data: { issues_path: issues_dashboard_path,
mr_path: merge_requests_dashboard_path },
mr_path: merge_requests_dashboard_path,
qa_selector: 'search_term_field' },
aria: { label: _('Search or jump to…') }
%button.hidden.js-dropdown-search-toggle{ type: 'button', data: { toggle: 'dropdown' } }
.dropdown-menu.dropdown-select.js-dashboard-search-options
......
......@@ -236,7 +236,7 @@
%span
= _('General')
= nav_link(path: 'application_settings#integrations') do
= link_to integrations_admin_application_settings_path, title: _('Integrations') do
= link_to integrations_admin_application_settings_path, title: _('Integrations'), data: { qa_selector: 'integration_settings_link' } do
%span
= _('Integrations')
= nav_link(path: 'application_settings#repository') do
......
......@@ -12,7 +12,7 @@
%ul.nav-links.search-filter.scrolling-tabs.nav.nav-tabs
- if @project
- if project_search_tabs?(:blobs)
%li{ class: active_when(@scope == 'blobs') }
%li{ class: active_when(@scope == 'blobs'), data: { qa_selector: 'code_tab' } }
= link_to search_filter_path(scope: 'blobs') do
= _("Code")
%span.badge.badge-pill
......
.blob-result
.blob-result{ data: { qa_selector: 'result_item_content' } }
.file-holder
.js-file-title.file-title
.js-file-title.file-title{ data: { qa_selector: 'file_title_content' } }
= link_to blob_link do
%i.fa.fa-file
%strong
= search_blob_title(project, file_name)
- if blob.data
.file-content.code.term
.file-content.code.term{ data: { qa_selector: 'file_text_content' } }
= render 'shared/file_highlight', blob: blob, first_line_number: blob.startline
......@@ -314,6 +314,10 @@ module QA
autoload :Login, 'qa/page/mattermost/login'
end
module Search
autoload :Results, 'qa/page/search/results'
end
##
# Classes describing components that are used by several pages.
#
......
......@@ -13,6 +13,10 @@ module QA
element :admin_settings_metrics_and_profiling_item
end
view 'app/views/layouts/nav/sidebar/_admin.html.haml' do
element :integration_settings_link
end
def go_to_repository_settings
hover_settings do
within_submenu do
......@@ -21,6 +25,14 @@ module QA
end
end
def go_to_integration_settings
hover_settings do
within_submenu do
click_element :integration_settings_link
end
end
end
def go_to_general_settings
hover_settings do
within_submenu do
......
......@@ -27,6 +27,10 @@ module QA
element :your_projects_link
end
view 'app/views/layouts/_search.html.haml' do
element :search_term_field
end
def go_to_groups
within_top_menu do
click_element :groups_dropdown
......@@ -71,6 +75,10 @@ module QA
click_element :snippets_link
end
def search_for(term)
fill_element :search_term_field, "#{term}\n"
end
def has_personal_area?(wait: Capybara.default_max_wait_time)
has_element?(:user_avatar, wait: wait)
end
......
# frozen_string_literal: true
module QA::Page
module Search
class Results < QA::Page::Base
view 'app/views/search/_category.html.haml' do
element :code_tab
end
view 'app/views/search/results/_blob_data.html.haml' do
element :result_item_content
element :file_title_content
element :file_text_content
end
def switch_to_code
click_element(:code_tab)
end
def has_file_in_project?(file_name, project_name)
has_element? :result_item_content, text: "#{project_name}: #{file_name}"
end
def has_file_with_content?(file_name, file_text)
within_element_by_index :result_item_content, 0 do
false unless has_element? :file_title_content, text: file_name
has_element? :file_text_content, text: file_text
end
end
end
end
end
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment