DVG
DVG

Reputation: 17470

Cucumber/Capybara won't run in selenium mode on rails 2.3 app

Okay, I'm running into a strange error with a cucumber scenario on a Rails 2 app.

We're running our Cucumber suite under Capybara Webkit. This, for the most part is working fine, but I have a test that's failing during an ajax transaction because it can't see the element that should be appearing on the page.

I initially though this was a race condition and upped the max timeout, but no matter how long we wait around, the element is not found.

So I wanted to see it in action, so I tried to switch to Selenium so I could watch the whole test end-to-end.

However, whenever I try to run it through selenium, it fails right out of the gate during the first setup step with the error:

Given I am logged in # features/step_definitions/users/authentication_steps.rb:5
  HTTP request path is empty (ArgumentError)
  /home/dvg/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/net/http.rb:1860:in `initialize'
  /home/dvg/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/net/http.rb:2093:in `initialize'
  ./features/support/assumption.rb:48:in `login'
  ./features/step_definitions/users/authentication_steps.rb:7:in `/^I am logged in$/'
  features/requests/user_requests_a_thing.feature:4:in `Given I am logged in'

I have messed with every setting I can think of to try and get it working.

I have tried:

  1. Switching from Firefox to ChromeDriver
  2. Defining App Host
  3. Defining a NO_PROXY environment vriable in case the proxy server was getting in the way (which I think is something Selenium Webdriver looks at)
  4. Refactoring to use path_helpers instead of visit "/login" style steps
  5. Updating the bundle

Special Considerations:

  1. We are a rails 2.3 app that just converted from Ruby 1.8.7 to 1.9.3
  2. We are using the latest Cucumber/Capybara

Upvotes: 1

Views: 584

Answers (1)

DVG
DVG

Reputation: 17470

It was the no proxy variable, but it needed to be

ENV['no_proxy'] = "127.0.0.1"

Upvotes: 1

Related Questions