summaryrefslogtreecommitdiff
path: root/qa/qa/vendor/jenkins/page/last_job_console.rb
blob: f41b91c2cdb598c13b6fe83cd68eb77db318c79a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
# frozen_string_literal: true

require 'capybara/dsl'

module QA
  module Vendor
    module Jenkins
      module Page
        class LastJobConsole < Page::Base
          attr_accessor :job_name

          def path
            "/job/#{@job_name}/lastBuild/console"
          end

          def has_successful_build?
            # Retry on errors such as:
            # Selenium::WebDriver::Error::JavascriptError:
            #   javascript error: this.each is not a function
            Support::Retrier.retry_on_exception(reload_page: page) do
              page.has_text?('Finished: SUCCESS')
            end
          end

          def no_failed_status_update?
            page.has_no_text?('Failed to update Gitlab commit status')
          end
        end
      end
    end
  end
end