[rspec-users] Selenium, Spec:Ui and ... forks?

Marcus Ahnve marcus at ahnve.com
Tue May 29 09:42:44 EDT 2007


I am using Spec:UI to run my Selenium tests, and I want to start
Selenium only once, for many descriptions.

I've come quite far solving it by declaring a main ui spec like the following:

require 'pathname'
require File.dirname(__FILE__) + '/selenium'

$base_url="http://localhost:3000"
$browser = Selenium::SeleniumDriver.new("localhost", 4444, "*firefox",
"http://localhost:3000", 10000)
$browser.start

Dir.glob(Pathname.new(__FILE__).parent.join("iteration*").join("*.rb")).each
do |file|
  require file
end

$browser.kill! rescue nil

The problem is that the browser is killed before the specs are run.
Anyone has an idea why this is happening?

On a related sidenote, a listener interface in RSpec would be quite
nice, could the Spec::Runnner::Reporter be used for that?

/Marcus

Cheers /Marcus
-- 
http://marcus.ahnve.net


More information about the rspec-users mailing list