diff options
Diffstat (limited to 'qa/qa/page/project/settings')
-rw-r--r-- | qa/qa/page/project/settings/integrations.rb | 4 | ||||
-rw-r--r-- | qa/qa/page/project/settings/protected_branches.rb | 2 | ||||
-rw-r--r-- | qa/qa/page/project/settings/services/jenkins.rb | 54 |
3 files changed, 57 insertions, 3 deletions
diff --git a/qa/qa/page/project/settings/integrations.rb b/qa/qa/page/project/settings/integrations.rb index e18ff71bcb3..dd676c86486 100644 --- a/qa/qa/page/project/settings/integrations.rb +++ b/qa/qa/page/project/settings/integrations.rb @@ -6,8 +6,8 @@ module QA 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 - element :jira_link, '{ data: { qa_selector: "#{integration.to_param' # rubocop:disable QA/ElementWithPattern + element :prometheus_link, 'data: { qa_selector: "#{integration.to_param' # rubocop:disable QA/ElementWithPattern + element :jira_link, 'data: { qa_selector: "#{integration.to_param' # rubocop:disable QA/ElementWithPattern end def click_on_prometheus_integration diff --git a/qa/qa/page/project/settings/protected_branches.rb b/qa/qa/page/project/settings/protected_branches.rb index 7315bfb76a5..6616921f34c 100644 --- a/qa/qa/page/project/settings/protected_branches.rb +++ b/qa/qa/page/project/settings/protected_branches.rb @@ -58,7 +58,7 @@ module QA allowed[:roles] = Resource::ProtectedBranch::Roles::NO_ONE unless allowed.key?(:roles) within_element(:"allowed_to_#{action}_dropdown") do - click_on allowed[:roles] + click_on allowed[:roles][:description] allowed[:users].each { |user| click_on user.username } if allowed.key?(:users) allowed[:groups].each { |group| click_on group.name } if allowed.key?(:groups) end diff --git a/qa/qa/page/project/settings/services/jenkins.rb b/qa/qa/page/project/settings/services/jenkins.rb new file mode 100644 index 00000000000..3d7da8d0161 --- /dev/null +++ b/qa/qa/page/project/settings/services/jenkins.rb @@ -0,0 +1,54 @@ +# frozen_string_literal: true + +module QA + module Page + module Project + module Settings + module Services + class Jenkins < QA::Page::Base + view 'app/assets/javascripts/integrations/edit/components/dynamic_field.vue' do + element :jenkins_url_field, ':data-qa-selector="`${fieldId}_field`"' # rubocop:disable QA/ElementWithPattern + element :project_name_field, ':data-qa-selector="`${fieldId}_field`"' # rubocop:disable QA/ElementWithPattern + element :username_field, ':data-qa-selector="`${fieldId}_field`"' # rubocop:disable QA/ElementWithPattern + element :password_field, ':data-qa-selector="`${fieldId}_field`"' # rubocop:disable QA/ElementWithPattern + end + + view 'app/assets/javascripts/integrations/edit/components/integration_form.vue' do + element :save_changes_button + end + + def setup_service_with(jenkins_url:, project_name:) + set_jenkins_url(jenkins_url) + set_project_name(project_name) + set_username('admin') + set_password('password') + click_save_changes_button + end + + private + + def set_jenkins_url(jenkins_url) + fill_element(:jenkins_url_field, jenkins_url) + end + + def set_project_name(project_name) + fill_element(:project_name_field, project_name) + end + + def set_username(username) + fill_element(:username_field, username) + end + + def set_password(password) + fill_element(:password_field, password) + end + + def click_save_changes_button + click_element :save_changes_button + end + end + end + end + end + end +end |