I normally use Selenium with Firefox when manually running my Cucumber tests. But when I have Autotest run, I'd like them to be run using Capybara-webkit because otherwise Firefox always jumps to the foreground, and this is very annoying.
So how could this be achieved? I guess I have to set
Capybara.javascript_driver = :webkit
in the env.rb file depending on whether the test is run by Autotest or not, but how to distinguish?
Another option would be to tell Firefox to start in the background, but how can this be achieved?
Here's some possible workaround: use chrome! This one seems to start in the background, so it won't interrupt your workflow. See http://collectiveidea.com/blog/archives/2011/09/27/use-chrome-with-cucumber-capybara/.
Thanks a lot! Josh