Skip to content

Commit

Permalink
Attempt to fix Ferrum timeout errors
Browse files Browse the repository at this point in the history
  • Loading branch information
camertron committed Oct 19, 2023
1 parent d10f9ae commit add7a23
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
2 changes: 1 addition & 1 deletion test/sandbox/test/view_component_system_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
require "test_helper"

class ViewComponentSystemTest < ViewComponent::SystemTestCase
driven_by :cuprite
driven_by :vc_cuprite

def test_simple_js_interaction_in_browser_without_layout
with_rendered_component_path(render_inline(SimpleJavascriptInteractionWithJsIncludedComponent.new)) do |path|
Expand Down
8 changes: 5 additions & 3 deletions test/test_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -40,14 +40,16 @@ def self.warn(message)

require "capybara/cuprite"

Capybara.register_driver(:cuprite) do |app|
# Rails registers its own driver named "cuprite" which will overwrite the one we
# register here. Avoid the problem by registering the driver with a distinct name.
Capybara.register_driver(:vc_cuprite) do |app|
# Add the process_timeout option to prevent failures due to the browser
# taking too long to start up.
Capybara::Cuprite::Driver.new(app, {process_timeout: 60, timeout: 30})
Capybara::Cuprite::Driver.new(app, { process_timeout: 60, timeout: 30 })
end

# Reduce extra logs produced by puma booting up
Capybara.server = :puma, {Silent: true}
Capybara.server = :puma, { Silent: true }
# Increase the max wait time to appease test failures due to timeouts.
Capybara.default_max_wait_time = 30

Expand Down

0 comments on commit add7a23

Please sign in to comment.