Jack,

Do you mean that it opens the Chrome application window?
I recall we were making some changes to prevent Rails from overriding the
default drivers.

Off the top of my head you can try setting the driver in a `before` hook
https://relishapp.com/rspec/rspec-rails/v/4-0/docs/system-specs/system-spec#system-specs-driven-by-selenium-chrome-headless


On Tue, Dec 1, 2020 at 3:25 AM Jack Royal-Gordon <[email protected]> wrote:

> 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/
>
> 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
> <https://groups.google.com/d/msgid/rspec/828B0D8D-B280-4A3E-B416-F78658A5A754%40pobox.com?utm_medium=email&utm_source=footer>
> .
>

-- 
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/CAAk5Ok-QqqdVrQmxSL7waPs1RFtvA-BfyseGT4kQTDAtkBZLoQ%40mail.gmail.com.

Reply via email to