Commit 762b9ae0 authored by Dan Davison's avatar Dan Davison

Merge branch 'project-subscription-framework' into 'master'

Add new logics for pipeline subscriptions to framework

See merge request gitlab-org/gitlab!57175
parents 72d6750e 1af7ca8a
......@@ -2,7 +2,7 @@
- expanded = expanded_by_default?
%section.settings.no-animate#pipeline-subscriptions{ class: ('expanded' if expanded) }
%section.settings.no-animate#pipeline-subscriptions{ class: ('expanded' if expanded), data: { qa_selector: 'pipeline_subscriptions_setting_content' } }
.settings-header
%h4.settings-title.js-settings-toggle.js-settings-toggle-trigger-only
= _("Pipeline subscriptions")
......
......@@ -5,8 +5,8 @@
.form-group
= f.label :upstream_project_path do
= _("Project path")
= f.text_field :upstream_project_path, class: "form-control"
= f.submit _('Subscribe'), class: "btn btn-success"
= f.text_field :upstream_project_path, class: "form-control", data: { qa_selector: "upstream_project_path_field" }
= f.submit _('Subscribe'), class: "btn btn-success", data: { qa_selector: "subscribe_button" }
.row.gl-mt-3.gl-mb-3
.col-lg-12
......
......@@ -147,6 +147,8 @@ module QA
autoload :PushRules, 'qa/ee/page/project/settings/push_rules'
autoload :LicenseCompliance, 'qa/ee/page/project/settings/license_compliance'
autoload :IssueTemplateDefault, 'qa/ee/page/project/settings/issue_template_default.rb'
autoload :CICD, 'qa/ee/page/project/settings/ci_cd'
autoload :PipelineSubscriptions, 'qa/ee/page/project/settings/pipeline_subscriptions'
end
module Operations
......@@ -217,6 +219,7 @@ module QA
autoload :GroupLabel, 'qa/ee/resource/group_label'
autoload :GroupIteration, 'qa/ee/resource/group_iteration'
autoload :ImportRepoWithCICD, 'qa/ee/resource/import_repo_with_ci_cd'
autoload :PipelineSubscriptions, 'qa/ee/resource/pipeline_subscriptions'
module Board
autoload :BaseBoard, 'qa/ee/resource/board/base_board'
......
# frozen_string_literal: true
module QA
module EE
module Page
module Project
module Settings
module CICD
extend QA::Page::PageConcern
def self.prepended(base)
super
base.class_eval do
include Page::Component::SecureReport
view 'ee/app/views/projects/settings/ci_cd/_pipeline_subscriptions.html.haml' do
element :pipeline_subscriptions_setting_content
end
end
end
def expand_pipeline_subscriptions(&block)
expand_content(:pipeline_subscriptions_setting_content) do
Settings::PipelineSubscriptions.perform(&block)
end
end
end
end
end
end
end
end
# frozen_string_literal: true
module QA
module EE
module Page
module Project
module Settings
class PipelineSubscriptions < QA::Page::Base
view 'ee/app/views/projects/settings/subscriptions/_index.html.haml' do
element :upstream_project_path_field
element :subscribe_button
end
def subscribe(project_path)
fill_element(:upstream_project_path_field, project_path)
click_element(:subscribe_button)
end
end
end
end
end
end
end
# frozen_string_literal: true
module QA
module EE
module Resource
class PipelineSubscriptions < QA::Resource::Base
attr_accessor :project_path
def fabricate!
QA::Page::Project::Menu.perform(&:go_to_ci_cd_settings)
QA::Page::Project::Settings::CICD.perform do |setting|
setting.expand_pipeline_subscriptions do |page|
page.subscribe(project_path)
end
end
end
end
end
end
end
......@@ -42,3 +42,5 @@ module QA
end
end
end
QA::Page::Project::Settings::CICD.prepend_if_ee("QA::EE::Page::Project::Settings::CICD")
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