Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKamil Trzcinski <ayufan@ayufan.eu>2016-03-09 16:12:08 +0300
committerKamil Trzcinski <ayufan@ayufan.eu>2016-03-09 16:22:32 +0300
commitaf43401602d637c5b91def323ba3a0bac824b785 (patch)
tree88061d7009e36bbc93e3db84a526e3191260bbc0 /features/support
parent640bf8ab7212988fda0189e1534d46dcbf0c126f (diff)
Retry spinach tests
Diffstat (limited to 'features/support')
-rw-r--r--features/support/env.rb1
-rw-r--r--features/support/rerun.rb14
2 files changed, 15 insertions, 0 deletions
diff --git a/features/support/env.rb b/features/support/env.rb
index 62c80b9c948..357d164d87f 100644
--- a/features/support/env.rb
+++ b/features/support/env.rb
@@ -14,6 +14,7 @@ require 'sidekiq/testing/inline'
require_relative 'capybara'
require_relative 'db_cleaner'
+require_relative 'rerun'
%w(select2_helper test_env repo_helpers).each do |f|
require Rails.root.join('spec', 'support', f)
diff --git a/features/support/rerun.rb b/features/support/rerun.rb
new file mode 100644
index 00000000000..8b176c5be89
--- /dev/null
+++ b/features/support/rerun.rb
@@ -0,0 +1,14 @@
+# The spinach-rerun-reporter doesn't define the on_undefined_step
+# See it here: https://github.com/javierav/spinach-rerun-reporter/blob/master/lib/spinach/reporter/rerun.rb
+module Spinach
+ class Reporter
+ class Rerun
+ def on_undefined_step(step_data, failure, step_definitions = nil)
+ super step_data, failure, step_definitions
+
+ # save feature file and scenario line
+ @rerun << "#{current_feature.filename}:#{current_scenario.line}"
+ end
+ end
+ end
+end