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
...@@ -13,7 +13,8 @@ ...@@ -13,7 +13,8 @@
tabindex: '1', tabindex: '1',
autocomplete: 'off', autocomplete: 'off',
data: { issues_path: issues_dashboard_path, 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…') } aria: { label: _('Search or jump to…') }
%button.hidden.js-dropdown-search-toggle{ type: 'button', data: { toggle: 'dropdown' } } %button.hidden.js-dropdown-search-toggle{ type: 'button', data: { toggle: 'dropdown' } }
.dropdown-menu.dropdown-select.js-dashboard-search-options .dropdown-menu.dropdown-select.js-dashboard-search-options
......
...@@ -236,7 +236,7 @@ ...@@ -236,7 +236,7 @@
%span %span
= _('General') = _('General')
= nav_link(path: 'application_settings#integrations') do = 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 %span
= _('Integrations') = _('Integrations')
= nav_link(path: 'application_settings#repository') do = nav_link(path: 'application_settings#repository') do
......
...@@ -12,7 +12,7 @@ ...@@ -12,7 +12,7 @@
%ul.nav-links.search-filter.scrolling-tabs.nav.nav-tabs %ul.nav-links.search-filter.scrolling-tabs.nav.nav-tabs
- if @project - if @project
- if project_search_tabs?(:blobs) - 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 = link_to search_filter_path(scope: 'blobs') do
= _("Code") = _("Code")
%span.badge.badge-pill %span.badge.badge-pill
......
.blob-result .blob-result{ data: { qa_selector: 'result_item_content' } }
.file-holder .file-holder
.js-file-title.file-title .js-file-title.file-title{ data: { qa_selector: 'file_title_content' } }
= link_to blob_link do = link_to blob_link do
%i.fa.fa-file %i.fa.fa-file
%strong %strong
= search_blob_title(project, file_name) = search_blob_title(project, file_name)
- if blob.data - 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 = render 'shared/file_highlight', blob: blob, first_line_number: blob.startline
...@@ -314,6 +314,10 @@ module QA ...@@ -314,6 +314,10 @@ module QA
autoload :Login, 'qa/page/mattermost/login' autoload :Login, 'qa/page/mattermost/login'
end end
module Search
autoload :Results, 'qa/page/search/results'
end
## ##
# Classes describing components that are used by several pages. # Classes describing components that are used by several pages.
# #
......
...@@ -13,6 +13,10 @@ module QA ...@@ -13,6 +13,10 @@ module QA
element :admin_settings_metrics_and_profiling_item element :admin_settings_metrics_and_profiling_item
end end
view 'app/views/layouts/nav/sidebar/_admin.html.haml' do
element :integration_settings_link
end
def go_to_repository_settings def go_to_repository_settings
hover_settings do hover_settings do
within_submenu do within_submenu do
...@@ -21,6 +25,14 @@ module QA ...@@ -21,6 +25,14 @@ module QA
end end
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 def go_to_general_settings
hover_settings do hover_settings do
within_submenu do within_submenu do
......
...@@ -27,6 +27,10 @@ module QA ...@@ -27,6 +27,10 @@ module QA
element :your_projects_link element :your_projects_link
end end
view 'app/views/layouts/_search.html.haml' do
element :search_term_field
end
def go_to_groups def go_to_groups
within_top_menu do within_top_menu do
click_element :groups_dropdown click_element :groups_dropdown
...@@ -71,6 +75,10 @@ module QA ...@@ -71,6 +75,10 @@ module QA
click_element :snippets_link click_element :snippets_link
end end
def search_for(term)
fill_element :search_term_field, "#{term}\n"
end
def has_personal_area?(wait: Capybara.default_max_wait_time) def has_personal_area?(wait: Capybara.default_max_wait_time)
has_element?(:user_avatar, wait: wait) has_element?(:user_avatar, wait: wait)
end 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