conf(capybara): make JS_LOG work for head and headless
This commit is contained in:
parent
091a522cbf
commit
db0fcec019
1 changed files with 6 additions and 6 deletions
|
@ -16,6 +16,12 @@ def setup_driver(app, download_path, options)
|
|||
upload_throughput: 1024000
|
||||
}
|
||||
end
|
||||
|
||||
if ENV['JS_LOG'].present?
|
||||
driver.browser.on_log_event(:console) do |event|
|
||||
puts event.args if event.type == ENV['JS_LOG'].downcase.to_sym
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
|
@ -76,12 +82,6 @@ RSpec.configure do |config|
|
|||
|
||||
config.before(:each, type: :system, js: true) do
|
||||
driven_by ENV['NO_HEADLESS'] ? :chrome : :headless_chrome
|
||||
|
||||
if ENV['JS_LOG'].present?
|
||||
page.driver.browser.on_log_event(:console) do |event|
|
||||
puts event.args if event.type == ENV['JS_LOG'].downcase.to_sym
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
# Set the user preferred language before Javascript system specs.
|
||||
|
|
Loading…
Reference in a new issue