summaryrefslogtreecommitdiff
path: root/spec/support/capybara.rb
diff options
context:
space:
mode:
authorRobert Speicher <rspeicher@gmail.com>2015-04-25 14:33:04 -0400
committerRobert Speicher <rspeicher@gmail.com>2015-04-25 21:33:16 -0400
commit86edfce4422038fae9c94b8ed39579079fb3adba (patch)
tree7850aeb566abc13d68f77bbbc93f7f33efdbaba6 /spec/support/capybara.rb
parent1e3fc84cd1d0aa004fb69d18ca392af8877cc07a (diff)
downloadgitlab-ce-86edfce4422038fae9c94b8ed39579079fb3adba.tar.gz
Move RSpec setup for Capybara to its own support file
Diffstat (limited to 'spec/support/capybara.rb')
-rw-r--r--spec/support/capybara.rb19
1 files changed, 19 insertions, 0 deletions
diff --git a/spec/support/capybara.rb b/spec/support/capybara.rb
new file mode 100644
index 00000000000..8a7b8f8b90a
--- /dev/null
+++ b/spec/support/capybara.rb
@@ -0,0 +1,19 @@
+require 'capybara/rails'
+require 'capybara/rspec'
+require 'capybara/poltergeist'
+
+# Give CI some extra time
+timeout = (ENV['CI'] || ENV['CI_SERVER']) ? 90 : 10
+
+Capybara.javascript_driver = :poltergeist
+Capybara.register_driver :poltergeist do |app|
+ Capybara::Poltergeist::Driver.new(app, js_errors: false, timeout: timeout)
+end
+
+Capybara.default_wait_time = timeout
+Capybara.ignore_hidden_elements = true
+
+require 'capybara-screenshot/rspec'
+
+# Keep only the screenshots generated from the last failing test suite
+Capybara::Screenshot.prune_strategy = :keep_last_run