I know that this is not specifically an RSpec issue, but the Capybara user 
forum is unresponsive and appears relatively inactive, and the RSpec group has 
been very responsive and informative on topics beyond the strict scope of 
RSpec. I’m trying to implement headless Chrome with Capybara and Selenium for 
RSpec feature tests, and I followed the instructions in the following article: 
https://www.imaginarycloud.com/blog/from-capybara-webkit-to-headless-chrome-and-chromedriver/
 
<https://www.imaginarycloud.com/blog/from-capybara-webkit-to-headless-chrome-and-chromedriver/>

I’ve added the following gems: webdrivers (v 3.9.4), capybara-selenium (v 
0.0.6), and capybara (v 3.15.1). In my spec_helper.rb file, I’ve added the 
following code:

Capybara.register_driver :chrome do |app|
  Capybara::Selenium::Driver.new(app, browser: :chrome)
end

Capybara.register_driver :headless_chrome do |app|
  capabilities = Selenium::WebDriver::Remote::Capabilities.chrome(
    chromeOptions: {
      args: %w[headless enable-features=NetworkService,NetworkServiceInProcess]
    }
  )

  Capybara::Selenium::Driver.new app,
    browser: :chrome,
    desired_capabilities: capabilities
end

Capybara.default_driver = :headless_chrome
Capybara.javascript_driver = :headless_chrome

What I’m getting, when I run a feature spec with js:true is a full browser, 
which is obviously not what I’m expecting. Is there anything obvious that I’m 
doing wrong here?

-- 
You received this message because you are subscribed to the Google Groups 
"rspec" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/rspec/828B0D8D-B280-4A3E-B416-F78658A5A754%40pobox.com.

Reply via email to