lib/sauce/cucumber.rb in sauce-cucumber-3.4.0 vs lib/sauce/cucumber.rb in sauce-cucumber-3.5.0

- old
+ new

@@ -1,15 +1,18 @@ require 'capybara' require 'cucumber' require 'sauce/job' require 'sauce/capybara' require 'sauce/utilities' +require 'sauce/test_base' require 'sauce_whisk' module Sauce module Capybara module Cucumber + extend Sauce::TestBase + def use_sauce_driver ::Capybara.current_driver = :sauce end module_function :use_sauce_driver @@ -86,15 +89,13 @@ c[:name] = Sauce::Capybara::Cucumber.name_from_scenario(scenario) end fn = file_name_from_scenario(scenario) config = Sauce::Config.new + platforms = config.caps_for_location("./#{fn[:file]}", fn[:line]) - config.browsers_for_location("./#{fn[:file]}", fn[:line]).each do |os, browser, version| - @selenium = Sauce::Selenium2.new({:os => os, - :browser => browser, - :browser_version => version, - :job_name => job_name}) + test_each platforms, job_name do |selenium, caps| + @selenium = selenium Sauce.driver_pool[Thread.current.object_id] = @selenium driver = ::Capybara.current_session.driver # This session_id is the job ID used by Sauce Labs, we're pulling it