Commit 43d7662d authored by Tanya Pazitny's avatar Tanya Pazitny

Merge branch 'qa-refactor-cicd-pages-1' into 'master'

Refactor elements used by ci_variable and ::CICD

See merge request gitlab-org/gitlab-ce!30922
parents 51a54cfc 9bf08867
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
= @project.name = @project.name
%ul.sidebar-top-level-items %ul.sidebar-top-level-items
= nav_link(path: sidebar_projects_paths, html_options: { class: 'home' }) do = nav_link(path: sidebar_projects_paths, html_options: { class: 'home' }) do
= link_to project_path(@project), class: 'shortcuts-project qa-link-project' do = link_to project_path(@project), class: 'shortcuts-project', data: { qa_selector: 'project_link' } do
.nav-icon-container .nav-icon-container
= sprite_icon('home') = sprite_icon('home')
%span.nav-item-name %span.nav-item-name
...@@ -26,7 +26,7 @@ ...@@ -26,7 +26,7 @@
%span= _('Details') %span= _('Details')
= nav_link(path: 'projects#activity') do = nav_link(path: 'projects#activity') do
= link_to activity_project_path(@project), title: _('Activity'), class: 'shortcuts-project-activity qa-activity-link' do = link_to activity_project_path(@project), title: _('Activity'), class: 'shortcuts-project-activity', data: { qa_selector: 'activity_link' } do
%span= _('Activity') %span= _('Activity')
- if project_nav_tab?(:releases) - if project_nav_tab?(:releases)
...@@ -146,7 +146,7 @@ ...@@ -146,7 +146,7 @@
- if project_nav_tab? :merge_requests - if project_nav_tab? :merge_requests
= nav_link(controller: @project.issues_enabled? ? :merge_requests : [:merge_requests, :labels, :milestones]) do = nav_link(controller: @project.issues_enabled? ? :merge_requests : [:merge_requests, :labels, :milestones]) do
= link_to project_merge_requests_path(@project), class: 'shortcuts-merge_requests qa-merge-requests-link' do = link_to project_merge_requests_path(@project), class: 'shortcuts-merge_requests', data: { qa_selector: 'merge_requests_link' } do
.nav-icon-container .nav-icon-container
= sprite_icon('git-merge') = sprite_icon('git-merge')
%span.nav-item-name#js-onboarding-mr-link %span.nav-item-name#js-onboarding-mr-link
...@@ -277,7 +277,7 @@ ...@@ -277,7 +277,7 @@
- if project_nav_tab? :wiki - if project_nav_tab? :wiki
- wiki_url = project_wiki_path(@project, :home) - wiki_url = project_wiki_path(@project, :home)
= nav_link(controller: :wikis) do = nav_link(controller: :wikis) do
= link_to wiki_url, class: 'shortcuts-wiki qa-wiki-link' do = link_to wiki_url, class: 'shortcuts-wiki', data: { qa_selector: 'wiki_link' } do
.nav-icon-container .nav-icon-container
= sprite_icon('book') = sprite_icon('book')
%span.nav-item-name %span.nav-item-name
......
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
.card.auto-devops-card .card.auto-devops-card
.card-body .card-body
.form-check .form-check
= form.check_box :enabled, class: 'form-check-input js-toggle-extra-settings', checked: auto_devops_enabled = form.check_box :enabled, class: 'form-check-input js-toggle-extra-settings', checked: auto_devops_enabled, data: { qa_selector: 'enable_autodevops_checkbox' }
= form.label :enabled, class: 'form-check-label' do = form.label :enabled, class: 'form-check-label' do
%strong= s_('CICD|Default to Auto DevOps pipeline') %strong= s_('CICD|Default to Auto DevOps pipeline')
- if auto_devops_enabled - if auto_devops_enabled
...@@ -42,4 +42,4 @@ ...@@ -42,4 +42,4 @@
= s_('CICD|Automatic deployment to staging, manual deployment to production') = s_('CICD|Automatic deployment to staging, manual deployment to production')
= link_to icon('question-circle'), help_page_path('topics/autodevops/index.md', anchor: 'incremental-rollout-to-production'), target: '_blank' = link_to icon('question-circle'), help_page_path('topics/autodevops/index.md', anchor: 'incremental-rollout-to-production'), target: '_blank'
= f.submit _('Save changes'), class: "btn btn-success prepend-top-15" = f.submit _('Save changes'), class: "btn btn-success prepend-top-15", data: { qa_selector: 'save_changes_button' }
...@@ -16,7 +16,7 @@ ...@@ -16,7 +16,7 @@
.settings-content .settings-content
= render 'form' = render 'form'
%section.qa-autodevops-settings.settings#autodevops-settings.no-animate{ class: ('expanded' if expanded) } %section.settings#autodevops-settings.no-animate{ class: ('expanded' if expanded), data: { qa_selector: 'autodevops_settings_content' } }
.settings-header .settings-header
%h4 %h4
= s_('CICD|Auto DevOps') = s_('CICD|Auto DevOps')
...@@ -30,7 +30,7 @@ ...@@ -30,7 +30,7 @@
= render_if_exists 'projects/settings/ci_cd/protected_environments', expanded: expanded = render_if_exists 'projects/settings/ci_cd/protected_environments', expanded: expanded
%section.qa-runners-settings.settings.no-animate#js-runners-settings{ class: ('expanded' if expanded) } %section.settings.no-animate#js-runners-settings{ class: ('expanded' if expanded), data: { qa_selector: 'runners_settings_content' } }
.settings-header .settings-header
%h4 %h4
= _("Runners") = _("Runners")
...@@ -41,7 +41,7 @@ ...@@ -41,7 +41,7 @@
.settings-content .settings-content
= render 'projects/runners/index' = render 'projects/runners/index'
%section.qa-variables-settings.settings.no-animate{ class: ('expanded' if expanded) } %section.settings.no-animate{ class: ('expanded' if expanded), data: { qa_selector: 'variables_settings_content' } }
.settings-header .settings-header
= render 'ci/variables/header', expanded: expanded = render 'ci/variables/header', expanded: expanded
.settings-content .settings-content
......
...@@ -8,33 +8,32 @@ module QA ...@@ -8,33 +8,32 @@ module QA
include Common include Common
view 'app/views/projects/settings/ci_cd/show.html.haml' do view 'app/views/projects/settings/ci_cd/show.html.haml' do
element :autodevops_settings element :autodevops_settings_content
element :runners_settings element :runners_settings_content
element :variables_settings element :variables_settings_content
end end
view 'app/views/projects/settings/ci_cd/_autodevops_form.html.haml' do view 'app/views/projects/settings/ci_cd/_autodevops_form.html.haml' do
element :enable_auto_devops_field, 'check_box :enabled' # rubocop:disable QA/ElementWithPattern element :enable_autodevops_checkbox
element :enable_auto_devops_button, "%strong= s_('CICD|Default to Auto DevOps pipeline')" # rubocop:disable QA/ElementWithPattern element :save_changes_button
element :save_changes_button, "submit _('Save changes')" # rubocop:disable QA/ElementWithPattern
end end
def expand_runners_settings(&block) def expand_runners_settings(&block)
expand_section(:runners_settings) do expand_section(:runners_settings_content) do
Settings::Runners.perform(&block) Settings::Runners.perform(&block)
end end
end end
def expand_ci_variables(&block) def expand_ci_variables(&block)
expand_section(:variables_settings) do expand_section(:variables_settings_content) do
Settings::CiVariables.perform(&block) Settings::CiVariables.perform(&block)
end end
end end
def enable_auto_devops def enable_auto_devops
expand_section(:autodevops_settings) do expand_section(:autodevops_settings_content) do
check 'Default to Auto DevOps pipeline' check_element :enable_autodevops_checkbox
click_on 'Save changes' click_element :save_changes_button
end end
end end
end end
......
...@@ -10,7 +10,7 @@ module QA ...@@ -10,7 +10,7 @@ module QA
def self.included(base) def self.included(base)
base.class_eval do base.class_eval do
view 'app/views/layouts/nav/sidebar/_project.html.haml' do view 'app/views/layouts/nav/sidebar/_project.html.haml' do
element :link_project element :project_link
end end
end end
end end
...@@ -18,7 +18,7 @@ module QA ...@@ -18,7 +18,7 @@ module QA
def click_project def click_project
retry_on_exception do retry_on_exception do
within_sidebar do within_sidebar do
click_element(:link_project) click_element(:project_link)
end 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