Rspec Capybara Broken Pipe

143 Views Asked by At

i have a Errno::EPIPE:Broken Pipe error on capybara/poltergeist/web_socket_server.rb running Rspec with poltergeist

this is my configuration :

Capybara.javascript_driver   = :poltergeist
Capybara.raise_server_errors = false
Capybara.register_driver :poltergeist do |app|
  options = {
    # debug: true,
    js_errors: false,
    timeout:   10,
    # port: 44678+ENV['TEST_ENV_NUMBER'].to_i,
    # domain: 'localhost',
    phantomjs_options: [
                         #   '--proxy-type=none',
                         "--load-images=no",
                         "--ignore-ssl-errors=yes",
                         #   '--ssl-protocol=any',
                         #   '--debug=true',
                         #   '--web-security=false'
                       ],
    port:              9887
  }
  Capybara::Poltergeist::Driver.new(app, options)
end

Someone can help me?

1

There are 1 best solutions below

0
Thomas Walpole On

If it occurs before any tests run it generally means you don't have a compatible version of phantomjs installed. That being said, Poltergeist is obsolete nowadays. Phantomjs (which Poltergeist uses as its browser) is basically equivalent to an 8 yeah old browser at this point in time, and therefore doesn't support a lot of JS and CSS used in modern apps/sites. You're going to have a much better time if you switch to using the selenium driver with headless chrome or firefox, or one of the direct to Chrome (via CDP) drivers like Apparition.