Skip to content
This repository has been archived by the owner on Nov 27, 2020. It is now read-only.

Poltergeist doesn't load on feature spec, unless using js: true? #334

Closed
oliverbarnes opened this issue May 16, 2013 · 1 comment
Closed

Comments

@oliverbarnes
Copy link

I've been discussing this on another issue, but it looks like it's a separate problem (perhaps something I'm doing wrong, too - but can't figure out what)

Using poltergeist from master, I'm only able to access its methods when passing js: true to feature specs:

scenario "Worst case", js: true do
...
end

Though I now know scenario() is supposed to not need the js flag.

Also, without it all requests are sent asking for HTML, not JS. But with it, I get strange behavior - steps to login using devise don't work, user factories are seen as invalid...

My config:

require 'capybara/poltergeist'

Capybara.javascript_driver = :poltergeist

Also tried registering the driver:

require 'capybara/poltergeist'

Capybara.register_driver :poltergeist do |app|
  Capybara::Poltergeist::Driver.new(app, { debug: true, js_errors: true })
end

Capybara.javascript_driver = :poltergeist

Does this make sense? Is this a bug, or am I missing something basic here?

@jonleighton
Copy link
Contributor

You should use Capybara.default_driver = :poltergeist if you want all capybara specs to use Poltergeist. See the Capybara docs.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants