JG
3 years ago
3 changed files with 36 additions and 8 deletions
@ -1,21 +1,31 @@ |
|||||||
# IMPORTANT: This file is generated by cucumber-rails - edit at your own peril. |
|
||||||
# It is recommended to regenerate this file in the future when you upgrade to a |
|
||||||
# newer version of cucumber-rails. Consider adding your own code to a new file |
|
||||||
# instead of editing this one. Cucumber will automatically load all features/**/*.rb |
|
||||||
# files. |
|
||||||
|
|
||||||
require 'cucumber/rails' |
require 'cucumber/rails' |
||||||
|
require "capybara-screenshot/cucumber" |
||||||
|
require "capybara/cuprite" |
||||||
|
|
||||||
ActionController::Base.allow_rescue = false |
ActionController::Base.allow_rescue = false |
||||||
|
|
||||||
# Remove/comment out the lines below if your app doesn't have a database. |
|
||||||
# For some databases (like MongoDB and CouchDB) you may need to use :truncation instead. |
|
||||||
begin |
begin |
||||||
DatabaseCleaner.strategy = :transaction |
DatabaseCleaner.strategy = :transaction |
||||||
rescue NameError |
rescue NameError |
||||||
raise "You need to add database_cleaner to your Gemfile (in the :test group) if you wish to use it." |
raise "You need to add database_cleaner to your Gemfile (in the :test group) if you wish to use it." |
||||||
end |
end |
||||||
|
|
||||||
|
|
||||||
|
Cucumber::Rails::Database.javascript_strategy = :truncation |
||||||
|
|
||||||
|
Capybara.register_driver :cuprite do |app| |
||||||
|
Capybara::Cuprite::Driver.new(app, headless: true, |
||||||
|
js_errors: true, |
||||||
|
window_size: [1600, 1200], |
||||||
|
timeout: 30, |
||||||
|
process_timeout: 60) |
||||||
|
end |
||||||
|
Capybara.javascript_driver = :cuprite |
||||||
|
|
||||||
|
Capybara::Screenshot.register_driver(:cuprite) do |driver, path| |
||||||
|
driver.render(path, full: true) |
||||||
|
end |
||||||
|
|
||||||
Cucumber::Rails::Database.javascript_strategy = :truncation |
Cucumber::Rails::Database.javascript_strategy = :truncation |
||||||
|
|
||||||
World(FactoryBot::Syntax::Methods) |
World(FactoryBot::Syntax::Methods) |
||||||
|
Loading…
Reference in new issue