Commit 1af7ca8a authored by Tiffany Rea's avatar Tiffany Rea Committed by Dan Davison

Add new lib and e2e test for pipeline subscriptions

Add new selectors in CICD settings
Add new selectors in pipeline subscriptions
Add new class to ee.rb
New page object for EE CICD settings
New page object for EE pipeline subscriptions
New resource for EE pipeline subscriptions
Update page object CICD settings
New E2E test for pipeline subscriptions
parent 1c0e9437
......@@ -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
......@@ -216,6 +218,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