diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-02-13 18:09:00 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-02-13 18:09:00 +0000 |
commit | e4dffdfe364af6c72dcb6b4671cb39a24e8e100c (patch) | |
tree | 6428a1c3472b14396645dcb280b219dbc0420c66 /qa/qa/page/component | |
parent | 0ab47b994caa80c5587f33dc818626b66cfdafe2 (diff) | |
download | gitlab-ce-e4dffdfe364af6c72dcb6b4671cb39a24e8e100c.tar.gz |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'qa/qa/page/component')
-rw-r--r-- | qa/qa/page/component/ci_badge_link.rb | 23 |
1 files changed, 16 insertions, 7 deletions
diff --git a/qa/qa/page/component/ci_badge_link.rb b/qa/qa/page/component/ci_badge_link.rb index d3e44fd867d..ef9bfa560ce 100644 --- a/qa/qa/page/component/ci_badge_link.rb +++ b/qa/qa/page/component/ci_badge_link.rb @@ -5,7 +5,22 @@ module QA module Component module CiBadgeLink COMPLETED_STATUSES = %w[passed failed canceled blocked skipped manual].freeze # excludes created, pending, running - PASSED_STATUS = 'passed'.freeze + INCOMPLETE_STATUSES = %w[pending created running].freeze + + # e.g. def passed?(timeout: nil); status_badge == 'passed'; end + COMPLETED_STATUSES.map do |status| + define_method "#{status}?" do |timeout: nil| + timeout ? completed?(timeout: timeout) : completed? + status_badge == status + end + end + + # e.g. def pending?; status_badge == 'pending'; end + INCOMPLETE_STATUSES.map do |status| + define_method "#{status}?" do + status_badge == status + end + end def self.included(base) base.view 'app/assets/javascripts/vue_shared/components/ci_badge_link.vue' do @@ -17,12 +32,6 @@ module QA find_element(:status_badge).text end - def successful?(timeout: 60) - raise "Timed out waiting for the status to be a valid completed state" unless completed?(timeout: timeout) - - status_badge == PASSED_STATUS - end - private def completed?(timeout: 60) |