Commit c5aa8570 authored by Tanya Pazitny's avatar Tanya Pazitny

Merge branch 'qa-shl-fix-flaky-jenkins-spec' into 'master'

Fix flaky Jenkins end-to-end test spec

Closes #195179

See merge request gitlab-org/gitlab!24849
parents c8ace7cd 4c500af3
......@@ -469,6 +469,7 @@ module QA
autoload :Configure, 'qa/vendor/jenkins/page/configure'
autoload :NewCredentials, 'qa/vendor/jenkins/page/new_credentials'
autoload :NewJob, 'qa/vendor/jenkins/page/new_job'
autoload :Job, 'qa/vendor/jenkins/page/job'
autoload :ConfigureJob, 'qa/vendor/jenkins/page/configure_job'
end
end
......
......@@ -41,9 +41,20 @@ module QA
push.file_name = "file_#{SecureRandom.hex(4)}.txt"
end
Vendor::Jenkins::Page::Job.perform do |job|
job.job_name = project_name
job.visit!
Support::Waiter.wait_until(sleep_interval: 1, reload_page: page) do
job.has_successful_build?
end
end
project.visit!
Page::Project::Menu.perform(&:click_ci_cd_pipelines)
Page::Project::Pipeline::Index.perform(&:click_on_latest_pipeline)
Page::Project::Pipeline::Show.perform do |show|
......
# frozen_string_literal: true
require 'capybara/dsl'
module QA
module Vendor
module Jenkins
module Page
class Job < Page::Base
attr_accessor :job_name
def path
"/job/#{@job_name}"
end
def has_successful_build?
page.has_text?("Last successful build")
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