0

I am running Capybara 1.1.2 with Poltergeist 1.0.1 for headless testing. The test runs fine with selenium driver. However with poltergeist, the site snapshot states that cookies are disabled. Am I missing any config. Shouldn't cookies be enabled by default?

3coins
  • 1,322
  • 3
  • 11
  • 30

1 Answers1

1

You can make sure that the cookies are enabled in Capybara before setting the session.

    Capybara.register_driver :my_firefox_driver do |app|
      Capybara::Poltergeist::Driver.new(app, {:js_errors => false, 
                             :cookies => true, :window_size => [1280, 1024]})
    end
    self.session = Capybara::Session.new(:my_firefox_driver)
dove
  • 20,469
  • 14
  • 82
  • 108
Quentin
  • 900
  • 8
  • 13