|
|
|
@ -1,4 +1,5 @@ |
|
|
|
|
require 'capybara/rspec' |
|
|
|
|
require 'capybara-screenshot' |
|
|
|
|
require 'capybara-screenshot/rspec' |
|
|
|
|
require 'rack_session_access/capybara' |
|
|
|
|
|
|
|
|
@ -7,6 +8,24 @@ RSpec.configure do |
|
|
|
|
Capybara.javascript_driver = :selenium |
|
|
|
|
end |
|
|
|
|
|
|
|
|
|
## |
|
|
|
|
# Configure capybara-screenshot |
|
|
|
|
|
|
|
|
|
# Remove old images automatically |
|
|
|
|
Capybara::Screenshot.prune_strategy = :keep_last_run |
|
|
|
|
|
|
|
|
|
# Set up S3 uploads if desired |
|
|
|
|
if ENV['OPENPROJECT_ENABLE_CAPYBARA_SCREENSHOT_S3_UPLOADS'] |
|
|
|
|
Capybara::Screenshot.s3_configuration = { |
|
|
|
|
s3_client_credentials: { |
|
|
|
|
access_key_id: ENV.fetch('AWS_ACCESS_KEY_ID'), |
|
|
|
|
secret_access_key: ENV.fetch('AWS_ACCESS_KEY_SECRET'), |
|
|
|
|
region: ENV.fetch('AWS_REGION', 'eu-west-1') |
|
|
|
|
}, |
|
|
|
|
bucket_name: ENV.fetch('S3_BUCKET_NAME', 'openproject-travis-logs') |
|
|
|
|
} |
|
|
|
|
end |
|
|
|
|
|
|
|
|
|
Rails.application.config do |
|
|
|
|
config.middleware.use RackSessionAccess::Middleware |
|
|
|
|
end |
|
|
|
@ -45,3 +64,4 @@ Capybara.register_driver :selenium do |app| |
|
|
|
|
desired_capabilities: capabilities |
|
|
|
|
) |
|
|
|
|
end |
|
|
|
|
|
|
|
|
|