summaryrefslogtreecommitdiff
path: root/qa/qa/resource/events/project.rb
diff options
context:
space:
mode:
Diffstat (limited to 'qa/qa/resource/events/project.rb')
-rw-r--r--qa/qa/resource/events/project.rb25
1 files changed, 25 insertions, 0 deletions
diff --git a/qa/qa/resource/events/project.rb b/qa/qa/resource/events/project.rb
new file mode 100644
index 00000000000..99c78254f42
--- /dev/null
+++ b/qa/qa/resource/events/project.rb
@@ -0,0 +1,25 @@
+# frozen_string_literal: true
+
+module QA
+ module Resource
+ module Events
+ module Project
+ include Events::Base
+
+ def wait_for_push(commit_message)
+ QA::Runtime::Logger.debug(%Q[#{self.class.name} - wait_for_push with commit message "#{commit_message}"])
+ wait_for_event do
+ events(action: 'pushed').any? { |event| event.dig(:push_data, :commit_title) == commit_message }
+ end
+ end
+
+ def wait_for_push_new_branch(branch_name = "master")
+ QA::Runtime::Logger.debug(%Q[#{self.class.name} - wait_for_push_new_branch with branch_name "#{branch_name}"])
+ wait_for_event do
+ events(action: 'pushed').any? { |event| event.dig(:push_data, :ref) == branch_name }
+ end
+ end
+ end
+ end
+ end
+end