Sha256: a36dce5caba93e8ae29eb76d285e136762d3372c5fc8bf56eb834109bec51884

Contents?: true

Size: 803 Bytes

Versions: 7

Compression:

Stored size: 803 Bytes

Contents

require 'capybara'

module Sauce
  module Capybara
    class Driver < ::Capybara::Driver::Selenium
      def browser
        unless @browser
          config = Sauce::Config.new
          @sauce_tunnel = Sauce::Connect.new(:host => "127.0.0.1", :port => rack_server.port)
          @sauce_tunnel.wait_until_ready
          @browser = Sauce::Selenium2.new(:name => "Capybara")
          at_exit do
            @browser.quit
            @sauce_tunnel.disconnect
          end
        end
        @browser
      end

      private

      def url(path)
        if path =~ /^http/
          path
        else
          config = Sauce::Config.new
          config.browser_url + path.to_s
        end
      end
    end
  end
end

Capybara.register_driver :sauce do |app|
  Sauce::Capybara::Driver.new(app)
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
sauce-0.17.3 lib/sauce/capybara.rb
sauce-0.17.3.alpha2 lib/sauce/capybara.rb
sauce-0.17.3.alpha1 lib/sauce/capybara.rb
sauce-0.17.2 lib/sauce/capybara.rb
sauce-0.17.1 lib/sauce/capybara.rb
sauce-0.17.0 lib/sauce/capybara.rb
sauce-0.16.2 lib/sauce/capybara.rb