Commit 1af80ed1 authored by Anastasia McDonald's avatar Anastasia McDonald

Merge branch 'jmd-fix-selectors-jenkins-e2e' into 'master'

Dequarantine jenkins_build_status_spec E2E

See merge request gitlab-org/gitlab!83268
parents 67985489 11d94d9e
......@@ -7,10 +7,10 @@ module QA
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
element :service_jenkins_url_field, ':data-qa-selector="`${fieldId}_field`"' # rubocop:disable QA/ElementWithPattern
element :service_project_name_field, ':data-qa-selector="`${fieldId}_field`"' # rubocop:disable QA/ElementWithPattern
element :service_username_field, ':data-qa-selector="`${fieldId}_field`"' # rubocop:disable QA/ElementWithPattern
element :service_password_field, ':data-qa-selector="`${fieldId}_field`"' # rubocop:disable QA/ElementWithPattern
end
view 'app/assets/javascripts/integrations/edit/components/integration_form.vue' do
......@@ -28,19 +28,19 @@ module QA
private
def set_jenkins_url(jenkins_url)
fill_element(:jenkins_url_field, jenkins_url)
fill_element(:service_jenkins_url_field, jenkins_url)
end
def set_project_name(project_name)
fill_element(:project_name_field, project_name)
fill_element(:service_project_name_field, project_name)
end
def set_username(username)
fill_element(:username_field, username)
fill_element(:service_username_field, username)
end
def set_password(password)
fill_element(:password_field, password)
fill_element(:service_password_field, password)
end
def click_save_changes_button
......
# frozen_string_literal: true
module QA
RSpec.describe 'Create', :requires_admin, :skip_live_env, quarantine: { issue: 'https://gitlab.com/gitlab-org/gitlab/-/issues/195179', type: :flaky } do
RSpec.describe 'Create', :requires_admin, :skip_live_env do
describe 'Jenkins integration' do
let(:project_name) { "project_with_jenkins_#{SecureRandom.hex(4)}" }
......@@ -30,7 +30,7 @@ module QA
setup_project_integration_with_jenkins
expect(page).to have_text("Jenkins CI activated.")
expect(page).to have_text("Jenkins settings saved and active.")
QA::Support::Retrier.retry_on_exception do
Resource::Repository::ProjectPush.fabricate! do |push|
......
......@@ -49,7 +49,7 @@ module QA
error_code = 404 if Nokogiri::HTML.parse(page.html).xpath("//img").map { |t| t[:alt] }.first.eql?('404')
# 500 error page in header surrounded by newlines, try to match
five_hundred_test = Nokogiri::HTML.parse(page.html).xpath("//h1").map.first
five_hundred_test = Nokogiri::HTML.parse(page.html).xpath("//h1/text()").map.first
unless five_hundred_test.nil?
error_code = 500 if five_hundred_test.text.include?('500')
end
......
......@@ -15,6 +15,7 @@ module QA
def configure(scm_url:)
set_git_source_code_management_url(scm_url)
set_git_branches_to_build("*/#{Runtime::Env.default_branch}")
click_build_when_change_is_pushed_to_gitlab
set_publish_status_to_gitlab
......@@ -31,6 +32,10 @@ module QA
set_repository_url(repository_url)
end
def set_git_branches_to_build(branches)
find('.setting-name', text: "Branch Specifier (blank for 'any')").find(:xpath, "..").find('input').set branches
end
def click_build_when_change_is_pushed_to_gitlab
find('label', text: 'Build when a change is pushed to GitLab').find(:xpath, "..").find('input').click
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