mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-02-27 01:43:22 +00:00
Merge pull request #9545 from Philwi/control-capybara-headless-mode-via-environment-variable
Control capybara headless mode for testing via environment variable
This commit is contained in:
@@ -2,6 +2,8 @@
|
||||
|
||||
require "capybara/cuprite"
|
||||
|
||||
headless = ActiveModel::Type::Boolean.new.cast(ENV.fetch("HEADLESS", true))
|
||||
|
||||
Capybara.register_driver(:cuprite) do |app|
|
||||
Capybara::Cuprite::Driver.new(
|
||||
app,
|
||||
@@ -13,7 +15,7 @@ Capybara.register_driver(:cuprite) do |app|
|
||||
# Don't load scripts from external sources, like google maps or stripe
|
||||
url_whitelist: ["http://localhost", "http://0.0.0.0", "http://127.0.0.1"],
|
||||
inspector: true,
|
||||
headless: true,
|
||||
headless: headless,
|
||||
js_errors: true,
|
||||
}
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user