Jason, can you post the actual scenario you're testing with? And your env.rb 
too? 

In my experience, Firefox will only start when you hit a step that uses 
Capybara/Selenium, so if your scenario fails on a Given step which doesn't 
require the browser, then it would exhibit the same behaviour you described at 
the beginning. Can you get a simple navigation scenario to pass without 
selenium, then see what happens when you apply the @javascript tag?

Also, changing the default driver AND using a @javascript tag are redundant. I 
would leave the driver as is in env.rb, and just use the tag to mark 
JS-dependent tests until you confirm it's working. AFAIK, you can use tags on a 
per-feature basis if you require all the scenarios in a feature to be run with 
selenium.

HTH,

Warren

On 15/02/2011, at 9:01 PM, Jason Nah wrote:

> Howdy Guys,
> 
> I'm in the midst of trying to find out why the selenium driver doesn't seem 
> to work with my setup. That being:
> Rails3
> Cucumber 0.10.0
> Capybara 0.4.1.2
> Selenium WebDriver 0.1.2
> Launchy 0.3.7
> And I have libffi installed
> MacOSX 10.6.6
> Ruby 1.8.7 p302 (using rvm)
> Spork 0.8.4
> Guard 0.2.2
> My feature contains the following:
> 
> Feature: My feature
> 
>   @javascript
>   Scenario: User does x
>     Given ...
>     When ...
>     Then ...
> 
> 
> Right now, when I run the feature using
> 
> bundle exec cucumber feature/myfeature.feature
> 
> I get the following:
> 
> F-----------------F
> 
> Failing Scenarios:
> cucumber features/myfeature.feature:7 # Scenario: User does x
> 
> 1 scenario (1 failed)
> 17 steps (17 skipped)
> 
> My env.rb file contains the following:
> 
>   Capybara.default_driver = :selenium
> 
> 
> I've tried the following:
> 
> 1. Created a separate test.rb file to load capybara separately. 
> 
> It contained the following:
> 
> require 'capybara'
> require 'capybara/dsl'
> 
> Capybara.default_driver = :selenium
> 
> class Test
>   include Capybara
>   def dotest
>     visit('http://www.stackoverflow.com')
>   end
> end
> 
> Test.new.dotest
> 
> Ran it with
> 
> bundle exec ruby tmp/test.rb
> 
> Firefox opened, navigated and worked. This shows that capybara, and the 
> selenium webdriver works as per the Gemfile (ie versions are compatible)
> 
> 
> 2. Injected the following code in env.rb
> 
> driver = Capybara.drivers[:selenium].call
> driver.browser
> 
> Again, firefox opened and closed after running
> 
> bundle exec cucumber feature/myfeature.feature
> 
> But again, nothing in the feature is actually executed. Same result 
> (F-----------------F).... making me think there's something funny going on 
> between cucumber and capybara.
> 
> So... my questions are:
> Is there a way to get cucumber to log more information out?
> Is there a way to get capybara to log more information out?
> What would be the best approach to figure out what the issue is...
> 
> Cheers,
> Jason
> 
> -- 
> You received this message because you are subscribed to the Google Groups 
> "Ruby or Rails Oceania" group.
> To post to this group, send email to rails-oceania@googlegroups.com.
> To unsubscribe from this group, send email to 
> rails-oceania+unsubscr...@googlegroups.com.
> For more options, visit this group at 
> http://groups.google.com/group/rails-oceania?hl=en.

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
or Rails Oceania" group.
To post to this group, send email to rails-oceania@googlegroups.com.
To unsubscribe from this group, send email to 
rails-oceania+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rails-oceania?hl=en.

Reply via email to