summaryrefslogtreecommitdiff
path: root/qa/qa/page/project
diff options
context:
space:
mode:
Diffstat (limited to 'qa/qa/page/project')
-rw-r--r--qa/qa/page/project/issue/index.rb21
-rw-r--r--qa/qa/page/project/issue/show.rb18
-rw-r--r--qa/qa/page/project/job/show.rb72
-rw-r--r--qa/qa/page/project/new.rb6
-rw-r--r--qa/qa/page/project/operations/kubernetes/index.rb4
-rw-r--r--qa/qa/page/project/operations/metrics/show.rb24
-rw-r--r--qa/qa/page/project/pipeline/index.rb76
-rw-r--r--qa/qa/page/project/pipeline/show.rb112
-rw-r--r--qa/qa/page/project/settings/advanced.rb4
-rw-r--r--qa/qa/page/project/settings/ci_cd.rb9
-rw-r--r--qa/qa/page/project/settings/ci_variables.rb2
-rw-r--r--qa/qa/page/project/settings/common.rb13
-rw-r--r--qa/qa/page/project/settings/deploy_keys.rb2
-rw-r--r--qa/qa/page/project/settings/general_pipelines.rb23
-rw-r--r--qa/qa/page/project/settings/incidents.rb37
-rw-r--r--qa/qa/page/project/settings/integrations.rb19
-rw-r--r--qa/qa/page/project/settings/main.rb2
-rw-r--r--qa/qa/page/project/settings/merge_request.rb2
-rw-r--r--qa/qa/page/project/settings/operations.rb23
-rw-r--r--qa/qa/page/project/settings/repository.rb4
-rw-r--r--qa/qa/page/project/settings/services/prometheus.rb36
-rw-r--r--qa/qa/page/project/sub_menus/ci_cd.rb6
-rw-r--r--qa/qa/page/project/sub_menus/common.rb1
-rw-r--r--qa/qa/page/project/sub_menus/issues.rb6
-rw-r--r--qa/qa/page/project/sub_menus/operations.rb12
-rw-r--r--qa/qa/page/project/sub_menus/project.rb6
-rw-r--r--qa/qa/page/project/sub_menus/repository.rb8
-rw-r--r--qa/qa/page/project/sub_menus/settings.rb15
28 files changed, 403 insertions, 160 deletions
diff --git a/qa/qa/page/project/issue/index.rb b/qa/qa/page/project/issue/index.rb
index b5ad63ab8de..ace2537fc0e 100644
--- a/qa/qa/page/project/issue/index.rb
+++ b/qa/qa/page/project/issue/index.rb
@@ -9,6 +9,15 @@ module QA
element :assignee_link
end
+ view 'app/views/projects/issues/export_csv/_button.html.haml' do
+ element :export_as_csv_button
+ end
+
+ view 'app/views/projects/issues/export_csv/_modal.html.haml' do
+ element :export_issues_button
+ element :export_issues_modal
+ end
+
view 'app/views/projects/issues/_issue.html.haml' do
element :issue
element :issue_link, 'link_to issue.title' # rubocop:disable QA/ElementWithPattern
@@ -34,6 +43,18 @@ module QA
click_element :closed_issues_link
end
+ def click_export_as_csv_button
+ click_element(:export_as_csv_button)
+ end
+
+ def click_export_issues_button
+ click_element(:export_issues_button)
+ end
+
+ def export_issues_modal
+ find_element(:export_issues_modal)
+ end
+
def has_assignee_link_count?(count)
all_elements(:assignee_link, count: count)
end
diff --git a/qa/qa/page/project/issue/show.rb b/qa/qa/page/project/issue/show.rb
index 8365ecb6348..dd74ff28763 100644
--- a/qa/qa/page/project/issue/show.rb
+++ b/qa/qa/page/project/issue/show.rb
@@ -7,6 +7,7 @@ module QA
class Show < Page::Base
include Page::Component::Issuable::Common
include Page::Component::Note
+ include Page::Component::DesignManagement
view 'app/assets/javascripts/notes/components/comment_form.vue' do
element :comment_button
@@ -56,6 +57,23 @@ module QA
element :new_note_form, 'attr: :note' # rubocop:disable QA/ElementWithPattern
end
+ view 'app/views/projects/issues/_tabs.html.haml' do
+ element :discussion_tab_link
+ element :discussion_tab_content
+ element :designs_tab_link
+ element :designs_tab_content
+ end
+
+ def click_discussion_tab
+ click_element(:discussion_tab_link)
+ active_element?(:discussion_tab_content)
+ end
+
+ def click_designs_tab
+ click_element(:designs_tab_link)
+ active_element?(:designs_tab_content)
+ end
+
def click_milestone_link
click_element(:milestone_link)
end
diff --git a/qa/qa/page/project/job/show.rb b/qa/qa/page/project/job/show.rb
index 26db2f20c1b..971b8c5e5f8 100644
--- a/qa/qa/page/project/job/show.rb
+++ b/qa/qa/page/project/job/show.rb
@@ -1,51 +1,55 @@
# frozen_string_literal: true
-module QA::Page
- module Project::Job
- class Show < QA::Page::Base
- include Component::CiBadgeLink
+module QA
+ module Page
+ module Project
+ module Job
+ class Show < QA::Page::Base
+ include Component::CiBadgeLink
- view 'app/assets/javascripts/jobs/components/log/log.vue' do
- element :job_log_content
- end
+ view 'app/assets/javascripts/jobs/components/log/log.vue' do
+ element :job_log_content
+ end
- view 'app/assets/javascripts/jobs/components/stages_dropdown.vue' do
- element :pipeline_path
- end
+ view 'app/assets/javascripts/jobs/components/stages_dropdown.vue' do
+ element :pipeline_path
+ end
- view 'app/assets/javascripts/jobs/components/sidebar.vue' do
- element :retry_button
- end
+ view 'app/assets/javascripts/jobs/components/sidebar.vue' do
+ element :retry_button
+ end
- def successful?(timeout: 60)
- raise "Timed out waiting for the build trace to load" unless loaded?
- raise "Timed out waiting for the status to be a valid completed state" unless completed?(timeout: timeout)
+ def successful?(timeout: 60)
+ raise "Timed out waiting for the build trace to load" unless loaded?
+ raise "Timed out waiting for the status to be a valid completed state" unless completed?(timeout: timeout)
- passed?
- end
+ passed?
+ end
- # Reminder: You may wish to wait for a particular job status before checking output
- def output(wait: 5)
- result = ''
+ # Reminder: You may wish to wait for a particular job status before checking output
+ def output(wait: 5)
+ result = ''
- wait_until(reload: false, max_duration: wait, sleep_interval: 1) do
- result = find_element(:job_log_content).text
+ wait_until(reload: false, max_duration: wait, sleep_interval: 1) do
+ result = find_element(:job_log_content).text
- result.include?('Job')
- end
+ result.include?('Job')
+ end
- result
- end
+ result
+ end
- def retry!
- click_element :retry_button
- end
+ def retry!
+ click_element :retry_button
+ end
- private
+ private
- def loaded?(wait: 60)
- wait_until(reload: true, max_duration: wait, sleep_interval: 1) do
- has_element?(:job_log_content, wait: 1)
+ def loaded?(wait: 60)
+ wait_until(reload: true, max_duration: wait, sleep_interval: 1) do
+ has_element?(:job_log_content, wait: 1)
+ end
+ end
end
end
end
diff --git a/qa/qa/page/project/new.rb b/qa/qa/page/project/new.rb
index 97214e22820..f6c015f64ea 100644
--- a/qa/qa/page/project/new.rb
+++ b/qa/qa/page/project/new.rb
@@ -5,6 +5,7 @@ module QA
module Project
class New < Page::Base
include Page::Component::Select2
+ include Page::Component::Project::Templates
view 'app/views/projects/new.html.haml' do
element :project_create_from_template_tab
@@ -26,6 +27,11 @@ module QA
element :import_github, "icon('github', text: 'GitHub')" # rubocop:disable QA/ElementWithPattern
end
+ view 'app/views/projects/project_templates/_built_in_templates.html.haml' do
+ element :use_template_button
+ element :template_option_row
+ end
+
def choose_test_namespace
choose_namespace(Runtime::Namespace.path)
end
diff --git a/qa/qa/page/project/operations/kubernetes/index.rb b/qa/qa/page/project/operations/kubernetes/index.rb
index 84b58e9ea5b..0c92f9a9f28 100644
--- a/qa/qa/page/project/operations/kubernetes/index.rb
+++ b/qa/qa/page/project/operations/kubernetes/index.rb
@@ -17,6 +17,10 @@ module QA
def has_cluster?(cluster)
has_element?(:cluster, cluster_name: cluster.to_s)
end
+
+ def click_on_cluster(cluster)
+ click_on cluster.cluster_name
+ end
end
end
end
diff --git a/qa/qa/page/project/operations/metrics/show.rb b/qa/qa/page/project/operations/metrics/show.rb
index 020a3a1d5f8..2228cca1d3d 100644
--- a/qa/qa/page/project/operations/metrics/show.rb
+++ b/qa/qa/page/project/operations/metrics/show.rb
@@ -14,17 +14,22 @@ module QA
element :dashboards_filter_dropdown
element :environments_dropdown
element :edit_dashboard_button
- element :show_last_dropdown
+ element :range_picker_dropdown
end
view 'app/assets/javascripts/monitoring/components/duplicate_dashboard_form.vue' do
element :duplicate_dashboard_filename_field
end
- view 'app/assets/javascripts/monitoring/components/panel_type.vue' do
+ view 'app/assets/javascripts/monitoring/components/dashboard_panel.vue' do
element :prometheus_graph_widgets
element :prometheus_widgets_dropdown
element :alert_widget_menu_item
+ element :generate_chart_link_menu_item
+ end
+
+ view 'app/assets/javascripts/vue_shared/components/date_time_picker/date_time_picker.vue' do
+ element :quick_range_item
end
def wait_for_metrics
@@ -66,9 +71,18 @@ module QA
end
def show_last(range = '8 hours')
- click_element :show_last_dropdown
- within_element :show_last_dropdown do
- click_on range
+ all_elements(:range_picker_dropdown, minimum: 1).first.click
+ click_element :quick_range_item, text: range
+ end
+
+ def copy_link_to_first_chart
+ all_elements(:prometheus_widgets_dropdown, minimum: 1).first.click
+ find_element(:generate_chart_link_menu_item)['data-clipboard-text']
+ end
+
+ def has_custom_metric?(metric)
+ within_element :prometheus_graphs do
+ has_text?(metric)
end
end
diff --git a/qa/qa/page/project/pipeline/index.rb b/qa/qa/page/project/pipeline/index.rb
index 327eedeaf91..54e4d0fb2fc 100644
--- a/qa/qa/page/project/pipeline/index.rb
+++ b/qa/qa/page/project/pipeline/index.rb
@@ -1,41 +1,45 @@
# frozen_string_literal: true
-module QA::Page
- module Project::Pipeline
- class Index < QA::Page::Base
- view 'app/assets/javascripts/pipelines/components/pipeline_url.vue' do
- element :pipeline_url_link
- end
-
- view 'app/assets/javascripts/pipelines/components/pipelines_table_row.vue' do
- element :pipeline_commit_status
- element :pipeline_retry_button
- end
-
- def click_on_latest_pipeline
- all_elements(:pipeline_url_link, minimum: 1, wait: QA::Support::Repeater::DEFAULT_MAX_WAIT_TIME).first.click
- end
-
- def wait_for_latest_pipeline_success
- wait_for_latest_pipeline_status { has_text?('passed') }
- end
-
- def wait_for_latest_pipeline_completion
- wait_for_latest_pipeline_status { has_text?('passed') || has_text?('failed') }
- end
-
- def wait_for_latest_pipeline_status
- wait_until(reload: false, max_duration: 360) do
- within_element_by_index(:pipeline_commit_status, 0) { yield }
- end
- end
-
- def wait_for_latest_pipeline_success_or_retry
- wait_for_latest_pipeline_completion
-
- if has_text?('failed')
- click_element :pipeline_retry_button
- wait_for_latest_pipeline_success
+module QA
+ module Page
+ module Project
+ module Pipeline
+ class Index < QA::Page::Base
+ view 'app/assets/javascripts/pipelines/components/pipeline_url.vue' do
+ element :pipeline_url_link
+ end
+
+ view 'app/assets/javascripts/pipelines/components/pipelines_table_row.vue' do
+ element :pipeline_commit_status
+ element :pipeline_retry_button
+ end
+
+ def click_on_latest_pipeline
+ all_elements(:pipeline_url_link, minimum: 1, wait: QA::Support::Repeater::DEFAULT_MAX_WAIT_TIME).first.click
+ end
+
+ def wait_for_latest_pipeline_success
+ wait_for_latest_pipeline_status { has_text?('passed') }
+ end
+
+ def wait_for_latest_pipeline_completion
+ wait_for_latest_pipeline_status { has_text?('passed') || has_text?('failed') }
+ end
+
+ def wait_for_latest_pipeline_status
+ wait_until(reload: false, max_duration: 360) do
+ within_element_by_index(:pipeline_commit_status, 0) { yield }
+ end
+ end
+
+ def wait_for_latest_pipeline_success_or_retry
+ wait_for_latest_pipeline_completion
+
+ if has_text?('failed')
+ click_element :pipeline_retry_button
+ wait_for_latest_pipeline_success
+ end
+ end
end
end
end
diff --git a/qa/qa/page/project/pipeline/show.rb b/qa/qa/page/project/pipeline/show.rb
index 1003b828a32..d22dfefc096 100644
--- a/qa/qa/page/project/pipeline/show.rb
+++ b/qa/qa/page/project/pipeline/show.rb
@@ -1,73 +1,77 @@
# frozen_string_literal: true
-module QA::Page
- module Project::Pipeline
- class Show < QA::Page::Base
- include Component::CiBadgeLink
-
- view 'app/assets/javascripts/vue_shared/components/header_ci_component.vue' do
- element :pipeline_header, /header class.*ci-header-container.*/ # rubocop:disable QA/ElementWithPattern
- end
+module QA
+ module Page
+ module Project
+ module Pipeline
+ class Show < QA::Page::Base
+ include Component::CiBadgeLink
+
+ view 'app/assets/javascripts/vue_shared/components/header_ci_component.vue' do
+ element :pipeline_header, /header class.*ci-header-container.*/ # rubocop:disable QA/ElementWithPattern
+ end
- view 'app/assets/javascripts/pipelines/components/graph/graph_component.vue' do
- element :pipeline_graph, /class.*pipeline-graph.*/ # rubocop:disable QA/ElementWithPattern
- end
+ view 'app/assets/javascripts/pipelines/components/graph/graph_component.vue' do
+ element :pipeline_graph, /class.*pipeline-graph.*/ # rubocop:disable QA/ElementWithPattern
+ end
- view 'app/assets/javascripts/pipelines/components/graph/job_item.vue' do
- element :job_component, /class.*ci-job-component.*/ # rubocop:disable QA/ElementWithPattern
- element :job_link
- end
+ view 'app/assets/javascripts/pipelines/components/graph/job_item.vue' do
+ element :job_component, /class.*ci-job-component.*/ # rubocop:disable QA/ElementWithPattern
+ element :job_link
+ end
- view 'app/assets/javascripts/pipelines/components/graph/linked_pipeline.vue' do
- element :linked_pipeline_button
- end
+ view 'app/assets/javascripts/pipelines/components/graph/linked_pipeline.vue' do
+ element :linked_pipeline_button
+ end
- view 'app/assets/javascripts/vue_shared/components/ci_icon.vue' do
- element :status_icon, 'ci-status-icon-${status}' # rubocop:disable QA/ElementWithPattern
- end
+ view 'app/assets/javascripts/vue_shared/components/ci_icon.vue' do
+ element :status_icon, 'ci-status-icon-${status}' # rubocop:disable QA/ElementWithPattern
+ end
- view 'app/views/projects/pipelines/_info.html.haml' do
- element :pipeline_badges
- end
+ view 'app/views/projects/pipelines/_info.html.haml' do
+ element :pipeline_badges
+ end
- def running?(wait: 0)
- within('.ci-header-container') do
- page.has_content?('running', wait: wait)
- end
- end
+ def running?(wait: 0)
+ within('.ci-header-container') do
+ page.has_content?('running', wait: wait)
+ end
+ end
- def has_build?(name, status: :success, wait: nil)
- within('.pipeline-graph') do
- within('.ci-job-component', text: name) do
- has_selector?(".ci-status-icon-#{status}", { wait: wait }.compact)
+ def has_build?(name, status: :success, wait: nil)
+ within('.pipeline-graph') do
+ within('.ci-job-component', text: name) do
+ has_selector?(".ci-status-icon-#{status}", { wait: wait }.compact)
+ end
+ end
end
- end
- end
- def has_job?(job_name)
- has_element?(:job_link, text: job_name)
- end
+ def has_job?(job_name)
+ has_element?(:job_link, text: job_name)
+ end
- def has_no_job?(job_name)
- has_no_element?(:job_link, text: job_name)
- end
+ def has_no_job?(job_name)
+ has_no_element?(:job_link, text: job_name)
+ end
- def has_tag?(tag_name)
- within_element(:pipeline_badges) do
- has_selector?('.badge', text: tag_name)
- end
- end
+ def has_tag?(tag_name)
+ within_element(:pipeline_badges) do
+ has_selector?('.badge', text: tag_name)
+ end
+ end
- def click_job(job_name)
- click_element(:job_link, text: job_name)
- end
+ def click_job(job_name)
+ click_element(:job_link, text: job_name)
+ end
- def click_linked_job(project_name)
- click_element(:linked_pipeline_button, text: /#{project_name}/)
- end
+ def click_linked_job(project_name)
+ click_element(:linked_pipeline_button, text: /#{project_name}/)
+ end
- def click_on_first_job
- first('.js-pipeline-graph-job-link', wait: QA::Support::Repeater::DEFAULT_MAX_WAIT_TIME).click
+ def click_on_first_job
+ first('.js-pipeline-graph-job-link', wait: QA::Support::Repeater::DEFAULT_MAX_WAIT_TIME).click
+ end
+ end
end
end
end
diff --git a/qa/qa/page/project/settings/advanced.rb b/qa/qa/page/project/settings/advanced.rb
index c95c47fa560..3bb5181a31c 100644
--- a/qa/qa/page/project/settings/advanced.rb
+++ b/qa/qa/page/project/settings/advanced.rb
@@ -57,6 +57,10 @@ module QA
click_element :download_export_link
end
+ def has_download_export_link?
+ has_element? :download_export_link
+ end
+
def archive_project
page.accept_alert("Are you sure that you want to archive this project?") do
click_element :archive_project_link
diff --git a/qa/qa/page/project/settings/ci_cd.rb b/qa/qa/page/project/settings/ci_cd.rb
index 46f93fad61e..aa27c030b78 100644
--- a/qa/qa/page/project/settings/ci_cd.rb
+++ b/qa/qa/page/project/settings/ci_cd.rb
@@ -5,12 +5,19 @@ module QA
module Project
module Settings
class CICD < Page::Base
- include Common
+ include QA::Page::Settings::Common
view 'app/views/projects/settings/ci_cd/show.html.haml' do
element :autodevops_settings_content
element :runners_settings_content
element :variables_settings_content
+ element :general_pipelines_settings_content
+ end
+
+ def expand_general_pipelines(&block)
+ expand_section(:general_pipelines_settings_content) do
+ Settings::GeneralPipelines.perform(&block)
+ end
end
def expand_runners_settings(&block)
diff --git a/qa/qa/page/project/settings/ci_variables.rb b/qa/qa/page/project/settings/ci_variables.rb
index 6cdf40cd1da..de268b14aa2 100644
--- a/qa/qa/page/project/settings/ci_variables.rb
+++ b/qa/qa/page/project/settings/ci_variables.rb
@@ -5,7 +5,7 @@ module QA
module Project
module Settings
class CiVariables < Page::Base
- include Common
+ include QA::Page::Settings::Common
view 'app/assets/javascripts/ci_variable_list/components/ci_variable_modal.vue' do
element :ci_variable_key_field
diff --git a/qa/qa/page/project/settings/common.rb b/qa/qa/page/project/settings/common.rb
deleted file mode 100644
index f5f22623060..00000000000
--- a/qa/qa/page/project/settings/common.rb
+++ /dev/null
@@ -1,13 +0,0 @@
-# frozen_string_literal: true
-
-module QA
- module Page
- module Project
- module Settings
- module Common
- include QA::Page::Settings::Common
- end
- end
- end
- end
-end
diff --git a/qa/qa/page/project/settings/deploy_keys.rb b/qa/qa/page/project/settings/deploy_keys.rb
index c330d090ce6..8d655b0684e 100644
--- a/qa/qa/page/project/settings/deploy_keys.rb
+++ b/qa/qa/page/project/settings/deploy_keys.rb
@@ -5,7 +5,7 @@ module QA
module Project
module Settings
class DeployKeys < Page::Base
- view 'app/views/projects/deploy_keys/_form.html.haml' do
+ view 'app/views/shared/deploy_keys/_form.html.haml' do
element :deploy_key_title, 'text_field :title' # rubocop:disable QA/ElementWithPattern
element :deploy_key_key, 'text_area :key' # rubocop:disable QA/ElementWithPattern
end
diff --git a/qa/qa/page/project/settings/general_pipelines.rb b/qa/qa/page/project/settings/general_pipelines.rb
new file mode 100644
index 00000000000..5a98849a41d
--- /dev/null
+++ b/qa/qa/page/project/settings/general_pipelines.rb
@@ -0,0 +1,23 @@
+# frozen_string_literal: true
+
+module QA
+ module Page
+ module Project
+ module Settings
+ class GeneralPipelines < Page::Base
+ include QA::Page::Settings::Common
+
+ view 'app/views/projects/settings/ci_cd/_form.html.haml' do
+ element :build_coverage_regex_field
+ element :save_general_pipelines_changes_button
+ end
+
+ def configure_coverage_regex(pattern)
+ fill_element :build_coverage_regex_field, pattern
+ click_element :save_general_pipelines_changes_button
+ end
+ end
+ end
+ end
+ end
+end
diff --git a/qa/qa/page/project/settings/incidents.rb b/qa/qa/page/project/settings/incidents.rb
new file mode 100644
index 00000000000..94d5fc369ad
--- /dev/null
+++ b/qa/qa/page/project/settings/incidents.rb
@@ -0,0 +1,37 @@
+# frozen_string_literal: true
+
+module QA
+ module Page
+ module Project
+ module Settings
+ class Incidents < Page::Base
+ view 'app/views/projects/settings/operations/_incidents.html.haml' do
+ element :create_issue_checkbox
+ element :incident_templates_dropdown
+ element :save_changes_button
+ end
+
+ def enable_issues_for_incidents
+ check_element :create_issue_checkbox
+ end
+
+ def select_issue_template(template)
+ within_element :incident_templates_dropdown do
+ find(:option, template).select_option
+ end
+ end
+
+ def save_incident_settings
+ click_element :save_changes_button
+ end
+
+ def has_template?(template)
+ within_element :incident_templates_dropdown do
+ has_text?(template)
+ end
+ end
+ end
+ end
+ end
+ end
+end
diff --git a/qa/qa/page/project/settings/integrations.rb b/qa/qa/page/project/settings/integrations.rb
new file mode 100644
index 00000000000..436a42fb093
--- /dev/null
+++ b/qa/qa/page/project/settings/integrations.rb
@@ -0,0 +1,19 @@
+# frozen_string_literal: true
+
+module QA
+ module Page
+ module Project
+ module Settings
+ class Integrations < QA::Page::Base
+ view 'app/views/shared/integrations/_index.html.haml' do
+ element :prometheus_link, '{ data: { qa_selector: "#{integration.to_param' # rubocop:disable QA/ElementWithPattern
+ end
+
+ def click_on_prometheus_integration
+ click_element :prometheus_link
+ end
+ end
+ end
+ end
+ end
+end
diff --git a/qa/qa/page/project/settings/main.rb b/qa/qa/page/project/settings/main.rb
index 18d55598d90..efae497b6ba 100644
--- a/qa/qa/page/project/settings/main.rb
+++ b/qa/qa/page/project/settings/main.rb
@@ -5,7 +5,7 @@ module QA
module Project
module Settings
class Main < Page::Base
- include Common
+ include QA::Page::Settings::Common
include Component::Select2
include SubMenus::Project
diff --git a/qa/qa/page/project/settings/merge_request.rb b/qa/qa/page/project/settings/merge_request.rb
index 7da2c9d168c..0092426b31f 100644
--- a/qa/qa/page/project/settings/merge_request.rb
+++ b/qa/qa/page/project/settings/merge_request.rb
@@ -5,7 +5,7 @@ module QA
module Project
module Settings
class MergeRequest < QA::Page::Base
- include Common
+ include QA::Page::Settings::Common
view 'app/views/projects/edit.html.haml' do
element :save_merge_request_changes
diff --git a/qa/qa/page/project/settings/operations.rb b/qa/qa/page/project/settings/operations.rb
new file mode 100644
index 00000000000..f6e005d3189
--- /dev/null
+++ b/qa/qa/page/project/settings/operations.rb
@@ -0,0 +1,23 @@
+# frozen_string_literal: true
+
+module QA
+ module Page
+ module Project
+ module Settings
+ class Operations < Page::Base
+ include QA::Page::Settings::Common
+
+ view 'app/views/projects/settings/operations/_incidents.html.haml' do
+ element :incidents_settings_content
+ end
+
+ def expand_incidents(&block)
+ expand_section(:incidents_settings_content) do
+ Settings::Incidents.perform(&block)
+ end
+ end
+ end
+ end
+ end
+ end
+end
diff --git a/qa/qa/page/project/settings/repository.rb b/qa/qa/page/project/settings/repository.rb
index 8810b971fda..8e9a24a4741 100644
--- a/qa/qa/page/project/settings/repository.rb
+++ b/qa/qa/page/project/settings/repository.rb
@@ -5,7 +5,7 @@ module QA
module Project
module Settings
class Repository < Page::Base
- include Common
+ include QA::Page::Settings::Common
view 'app/views/projects/protected_branches/shared/_index.html.haml' do
element :protected_branches_settings
@@ -19,7 +19,7 @@ module QA
element :deploy_tokens_settings
end
- view 'app/views/projects/deploy_keys/_index.html.haml' do
+ view 'app/views/shared/deploy_keys/_index.html.haml' do
element :deploy_keys_settings
end
diff --git a/qa/qa/page/project/settings/services/prometheus.rb b/qa/qa/page/project/settings/services/prometheus.rb
new file mode 100644
index 00000000000..8ae4ded535e
--- /dev/null
+++ b/qa/qa/page/project/settings/services/prometheus.rb
@@ -0,0 +1,36 @@
+# frozen_string_literal: true
+
+module QA
+ module Page
+ module Project
+ module Settings
+ module Services
+ class Prometheus < Page::Base
+ include Page::Component::CustomMetric
+
+ view 'app/views/projects/services/prometheus/_custom_metrics.html.haml' do
+ element :custom_metrics_container
+ element :new_metric_button
+ end
+
+ def click_on_custom_metric(custom_metric)
+ within_element :custom_metrics_container do
+ click_on custom_metric
+ end
+ end
+
+ def click_on_new_metric
+ click_element :new_metric_button
+ end
+
+ def has_custom_metric?(custom_metric)
+ within_element :custom_metrics_container do
+ has_text? custom_metric
+ end
+ end
+ end
+ end
+ end
+ end
+ end
+end
diff --git a/qa/qa/page/project/sub_menus/ci_cd.rb b/qa/qa/page/project/sub_menus/ci_cd.rb
index 2f0bc8b9ba6..9405ea97fff 100644
--- a/qa/qa/page/project/sub_menus/ci_cd.rb
+++ b/qa/qa/page/project/sub_menus/ci_cd.rb
@@ -5,10 +5,14 @@ module QA
module Project
module SubMenus
module CiCd
- include Page::Project::SubMenus::Common
+ extend QA::Page::PageConcern
def self.included(base)
+ super
+
base.class_eval do
+ include QA::Page::Project::SubMenus::Common
+
view 'app/views/layouts/nav/sidebar/_project.html.haml' do
element :link_pipelines
end
diff --git a/qa/qa/page/project/sub_menus/common.rb b/qa/qa/page/project/sub_menus/common.rb
index da759398cff..85bf932be4a 100644
--- a/qa/qa/page/project/sub_menus/common.rb
+++ b/qa/qa/page/project/sub_menus/common.rb
@@ -5,6 +5,7 @@ module QA
module Project
module SubMenus
module Common
+ extend QA::Page::PageConcern
include QA::Page::SubMenus::Common
private
diff --git a/qa/qa/page/project/sub_menus/issues.rb b/qa/qa/page/project/sub_menus/issues.rb
index d27a250a300..c15a8ec4cc7 100644
--- a/qa/qa/page/project/sub_menus/issues.rb
+++ b/qa/qa/page/project/sub_menus/issues.rb
@@ -5,10 +5,14 @@ module QA
module Project
module SubMenus
module Issues
- include Page::Project::SubMenus::Common
+ extend QA::Page::PageConcern
def self.included(base)
+ super
+
base.class_eval do
+ include QA::Page::Project::SubMenus::Common
+
view 'app/views/layouts/nav/sidebar/_project.html.haml' do
element :issue_boards_link
element :issues_item
diff --git a/qa/qa/page/project/sub_menus/operations.rb b/qa/qa/page/project/sub_menus/operations.rb
index bcbc1dc16d3..ff9c8a21174 100644
--- a/qa/qa/page/project/sub_menus/operations.rb
+++ b/qa/qa/page/project/sub_menus/operations.rb
@@ -5,12 +5,16 @@ module QA
module Project
module SubMenus
module Operations
- include Page::Project::SubMenus::Common
+ extend QA::Page::PageConcern
def self.included(base)
+ super
+
base.class_eval do
+ include QA::Page::Project::SubMenus::Common
+
view 'app/views/layouts/nav/sidebar/_project.html.haml' do
- element :link_operations
+ element :operations_link
element :operations_environments_link
element :operations_metrics_link
end
@@ -45,8 +49,8 @@ module QA
def hover_operations
within_sidebar do
- scroll_to_element(:link_operations)
- find_element(:link_operations).hover
+ scroll_to_element(:operations_link)
+ find_element(:operations_link).hover
yield
end
diff --git a/qa/qa/page/project/sub_menus/project.rb b/qa/qa/page/project/sub_menus/project.rb
index 6f1bc131f84..4af640301b9 100644
--- a/qa/qa/page/project/sub_menus/project.rb
+++ b/qa/qa/page/project/sub_menus/project.rb
@@ -5,10 +5,14 @@ module QA
module Project
module SubMenus
module Project
- include Common
+ extend QA::Page::PageConcern
def self.included(base)
+ super
+
base.class_eval do
+ include QA::Page::Project::SubMenus::Common
+
view 'app/views/layouts/nav/sidebar/_project.html.haml' do
element :project_link
end
diff --git a/qa/qa/page/project/sub_menus/repository.rb b/qa/qa/page/project/sub_menus/repository.rb
index 65149e631f3..38d6b8e50f4 100644
--- a/qa/qa/page/project/sub_menus/repository.rb
+++ b/qa/qa/page/project/sub_menus/repository.rb
@@ -5,10 +5,14 @@ module QA
module Project
module SubMenus
module Repository
- include Page::Project::SubMenus::Common
+ extend QA::Page::PageConcern
def self.included(base)
+ super
+
base.class_eval do
+ include QA::Page::Project::SubMenus::Common
+
view 'app/views/layouts/nav/sidebar/_project.html.haml' do
element :project_menu_repo
element :branches_link
@@ -44,5 +48,3 @@ module QA
end
end
end
-
-QA::Page::Project::SubMenus::Repository.prepend_if_ee('QA::EE::Page::Project::SubMenus::Repository')
diff --git a/qa/qa/page/project/sub_menus/settings.rb b/qa/qa/page/project/sub_menus/settings.rb
index 8be442ba35d..0dd4bd1817a 100644
--- a/qa/qa/page/project/sub_menus/settings.rb
+++ b/qa/qa/page/project/sub_menus/settings.rb
@@ -5,15 +5,20 @@ module QA
module Project
module SubMenus
module Settings
- include Page::Project::SubMenus::Common
+ extend QA::Page::PageConcern
def self.included(base)
+ super
+
base.class_eval do
+ include QA::Page::Project::SubMenus::Common
+
view 'app/views/layouts/nav/sidebar/_project.html.haml' do
element :settings_item
element :link_members_settings
element :general_settings_link
element :integrations_settings_link
+ element :operations_settings_link
end
end
end
@@ -64,6 +69,14 @@ module QA
end
end
+ def go_to_operations_settings
+ hover_settings do
+ within_submenu do
+ click_element :operations_settings_link
+ end
+ end
+ end
+
private
def hover_settings