mirror of
https://github.com/Growstuff/growstuff.git
synced 2026-03-25 10:11:48 -04:00
Merge pull request #924 from maco/capybara-tools
Add capybara-screenshot to assist with feature testing
This commit is contained in:
1
Gemfile
1
Gemfile
@@ -112,6 +112,7 @@ group :development, :test do
|
||||
gem 'coveralls', require: false # coverage analysis
|
||||
gem 'capybara' # integration tests
|
||||
gem 'capybara-email' # integration tests for email
|
||||
gem 'capybara-screenshot' # for test debugging
|
||||
gem 'poltergeist', '~> 1.6' # for headless JS testing
|
||||
gem 'i18n-tasks' # adds tests for finding missing and unused translations
|
||||
gem 'selenium-webdriver'
|
||||
|
||||
@@ -84,6 +84,9 @@ GEM
|
||||
capybara-email (2.5.0)
|
||||
capybara (~> 2.4)
|
||||
mail
|
||||
capybara-screenshot (1.0.13)
|
||||
capybara (>= 1.0, < 3)
|
||||
launchy
|
||||
childprocess (0.5.9)
|
||||
ffi (~> 1.0, >= 1.0.11)
|
||||
climate_control (0.0.3)
|
||||
@@ -446,6 +449,7 @@ DEPENDENCIES
|
||||
cancancan (~> 1.9)
|
||||
capybara
|
||||
capybara-email
|
||||
capybara-screenshot
|
||||
codeclimate-test-reporter
|
||||
coffee-rails (~> 4.1.0)
|
||||
comfortable_mexican_sofa (~> 1.12.0)
|
||||
|
||||
@@ -23,6 +23,8 @@ end
|
||||
|
||||
require 'capybara'
|
||||
require 'capybara/poltergeist'
|
||||
require 'capybara/rspec'
|
||||
require 'capybara-screenshot/rspec'
|
||||
|
||||
Capybara.javascript_driver = :poltergeist
|
||||
if ENV['GROWSTUFF_CAPYBARA_DRIVER'].present?
|
||||
@@ -32,6 +34,11 @@ if ENV['GROWSTUFF_CAPYBARA_DRIVER'].present?
|
||||
end
|
||||
Capybara.javascript_driver = ENV['GROWSTUFF_CAPYBARA_DRIVER'].to_sym
|
||||
end
|
||||
|
||||
Capybara::Screenshot.register_filename_prefix_formatter(:rspec) do |example|
|
||||
"screenshot_#{example.description.gsub(' ', '-').gsub(/^.*\/spec\//,'')}"
|
||||
end
|
||||
|
||||
Capybara.app_host = 'http://localhost'
|
||||
Capybara.server_port = 8081
|
||||
|
||||
|
||||
Reference in New Issue
Block a user