๐ Parent Note
๐ค Situation
When you want to debug with real display.
The setting is like this.
#spec/rails_helper.rb
Capybara.register_driver :headless_chrome do |app|
Capybara::Selenium::Driver.new(
app,
browser: :chrome,
options: browser_options,
http_client: Selenium::WebDriver::Remote::Http::Default.new
)
end
browser_options = ::Selenium::WebDriver::Chrome::Options.new.tap do |opts|
opts.args << '--headless'
end
๐ Solution
Comment out opts.args << '--headless'
line.
#spec/rails_helper.rb
Capybara.register_driver :headless_chrome do |app|
Capybara::Selenium::Driver.new(
app,
browser: :chrome,
options: browser_options,
http_client: Selenium::WebDriver::Remote::Http::Default.new
)
end
browser_options = ::Selenium::WebDriver::Chrome::Options.new.tap do |opts|
# opts.args << '--headless'
end
Top comments (1)
I think a better solution would be adding configuration to specify js_driver in rails_helper
then you just specify env to display chrome browser in the terminal