2009-11-16 16:02:16 -05:00
|
|
|
require 'nokogiri'
|
|
|
|
|
|
|
|
module Capybara
|
2009-11-30 15:38:09 -05:00
|
|
|
VERSION = '0.1.3'
|
2009-11-16 16:02:16 -05:00
|
|
|
|
|
|
|
class CapybaraError < StandardError; end
|
|
|
|
class DriverNotFoundError < CapybaraError; end
|
|
|
|
class ElementNotFound < CapybaraError; end
|
|
|
|
|
|
|
|
class << self
|
|
|
|
attr_accessor :debug, :asset_root
|
2009-12-03 12:50:03 -05:00
|
|
|
attr_writer :default_selector
|
|
|
|
|
|
|
|
def default_selector
|
|
|
|
@default_selector ||= :xpath
|
|
|
|
end
|
2009-11-16 16:02:16 -05:00
|
|
|
|
|
|
|
def log(message)
|
|
|
|
puts "[capybara] #{message}" if debug
|
|
|
|
true
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
autoload :Server, 'capybara/server'
|
|
|
|
autoload :Session, 'capybara/session'
|
2009-11-17 17:52:22 -05:00
|
|
|
autoload :Node, 'capybara/node'
|
2009-11-16 16:02:16 -05:00
|
|
|
|
|
|
|
module Driver
|
|
|
|
autoload :RackTest, 'capybara/driver/rack_test_driver'
|
|
|
|
autoload :Culerity, 'capybara/driver/culerity_driver'
|
|
|
|
autoload :SafariWatir, 'capybara/driver/safariwatir_driver'
|
|
|
|
autoload :FireWatir, 'capybara/driver/firewatir_driver'
|
|
|
|
autoload :Selenium, 'capybara/driver/selenium_driver'
|
|
|
|
end
|
|
|
|
end
|