My application_system_test_case.rb looks like this:
application_system_test_case.rb
require "test_helper" require "socket" def prepare_options driver_options = { desired_capabilities: { chromeOptions: { args: %w[headless disable-gpu disable-dev-shm-usage] # preserve memory & cpu consumption } } } driver_options[:url] = ENV["selenium_remote_url"] if ENV["selenium_remote_url"] driver_options end class ApplicationSystemTestCase < ActionDispatch::SystemTestCase driven_by :selenium, using: :chrome, screen_size: [1400, 1400], options: prepare_options end
And within the configure block ofconfig/environments/test.rb I have:
config/environments/test.rb
net = Socket.ip_address_list.detect{|addr| addr.ipv4_private? } ip = net.nil? ? 'localhost' : net.ip_address config.domain = ip config.action_mailer.default_url_options = { :host => config.domain } Capybara.server_port = 8200 Capybara.server_host = ip
Are you sure you want to hide this comment? It will become hidden in your post, but will still be visible via the comment's permalink.
Hide child comments as well
Confirm
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
My
application_system_test_case.rb
looks like this:And within the configure block of
config/environments/test.rb
I have: