I think an easier way would be to parallelize 'outside' the cucumber script
...
Here is what I have:
>
> So I have two feature files each with 2 scenarios
> I have 2 step_definition files and an env.rb
>
> My env.rb file looks something like this:
> $LOAD_PATH.unshift(File.dirname(__FILE__))
> $LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', '..', '..',
> '..', 'lib'))
> require 'watirgrid'
> require 'rspec/expectations';
>
> ENV["GRID"] = 'true'
> ENV["controller_uri"] = "druby://10.194.192.181:11235"
>
>
Start the controller manually outside the cucumber scenario, you could just
do this via a dos script e.g.
controller
> controller = Controller.new(
> :loglevel => Logger::ERROR)
> controller.start
>
so get rid of the above, no need to start a controller within the scenario
In this case just start 1 provider when the cucumber script runs
> provider = Provider.new(
> :loglevel => Logger::ERROR, :driver => 'webdriver')
> provider.start
>
> if ENV["GRID"] then
> params = {}
> params[:controller] = controller
> params[:browser_type] = 'firefox'
grid ||= Watir::Grid.new(params)
>
just take 1 provider, because at the time, there will only be 1 available on
the grid
> grid.start(:initiate => true, :quantity => *1*, :take_all => true)
else
> @browser ||= Watir::Browser.new :firefox
> end
>
> Before do |scenario|
> @grid = grid
> @browser = grid.providers.first
> end
>
> at_exit do
> grid.iterate do |browser|
> browser.close
> end
> grid.release_tuples
> end
>
So to run in 'parallel' in a hacky way (just to get things going)
in 3 dos shells run the following
controller
cucumber feature1.feature
cucumber feature2.feature
I'm having a holiday shortly and will think about better ways to parallelize
within cucumber...
--
Before posting, please read http://watir.com/support. In short: search before
you ask, be nice.
[email protected]
http://groups.google.com/group/watir-general
[email protected]