flazz-webrat 0.3.2.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (65) hide show
  1. data/History.txt +193 -0
  2. data/MIT-LICENSE.txt +19 -0
  3. data/README.rdoc +81 -0
  4. data/Rakefile +104 -0
  5. data/install.rb +1 -0
  6. data/lib/webrat.rb +34 -0
  7. data/lib/webrat/core.rb +13 -0
  8. data/lib/webrat/core/configuration.rb +44 -0
  9. data/lib/webrat/core/elements/area.rb +31 -0
  10. data/lib/webrat/core/elements/element.rb +33 -0
  11. data/lib/webrat/core/elements/field.rb +386 -0
  12. data/lib/webrat/core/elements/form.rb +103 -0
  13. data/lib/webrat/core/elements/label.rb +31 -0
  14. data/lib/webrat/core/elements/link.rb +90 -0
  15. data/lib/webrat/core/elements/select_option.rb +35 -0
  16. data/lib/webrat/core/locators.rb +20 -0
  17. data/lib/webrat/core/locators/area_locator.rb +38 -0
  18. data/lib/webrat/core/locators/button_locator.rb +54 -0
  19. data/lib/webrat/core/locators/field_by_id_locator.rb +37 -0
  20. data/lib/webrat/core/locators/field_labeled_locator.rb +50 -0
  21. data/lib/webrat/core/locators/field_locator.rb +25 -0
  22. data/lib/webrat/core/locators/field_named_locator.rb +41 -0
  23. data/lib/webrat/core/locators/form_locator.rb +19 -0
  24. data/lib/webrat/core/locators/label_locator.rb +34 -0
  25. data/lib/webrat/core/locators/link_locator.rb +66 -0
  26. data/lib/webrat/core/locators/locator.rb +20 -0
  27. data/lib/webrat/core/locators/select_option_locator.rb +59 -0
  28. data/lib/webrat/core/logging.rb +21 -0
  29. data/lib/webrat/core/matchers.rb +4 -0
  30. data/lib/webrat/core/matchers/have_content.rb +55 -0
  31. data/lib/webrat/core/matchers/have_selector.rb +37 -0
  32. data/lib/webrat/core/matchers/have_tag.rb +57 -0
  33. data/lib/webrat/core/matchers/have_xpath.rb +86 -0
  34. data/lib/webrat/core/methods.rb +60 -0
  35. data/lib/webrat/core/mime.rb +29 -0
  36. data/lib/webrat/core/scope.rb +330 -0
  37. data/lib/webrat/core/session.rb +255 -0
  38. data/lib/webrat/core/xml.rb +115 -0
  39. data/lib/webrat/core/xml/hpricot.rb +19 -0
  40. data/lib/webrat/core/xml/nokogiri.rb +76 -0
  41. data/lib/webrat/core/xml/rexml.rb +24 -0
  42. data/lib/webrat/core_extensions/blank.rb +58 -0
  43. data/lib/webrat/core_extensions/deprecate.rb +8 -0
  44. data/lib/webrat/core_extensions/detect_mapped.rb +12 -0
  45. data/lib/webrat/core_extensions/hash_with_indifferent_access.rb +131 -0
  46. data/lib/webrat/core_extensions/meta_class.rb +6 -0
  47. data/lib/webrat/core_extensions/nil_to_param.rb +5 -0
  48. data/lib/webrat/mechanize.rb +43 -0
  49. data/lib/webrat/merb.rb +77 -0
  50. data/lib/webrat/rack.rb +26 -0
  51. data/lib/webrat/rails.rb +93 -0
  52. data/lib/webrat/rails/redirect_actions.rb +18 -0
  53. data/lib/webrat/rspec-rails.rb +13 -0
  54. data/lib/webrat/selenium.rb +104 -0
  55. data/lib/webrat/selenium/location_strategy_javascript/button.js +12 -0
  56. data/lib/webrat/selenium/location_strategy_javascript/label.js +16 -0
  57. data/lib/webrat/selenium/location_strategy_javascript/webrat.js +5 -0
  58. data/lib/webrat/selenium/location_strategy_javascript/webratlink.js +9 -0
  59. data/lib/webrat/selenium/location_strategy_javascript/webratlinkwithin.js +15 -0
  60. data/lib/webrat/selenium/location_strategy_javascript/webratselectwithoption.js +5 -0
  61. data/lib/webrat/selenium/selenium_extensions.js +6 -0
  62. data/lib/webrat/selenium/selenium_session.rb +212 -0
  63. data/lib/webrat/sinatra.rb +21 -0
  64. data/vendor/selenium-server.jar +0 -0
  65. metadata +135 -0
data/History.txt ADDED
@@ -0,0 +1,193 @@
1
+ == Trunk (Git)
2
+
3
+ * _IMPORTANT_ Breaking change:
4
+
5
+ * Removed init.rb auto-require of webrat/rails
6
+ * Removed auto-require of webrat/rails when requiring webrat when RAILS_ENV is
7
+ defined
8
+
9
+ In your env.rb file, ensure you have:
10
+
11
+ require "webrat/rails"
12
+
13
+ * Major enhancements
14
+
15
+ * Added select_time, select_date, and select_datetime to API. [#36] (Ben Mabey)
16
+ * Use Hpricot and REXML when not parsing with Nokogiri (on JRuby, for example)
17
+
18
+ * Minor enhancements
19
+
20
+ * Better inspect output for Webrat elements
21
+ * Detect if the document is XML or HTML using the Content-Type when in Rails mode
22
+ * Expose #selenium method for direct access to Selenium client
23
+ * Check nokogiri gem version before requiring nokogiri
24
+ * Include the Selenium server jar file in the gem (Bryan Helmkamp, Ben Schwarz)
25
+ * Added key_down, key_up and fire_event to Selenium session (Fernando Garcia)
26
+ * Fix outputing README during Rails plugin install (Fernando Garcia)
27
+ * Strip newlines when matching label text (Miha Filej)
28
+ * Add simple support for accessing Webrat's matchers from RSpec by requiring
29
+ "webrat/rspec-rails" (David Chelimsky)
30
+ * Support save_and_open_page in Windows and Cygwin (Mike Gaffney)
31
+ * Added RadioField#checked? to indicated whether or not a radio button is checked
32
+ (Luke Melia)
33
+ * Add spec:jruby rake task for running Webrat's spec suite with JRuby
34
+ * Added field_by_xpath to locate a Webrat::Field using arbitrary XPath expressions
35
+ * Helpful error message for missing option values [#40] (Ben Mabey)
36
+ * Add set_hidden_field method (Noah Davis, Bryan Helmkamp)
37
+ * Add submit_form method for submitting a form by ID (Noah Davis, Bryan Helmkamp)
38
+ * Switch to using Nokogiri.parse for simple XML/XHTML autodetection [#66]
39
+ * Removed Webrat.root method, which seemed to be unused
40
+ * Added Webrat.configure method for global Webrat configuration [#33]
41
+ (Mike Gaffney)
42
+ * Added automatic starting and stopping of the Selenium server and a Mongrel Rails
43
+ app server when using webrat/selenium
44
+ * Switch to using selenium-client gem and vendor selenium-server.jar (Luke Melia)
45
+ * Added gemspec so the gem builds on GitHub now
46
+ * Deprecate old style methods (fills_in is deprecated in favor of fill_in, etc.)
47
+ * Improcements to the README and RDoc (Bryan Helmkamp, Mike Gaffney)
48
+ * Allow clicking links by id and id regexp (Mike Gaffney)
49
+ * Raise Webrat::DisabledFieldError when attempting to manipulate a disabled field
50
+ * Raise Webrat::NotFoundErrors when an element is not found
51
+ * Raise Webrat::PageLoadError when a failure occurs so that application exceptions
52
+ can be more accurately tested (Ryan Briones)
53
+ * Helpful error message for missing option in select box. [#40] (Ben Mabey)
54
+
55
+ * Bug fixes
56
+
57
+ * Match against link _text_ which decodes character references.
58
+ Useful for multibyte languages like Japanese (moronatural@gmail.com)
59
+ * Fix params hash generation for Mechanize when Merb is not defined [#62]
60
+ * Expose some Webrat methods that were missing from the Webrat::Methods module
61
+ (Low Chin Chau)
62
+ * Allow mechanize session to pass through basic auth (Ryan Briones)
63
+ * Improvements to the Mechanize support (Jeremy Burks)
64
+ * Fix following fully qualified local links (Lawrence Pit)
65
+ * Fixed bug where Webrat would lose complex parameters (like foo[bar[baz]][])
66
+ in Merb due to not correctly merging Mashes. (Drew Colthorp)
67
+ * Extend Rails' ActionController::IntegrationTest instead of
68
+ ActionController::Integration::Session (Fixes using Webrat's #select method and
69
+ avoids usage of method_missing)
70
+
71
+ == 0.3.2 / 2008-11-08
72
+
73
+ * 1 Minor enhancement
74
+
75
+ * Fixes behavior or have_tag when a block is passed. It passes the matched node(s)
76
+ to the block for further specs again. (Carl Lerche)
77
+
78
+ == 0.3.1 / 2008-11-07
79
+
80
+ * 1 Minor enhancement
81
+
82
+ * Use @_webrat_session instance variable instead of @session for Merb integration
83
+ to avoid collisions
84
+
85
+ == 0.3.0 / 2008-11-07
86
+
87
+ * 4 Major enhancements
88
+
89
+ * Added Merb support (Gwyn Morfey, Jeremy Burks, Rob Kaufman, Yehuda Katz)
90
+ * Added experimental Selenium support (Luke Melia)
91
+ * Add have_selector, have_xpath, have_tag and contain matchers from Merb
92
+ * Switch from Hpricot to Nokogiri for XML parsing (thanks, Aaron Patterson)
93
+
94
+ * 37 Minor enhancements
95
+
96
+ * Added #within for manipulating the current page within a selector scope
97
+ * Add support for file fields via #attaches_file method (Rails only at the moment)
98
+ (Kyle Hargraves)
99
+ * Add support for simulating SSL requests (Luke Melia)
100
+ * Added #basic_auth(user, pass) to support HTTP Basic Auth (Aslak Hellesøy)
101
+ * Added support for Sinatra and Rack (Aslak Hellesøy)
102
+ * Rename visits to visit, fills_in to fill_in, etc.
103
+ * Add #field_labeled for looking up form fields by label (David Chelimsky)
104
+ * Add #field_named and #field_with_id locators
105
+ * Don't depend on hoe anymore
106
+ * Return responses after sending requests
107
+ * Allow clicking links and buttons by a regular expression in Selenium (Luke Melia)
108
+ * Allow clicking links by a regular expression
109
+ * Add #http_accept for including MIME type HTTP "Accept" headers (Ryan Briones)
110
+ * Add #header to support inclusion of custom HTTP headers (Ryan Briones)
111
+ * Consider response codes 200-499 as successful enough to not raise a Webrat error
112
+ (David Leal)
113
+ * Add support for clicking areas of an image map (Alex Lang)
114
+ * Support relative links, including href="?foo=bar" (Kyle Hargraves)
115
+ * Separated Rails-specific code from the Webrat core to make it easier to use
116
+ Webrat with other environments
117
+ * Alias visits as visit, clicks_link as click_link, etc. for better readability
118
+ * Raise error when trying to interact with a disabled form element (Luke Melia)
119
+ * Don't send disabled form elements to the server (Nicholas A. Evans)
120
+ * Display response body when the page load is not successful (David Leal)
121
+ * CGI escape form field values (Miha Filej)
122
+ * Add support for redirect_to :back by sending HTTP_REFERER headers
123
+ (Hendrik Volkmer)
124
+ * Expose current DOM (as an Hpricot object) as #current_dom
125
+ * Add support for disabling JavaScript when clicking a link to enable testing of
126
+ both JS and non-JS implementations (Luke Melia and Bryan Helmkamp)
127
+ * Support &nbsp's as spaces in matching link text (Luke Melia)
128
+ * Support button elements (Nick Sieger)
129
+ * Support matching select options by regexp (Kyle Hargraves)
130
+ * save_and_open_page rewrites css and image references to provide a friendlier
131
+ debugging experience (Luke Melia)
132
+ * Added support for matching alt attributes in fields (primarly for clicks_button)
133
+ (Aaron Quint)
134
+ * Support '&' in submitted values (Kyle Hargraves)
135
+ * Support clicking links by title (Dan Barry)
136
+ * Added missing spec for clicking image buttons (Tim Harper)
137
+ * Switched tests to specs, and from Mocha to RSpec's mocking library
138
+ * Add support to click_button for IDs (Gwyn Morfey)
139
+ * Miscellaneous core refactorings (Jan Suchal)
140
+
141
+ * 8 Bug fixes
142
+
143
+ * Fix initialization of WWW::Mechanize (Derek Kastner)
144
+ * Don't open blank pages in the browser (Kyle Hargraves)
145
+ * Support radio buttons with multiple labels (Dan Barry)
146
+ * Fix load order bug on some platforms (Ismael Celis)
147
+ * Fix bug with empty select list option (Kyle Hargraves)
148
+ * Fix regression of not sending default values in password fields
149
+ * Don't explode if encountering inputs with no type attribute (assume text)
150
+ * Fix bug where choosing a radio button in a series with a default submitted the
151
+ incorrect field value (Luke Melia)
152
+
153
+ == 0.2.0 / 2008-04-04
154
+
155
+ * 4 Major enhancements
156
+
157
+ * Add save_and_open_page to aid in debugging
158
+ * Add radio button support via #chooses method
159
+ * Add basic support for Rails-generated JavaScript link tags
160
+ * Add support for checkboxes (Patches from Kyle Hargraves and Jarkko Laine)
161
+ * Add support for textarea fields (Sacha Schlegel)
162
+
163
+ * 8 Minor enhancements
164
+
165
+ * Added reloads method to reload the page (Kamal Fariz Mahyuddi)
166
+ * Prevent making a request if clicking on local anchor link (Kamal Fariz Mahyuddi)
167
+ * Added clicks_link_within(selector, link_text), allowing restricting link search
168
+ to within a given css selector (Luke Melia)
169
+ * Allow specifying the input name/label when doing a select (David Chelimsky)
170
+ * Raise a specific exception if the developer tries to manipulate form elements
171
+ before loading a page (James Deville)
172
+ * Add support for alternate POST, PUT and DELETE link clicking (Kyle Hargraves)
173
+ * Change clicks_link to find the shortest matching link (Luke Melia)
174
+ * Improve matching for labels in potentially ambiguous cases
175
+
176
+ * 7 Bug fixes
177
+
178
+ * Fix incorrect serializing of collection inputs, i.e. name contains []
179
+ (Kamal Fariz Mahyuddi)
180
+ * Serialize empty text field values just like browsers (Kamal Fariz Mahyuddi)
181
+ * Quick fix to avoid @dom not initialized warnings (Kamal Fariz Mahyuddi)
182
+ * Docfix: bad reference to #select method in README (Luke Melia)
183
+ * Ensure Rails-style checkboxes work properly (checkboxes followed by a hidden
184
+ input with the same name)
185
+ * Fix Edge Rails (a.k.a. 2.0 RC) compatibility (David Chelimsky)
186
+ * Support param hashes nested more than one level (David Chelimsky)
187
+
188
+ == 0.1.0 / 2007-11-28
189
+
190
+ * 1 major enhancement
191
+
192
+ * Birthday!
193
+
data/MIT-LICENSE.txt ADDED
@@ -0,0 +1,19 @@
1
+ Copyright (c) 2007 Bryan Helmkamp, Seth Fitzsimmons
2
+
3
+ Permission is hereby granted, free of charge, to any person obtaining a copy
4
+ of this software and associated documentation files (the "Software"), to deal
5
+ in the Software without restriction, including without limitation the rights
6
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
7
+ copies of the Software, and to permit persons to whom the Software is
8
+ furnished to do so, subject to the following conditions:
9
+
10
+ The above copyright notice and this permission notice shall be included in
11
+ all copies or substantial portions of the Software.
12
+
13
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
19
+ THE SOFTWARE.
data/README.rdoc ADDED
@@ -0,0 +1,81 @@
1
+ = Webrat - Ruby Acceptance Testing for Web applications
2
+
3
+ - http://gitrdoc.com/brynary/webrat
4
+ - http://groups.google.com/group/webrat
5
+ - http://webrat.lighthouseapp.com/
6
+ - http://github.com/brynary/webrat
7
+ - #webrat on Freenode
8
+
9
+ == Description
10
+
11
+ Webrat lets you quickly write expressive and robust acceptance tests for a Ruby
12
+ web application.
13
+
14
+ == Features
15
+
16
+ * Browser Simulator for expressive, high level acceptance testing without the
17
+ performance hit and browser dependency of Selenium or Watir (See Webrat::Session)
18
+ * Use the same API for Browser Simulator and real Selenium tests using
19
+ Webrat::Selenium when necessary (eg. for testing AJAX interactions)
20
+ * Supports multiple Ruby web frameworks: Rails, Merb and Sinatra
21
+ * Supports popular test frameworks: RSpec, Cucumber, Test::Unit and Shoulda
22
+ * Webrat::Matchers API for verifying rendered HTML using CSS, XPath, etc.
23
+
24
+ == Example
25
+
26
+ class SignupTest < ActionController::IntegrationTest
27
+
28
+ def test_trial_account_sign_up
29
+ visit home_path
30
+ click_link "Sign up"
31
+ fill_in "Email", :with => "good@example.com"
32
+ select "Free account"
33
+ click_button "Register"
34
+ end
35
+
36
+ end
37
+
38
+ Behind the scenes, Webrat will ensure:
39
+
40
+ * If a link, form field or button is missing, the test will fail.
41
+ * If a URL is invalid, the test will fail.
42
+ * If a page load or form submission is unsuccessful, the test will fail.
43
+
44
+ == Installing Nokogiri
45
+
46
+ Users of Debian Linux (e.g. Ubuntu) need to run:
47
+
48
+ sudo apt-get install libxslt1-dev libxml2-dev.
49
+
50
+ Otherwise the Nokogiri gem, which Webrat depends on, won't install properly.
51
+
52
+ == Install for Rails
53
+
54
+ To install the latest release as a gem:
55
+
56
+ sudo gem install webrat
57
+
58
+ To install the latest code as a plugin: (_Note:_ This may be less stable than using a released version)
59
+
60
+ script/plugin install git://github.com/brynary/webrat.git
61
+
62
+ In your test_helper.rb, spec_helper.rb, or env.rb (for Cucumber) add:
63
+
64
+ require "webrat/rails"
65
+
66
+ == Install with Merb
67
+
68
+ Merb 1.0 has built-in, seamless Webrat support. Just start using
69
+ methods from Webrat::Session in your specs.
70
+
71
+ == Authors
72
+
73
+ - Maintained by {Bryan Helmkamp}[mailto:bryan@brynary.com]
74
+ - Original code written by {Seth Fitzsimmons}[mailto:seth@mojodna.net]
75
+ - Initial development was sponsored by EastMedia[http://www.eastmedia.com]
76
+ - Many other contributors. See attributions in History.txt
77
+
78
+ == License
79
+
80
+ Copyright (c) 2007-2008 Bryan Helmkamp, Seth Fitzsimmons.
81
+ See MIT-LICENSE.txt in this directory.
data/Rakefile ADDED
@@ -0,0 +1,104 @@
1
+ require 'rubygems'
2
+ require "rake/gempackagetask"
3
+ require 'rake/rdoctask'
4
+ require "rake/clean"
5
+ require 'spec'
6
+ require 'spec/rake/spectask'
7
+ require 'spec/rake/verify_rcov'
8
+ require File.expand_path('./lib/webrat.rb')
9
+
10
+ ##############################################################################
11
+ # Package && release
12
+ ##############################################################################
13
+ spec = Gem::Specification.new do |s|
14
+ s.name = "webrat"
15
+ s.version = Webrat::VERSION
16
+ s.platform = Gem::Platform::RUBY
17
+ s.author = "Bryan Helmkamp"
18
+ s.email = "bryan" + "@" + "brynary.com"
19
+ s.homepage = "http://github.com/brynary/webrat"
20
+ s.summary = "Webrat. Ruby Acceptance Testing for Web applications"
21
+ s.bindir = "bin"
22
+ s.description = s.summary
23
+ s.require_path = "lib"
24
+ s.files = %w(History.txt install.rb MIT-LICENSE.txt README.rdoc Rakefile) + Dir["lib/**/*"] + Dir["vendor/**/*"]
25
+
26
+ # rdoc
27
+ s.has_rdoc = true
28
+ s.extra_rdoc_files = %w(README.rdoc MIT-LICENSE.txt)
29
+
30
+ # Dependencies
31
+ s.add_dependency "nokogiri", ">= 1.0.6"
32
+
33
+ s.rubyforge_project = "webrat"
34
+ end
35
+
36
+ Rake::GemPackageTask.new(spec) do |package|
37
+ package.gem_spec = spec
38
+ end
39
+
40
+ desc 'Show information about the gem.'
41
+ task :debug_gem do
42
+ puts spec.to_ruby
43
+ end
44
+
45
+ CLEAN.include ["pkg", "*.gem", "doc", "ri", "coverage"]
46
+
47
+ desc "Upload rdoc to brynary.com"
48
+ task :publish_rdoc => :docs do
49
+ sh "scp -r doc/ brynary.com:/apps/uploads/webrat"
50
+ end
51
+
52
+ desc "Run API and Core specs"
53
+ Spec::Rake::SpecTask.new do |t|
54
+ t.spec_opts = ['--options', "\"#{File.dirname(__FILE__)}/spec/spec.opts\""]
55
+ t.spec_files = FileList['spec/**/*_spec.rb']
56
+ end
57
+
58
+ desc "Run all specs in spec directory with RCov"
59
+ Spec::Rake::SpecTask.new(:rcov) do |t|
60
+ t.spec_opts = ['--options', "\"#{File.dirname(__FILE__)}/spec/spec.opts\""]
61
+ t.spec_files = FileList['spec/**/*_spec.rb']
62
+ t.rcov = true
63
+ t.rcov_opts = lambda do
64
+ IO.readlines(File.dirname(__FILE__) + "/spec/rcov.opts").map {|l| l.chomp.split " "}.flatten
65
+ end
66
+ end
67
+
68
+ RCov::VerifyTask.new(:verify_rcov => :rcov) do |t|
69
+ t.threshold = 96.2 # Make sure you have rcov 0.7 or higher!
70
+ end
71
+
72
+ desc 'Install the package as a gem.'
73
+ task :install_gem => [:clean, :package] do
74
+ gem = Dir['pkg/*.gem'].first
75
+ sh "sudo gem install --local #{gem}"
76
+ end
77
+
78
+ desc "Delete generated RDoc"
79
+ task :clobber_docs do
80
+ FileUtils.rm_rf("doc")
81
+ end
82
+
83
+ desc "Generate RDoc"
84
+ task :docs => :clobber_docs do
85
+ system "hanna --title 'Webrat #{Webrat::VERSION} API Documentation'"
86
+ end
87
+
88
+ desc "Run specs using jruby"
89
+ task "spec:jruby" do
90
+ system "jruby -S rake spec"
91
+ end
92
+
93
+ desc "Run each spec in isolation to test for dependency issues"
94
+ task :spec_deps do
95
+ Dir["spec/**/*_spec.rb"].each do |test|
96
+ if !system("spec #{test} &> /dev/null")
97
+ puts "Dependency Issues: #{test}"
98
+ end
99
+ end
100
+ end
101
+
102
+ task :default => :spec
103
+
104
+ task :precommit => ["spec", "spec:jruby"]
data/install.rb ADDED
@@ -0,0 +1 @@
1
+ puts IO.read(File.join(File.dirname(__FILE__), 'README.rdoc'))
data/lib/webrat.rb ADDED
@@ -0,0 +1,34 @@
1
+ require "rubygems"
2
+
3
+ $LOAD_PATH.unshift(File.expand_path(File.dirname(__FILE__))) unless $LOAD_PATH.include?(File.expand_path(File.dirname(__FILE__)))
4
+
5
+ module Webrat
6
+ # The common base class for all exceptions raised by Webrat.
7
+ class WebratError < StandardError
8
+ end
9
+
10
+ VERSION = '0.3.2.1'
11
+
12
+ def self.require_xml
13
+ gem "nokogiri", ">= 1.0.6"
14
+
15
+ if on_java?
16
+ # We need Nokogiri's CSS to XPath support, even if using REXML and Hpricot for parsing and searching
17
+ require "nokogiri/css"
18
+ require "hpricot"
19
+ require "rexml/document"
20
+ else
21
+ require "nokogiri"
22
+ require "webrat/core/xml/nokogiri"
23
+ end
24
+ end
25
+
26
+ def self.on_java?
27
+ RUBY_PLATFORM =~ /java/
28
+ end
29
+
30
+ end
31
+
32
+ Webrat.require_xml
33
+
34
+ require "webrat/core"
@@ -0,0 +1,13 @@
1
+ require "webrat/core/configuration"
2
+ require "webrat/core/xml"
3
+ require "webrat/core/xml/nokogiri"
4
+ require "webrat/core/logging"
5
+ require "webrat/core/elements/form"
6
+ require "webrat/core/scope"
7
+ require "webrat/core/elements/link"
8
+ require "webrat/core/elements/area"
9
+ require "webrat/core/elements/label"
10
+ require "webrat/core/elements/select_option"
11
+ require "webrat/core/session"
12
+ require "webrat/core/methods"
13
+ require "webrat/core/matchers"