diabolo-webrat 0.4.4.2 → 0.5.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/.document +4 -0
- data/.gitignore +15 -0
- data/History.txt +60 -9
- data/Rakefile +90 -75
- data/VERSION +1 -0
- data/lib/webrat.rb +8 -23
- data/lib/webrat/{mechanize.rb → adapters/mechanize.rb} +6 -2
- data/lib/webrat/adapters/merb.rb +11 -0
- data/lib/webrat/adapters/rack.rb +25 -0
- data/lib/webrat/{rails.rb → adapters/rails.rb} +9 -18
- data/lib/webrat/adapters/sinatra.rb +9 -0
- data/lib/webrat/core.rb +0 -1
- data/lib/webrat/core/configuration.rb +7 -17
- data/lib/webrat/core/elements/area.rb +2 -2
- data/lib/webrat/core/elements/element.rb +3 -3
- data/lib/webrat/core/elements/field.rb +33 -30
- data/lib/webrat/core/elements/form.rb +4 -4
- data/lib/webrat/core/elements/label.rb +4 -4
- data/lib/webrat/core/elements/link.rb +7 -6
- data/lib/webrat/core/elements/select_option.rb +2 -2
- data/lib/webrat/core/locators.rb +1 -1
- data/lib/webrat/core/locators/area_locator.rb +3 -3
- data/lib/webrat/core/locators/button_locator.rb +6 -6
- data/lib/webrat/core/locators/field_by_id_locator.rb +3 -3
- data/lib/webrat/core/locators/field_labeled_locator.rb +2 -2
- data/lib/webrat/core/locators/field_named_locator.rb +3 -3
- data/lib/webrat/core/locators/form_locator.rb +1 -1
- data/lib/webrat/core/locators/label_locator.rb +2 -2
- data/lib/webrat/core/locators/link_locator.rb +20 -12
- data/lib/webrat/core/locators/select_option_locator.rb +5 -5
- data/lib/webrat/core/logging.rb +1 -1
- data/lib/webrat/core/matchers/have_content.rb +2 -7
- data/lib/webrat/core/matchers/have_xpath.rb +2 -27
- data/lib/webrat/core/methods.rb +4 -4
- data/lib/webrat/core/mime.rb +11 -22
- data/lib/webrat/core/save_and_open_page.rb +5 -7
- data/lib/webrat/core/scope.rb +2 -2
- data/lib/webrat/core/session.rb +30 -14
- data/lib/webrat/core/xml.rb +41 -84
- data/lib/webrat/integrations/merb.rb +10 -0
- data/lib/webrat/integrations/rails.rb +9 -0
- data/lib/webrat/integrations/rspec-rails.rb +10 -0
- data/lib/webrat/integrations/selenium.rb +11 -0
- data/lib/webrat/rspec-rails.rb +2 -13
- data/lib/webrat/selenium.rb +0 -11
- data/lib/webrat/selenium/application_server_factory.rb +40 -0
- data/lib/webrat/selenium/application_servers.rb +5 -0
- data/lib/webrat/selenium/application_servers/base.rb +46 -0
- data/lib/webrat/selenium/application_servers/external.rb +26 -0
- data/lib/webrat/selenium/application_servers/merb.rb +50 -0
- data/lib/webrat/selenium/application_servers/rails.rb +44 -0
- data/lib/webrat/selenium/application_servers/sinatra.rb +37 -0
- data/lib/webrat/selenium/location_strategy_javascript/label.js +2 -1
- data/lib/webrat/selenium/selenium_rc_server.rb +7 -5
- data/lib/webrat/selenium/selenium_session.rb +20 -7
- data/lib/webrat/selenium/silence_stream.rb +1 -1
- data/spec/fakes/{test_session.rb → test_adapter.rb} +6 -3
- data/spec/integration/mechanize/Rakefile +7 -0
- data/spec/integration/mechanize/config.ru +2 -0
- data/spec/integration/mechanize/sample_app.rb +20 -0
- data/spec/integration/mechanize/spec/mechanize_spec.rb +22 -0
- data/spec/integration/mechanize/spec/spec_helper.rb +27 -0
- data/spec/integration/merb/.gitignore +21 -0
- data/spec/integration/merb/Rakefile +35 -0
- data/spec/integration/merb/app/controllers/testing.rb +9 -0
- data/spec/integration/merb/app/views/exceptions/not_acceptable.html.erb +63 -0
- data/spec/integration/merb/app/views/exceptions/not_found.html.erb +47 -0
- data/spec/integration/merb/app/views/layout/application.html.erb +12 -0
- data/spec/integration/merb/app/views/testing/show_form.html.erb +27 -0
- data/spec/integration/merb/app/views/testing/upload.html.erb +9 -0
- data/spec/integration/merb/config/router.rb +1 -0
- data/spec/integration/merb/spec/spec.opts +1 -0
- data/spec/integration/merb/spec/spec_helper.rb +2 -0
- data/spec/integration/merb/spec/webrat_spec.rb +7 -0
- data/spec/integration/merb/tasks/merb.thor/main.thor +150 -0
- data/spec/integration/rack/Rakefile +5 -0
- data/spec/integration/rack/app.rb +89 -0
- data/spec/integration/rack/test/helper.rb +21 -0
- data/spec/integration/rack/test/webrat_rack_test.rb +57 -51
- data/spec/integration/rails/.gitignore +3 -0
- data/spec/integration/rails/Rakefile +30 -0
- data/spec/integration/rails/app/controllers/webrat_controller.rb +13 -9
- data/spec/integration/rails/app/views/buttons/show.html.erb +11 -0
- data/spec/integration/rails/app/views/fields/show.html.erb +9 -0
- data/spec/integration/rails/app/views/links/show.html.erb +5 -0
- data/spec/integration/rails/app/views/webrat/before_redirect_form.html.erb +4 -0
- data/spec/integration/rails/app/views/webrat/buttons.html.erb +11 -0
- data/spec/integration/rails/app/views/webrat/form.html.erb +28 -0
- data/spec/integration/rails/config/locales/en.yml +5 -0
- data/spec/integration/rails/config/routes.rb +1 -0
- data/spec/integration/rails/public/404.html +30 -0
- data/spec/integration/rails/public/422.html +30 -0
- data/spec/integration/rails/public/500.html +33 -0
- data/spec/integration/rails/script/about +4 -0
- data/spec/integration/rails/script/console +3 -0
- data/spec/integration/rails/script/dbconsole +3 -0
- data/spec/integration/rails/script/destroy +3 -0
- data/spec/integration/rails/script/generate +3 -0
- data/spec/integration/rails/script/performance/benchmarker +3 -0
- data/spec/integration/rails/script/performance/profiler +3 -0
- data/spec/integration/rails/script/performance/request +3 -0
- data/spec/integration/rails/script/plugin +3 -0
- data/spec/integration/rails/script/process/inspector +3 -0
- data/spec/integration/rails/script/process/reaper +3 -0
- data/spec/integration/rails/script/process/spawner +3 -0
- data/spec/integration/rails/script/runner +3 -0
- data/spec/integration/rails/script/server +3 -0
- data/spec/integration/rails/test/integration/button_click_test.rb +2 -2
- data/spec/integration/rails/test/integration/link_click_test.rb +7 -1
- data/spec/integration/rails/test/integration/webrat_test.rb +22 -0
- data/spec/integration/rails/test/test_helper.rb +6 -5
- data/spec/integration/sinatra/Rakefile +5 -0
- data/spec/integration/sinatra/test/test_helper.rb +3 -2
- data/spec/private/core/configuration_spec.rb +8 -27
- data/spec/private/core/field_spec.rb +7 -7
- data/spec/private/core/link_spec.rb +1 -1
- data/spec/private/core/session_spec.rb +23 -21
- data/spec/private/mechanize/{mechanize_session_spec.rb → mechanize_adapter_spec.rb} +4 -12
- data/spec/private/nokogiri_spec.rb +2 -2
- data/spec/private/rails/{rails_session_spec.rb → rails_adapter_spec.rb} +16 -16
- data/spec/private/selenium/application_servers/rails_spec.rb +26 -0
- data/spec/public/matchers/contain_spec.rb +4 -4
- data/spec/public/matchers/have_selector_spec.rb +2 -2
- data/spec/public/matchers/have_xpath_spec.rb +3 -3
- data/spec/public/save_and_open_spec.rb +25 -6
- data/spec/public/selenium/application_server_factory_spec.rb +49 -0
- data/spec/public/selenium/application_servers/external_spec.rb +12 -0
- data/spec/public/selenium/selenium_session_spec.rb +37 -0
- data/spec/rcov.opts +1 -0
- data/spec/spec.opts +2 -0
- data/spec/spec_helper.rb +5 -1
- data/vendor/selenium-server.jar +0 -0
- data/webrat.gemspec +348 -0
- metadata +176 -23
- data/lib/webrat/core/xml/hpricot.rb +0 -19
- data/lib/webrat/core/xml/nokogiri.rb +0 -76
- data/lib/webrat/core/xml/rexml.rb +0 -24
- data/lib/webrat/merb_session.rb +0 -65
- data/lib/webrat/rack.rb +0 -24
- data/lib/webrat/rack_test.rb +0 -32
- data/lib/webrat/selenium/application_server.rb +0 -73
- data/lib/webrat/selenium/merb_application_server.rb +0 -48
- data/lib/webrat/selenium/rails_application_server.rb +0 -42
- data/lib/webrat/selenium/sinatra_application_server.rb +0 -35
- data/lib/webrat/sinatra.rb +0 -44
- data/spec/integration/rack/rack_app.rb +0 -16
- data/spec/integration/rack/test/test_helper.rb +0 -20
- data/spec/private/merb/merb_session_spec.rb +0 -42
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: diabolo-webrat
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.
|
|
4
|
+
version: 0.5.1
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Bryan Helmkamp
|
|
@@ -9,7 +9,7 @@ autorequire:
|
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
11
|
|
|
12
|
-
date: 2009-
|
|
12
|
+
date: 2009-08-25 00:00:00 -07:00
|
|
13
13
|
default_executable:
|
|
14
14
|
dependencies:
|
|
15
15
|
- !ruby/object:Gem::Dependency
|
|
@@ -22,22 +22,41 @@ dependencies:
|
|
|
22
22
|
- !ruby/object:Gem::Version
|
|
23
23
|
version: 1.2.0
|
|
24
24
|
version:
|
|
25
|
-
|
|
25
|
+
- !ruby/object:Gem::Dependency
|
|
26
|
+
name: rack
|
|
27
|
+
type: :runtime
|
|
28
|
+
version_requirement:
|
|
29
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
30
|
+
requirements:
|
|
31
|
+
- - ">="
|
|
32
|
+
- !ruby/object:Gem::Version
|
|
33
|
+
version: "1.0"
|
|
34
|
+
version:
|
|
35
|
+
description: Webrat lets you quickly write expressive and robust acceptance tests for a Ruby web application. It supports simulating a browser inside a Ruby process to avoid the performance hit and browser dependency of Selenium or Watir, but the same API can also be used to drive real Selenium tests when necessary (eg. for testing AJAX interactions). Most Ruby web frameworks and testing frameworks are supported.
|
|
26
36
|
email: bryan@brynary.com
|
|
27
37
|
executables: []
|
|
28
38
|
|
|
29
39
|
extensions: []
|
|
30
40
|
|
|
31
41
|
extra_rdoc_files:
|
|
42
|
+
- History.txt
|
|
32
43
|
- MIT-LICENSE.txt
|
|
33
44
|
- README.rdoc
|
|
34
45
|
files:
|
|
46
|
+
- .document
|
|
47
|
+
- .gitignore
|
|
35
48
|
- History.txt
|
|
36
49
|
- MIT-LICENSE.txt
|
|
37
50
|
- README.rdoc
|
|
38
51
|
- Rakefile
|
|
52
|
+
- VERSION
|
|
39
53
|
- install.rb
|
|
40
54
|
- lib/webrat.rb
|
|
55
|
+
- lib/webrat/adapters/mechanize.rb
|
|
56
|
+
- lib/webrat/adapters/merb.rb
|
|
57
|
+
- lib/webrat/adapters/rack.rb
|
|
58
|
+
- lib/webrat/adapters/rails.rb
|
|
59
|
+
- lib/webrat/adapters/sinatra.rb
|
|
41
60
|
- lib/webrat/core.rb
|
|
42
61
|
- lib/webrat/core/configuration.rb
|
|
43
62
|
- lib/webrat/core/elements/area.rb
|
|
@@ -71,24 +90,26 @@ files:
|
|
|
71
90
|
- lib/webrat/core/scope.rb
|
|
72
91
|
- lib/webrat/core/session.rb
|
|
73
92
|
- lib/webrat/core/xml.rb
|
|
74
|
-
- lib/webrat/core/xml/hpricot.rb
|
|
75
|
-
- lib/webrat/core/xml/nokogiri.rb
|
|
76
|
-
- lib/webrat/core/xml/rexml.rb
|
|
77
93
|
- lib/webrat/core_extensions/blank.rb
|
|
78
94
|
- lib/webrat/core_extensions/deprecate.rb
|
|
79
95
|
- lib/webrat/core_extensions/detect_mapped.rb
|
|
80
96
|
- lib/webrat/core_extensions/meta_class.rb
|
|
81
97
|
- lib/webrat/core_extensions/nil_to_param.rb
|
|
82
98
|
- lib/webrat/core_extensions/tcp_socket.rb
|
|
83
|
-
- lib/webrat/
|
|
99
|
+
- lib/webrat/integrations/merb.rb
|
|
100
|
+
- lib/webrat/integrations/rails.rb
|
|
101
|
+
- lib/webrat/integrations/rspec-rails.rb
|
|
102
|
+
- lib/webrat/integrations/selenium.rb
|
|
84
103
|
- lib/webrat/merb.rb
|
|
85
|
-
- lib/webrat/merb_session.rb
|
|
86
|
-
- lib/webrat/rack.rb
|
|
87
|
-
- lib/webrat/rack_test.rb
|
|
88
|
-
- lib/webrat/rails.rb
|
|
89
104
|
- lib/webrat/rspec-rails.rb
|
|
90
105
|
- lib/webrat/selenium.rb
|
|
91
|
-
- lib/webrat/selenium/
|
|
106
|
+
- lib/webrat/selenium/application_server_factory.rb
|
|
107
|
+
- lib/webrat/selenium/application_servers.rb
|
|
108
|
+
- lib/webrat/selenium/application_servers/base.rb
|
|
109
|
+
- lib/webrat/selenium/application_servers/external.rb
|
|
110
|
+
- lib/webrat/selenium/application_servers/merb.rb
|
|
111
|
+
- lib/webrat/selenium/application_servers/rails.rb
|
|
112
|
+
- lib/webrat/selenium/application_servers/sinatra.rb
|
|
92
113
|
- lib/webrat/selenium/location_strategy_javascript/button.js
|
|
93
114
|
- lib/webrat/selenium/location_strategy_javascript/label.js
|
|
94
115
|
- lib/webrat/selenium/location_strategy_javascript/webrat.js
|
|
@@ -100,15 +121,141 @@ files:
|
|
|
100
121
|
- lib/webrat/selenium/matchers/have_selector.rb
|
|
101
122
|
- lib/webrat/selenium/matchers/have_tag.rb
|
|
102
123
|
- lib/webrat/selenium/matchers/have_xpath.rb
|
|
103
|
-
- lib/webrat/selenium/merb_application_server.rb
|
|
104
|
-
- lib/webrat/selenium/rails_application_server.rb
|
|
105
124
|
- lib/webrat/selenium/selenium_extensions.js
|
|
106
125
|
- lib/webrat/selenium/selenium_rc_server.rb
|
|
107
126
|
- lib/webrat/selenium/selenium_session.rb
|
|
108
127
|
- lib/webrat/selenium/silence_stream.rb
|
|
109
|
-
-
|
|
110
|
-
-
|
|
128
|
+
- spec/fakes/test_adapter.rb
|
|
129
|
+
- spec/integration/mechanize/Rakefile
|
|
130
|
+
- spec/integration/mechanize/config.ru
|
|
131
|
+
- spec/integration/mechanize/sample_app.rb
|
|
132
|
+
- spec/integration/mechanize/spec/mechanize_spec.rb
|
|
133
|
+
- spec/integration/mechanize/spec/spec_helper.rb
|
|
134
|
+
- spec/integration/merb/.gitignore
|
|
135
|
+
- spec/integration/merb/Rakefile
|
|
136
|
+
- spec/integration/merb/app/controllers/application.rb
|
|
137
|
+
- spec/integration/merb/app/controllers/exceptions.rb
|
|
138
|
+
- spec/integration/merb/app/controllers/testing.rb
|
|
139
|
+
- spec/integration/merb/app/views/exceptions/not_acceptable.html.erb
|
|
140
|
+
- spec/integration/merb/app/views/exceptions/not_found.html.erb
|
|
141
|
+
- spec/integration/merb/app/views/layout/application.html.erb
|
|
142
|
+
- spec/integration/merb/app/views/testing/show_form.html.erb
|
|
143
|
+
- spec/integration/merb/app/views/testing/upload.html.erb
|
|
144
|
+
- spec/integration/merb/config/environments/development.rb
|
|
145
|
+
- spec/integration/merb/config/environments/rake.rb
|
|
146
|
+
- spec/integration/merb/config/environments/test.rb
|
|
147
|
+
- spec/integration/merb/config/init.rb
|
|
148
|
+
- spec/integration/merb/config/rack.rb
|
|
149
|
+
- spec/integration/merb/config/router.rb
|
|
150
|
+
- spec/integration/merb/spec/spec.opts
|
|
151
|
+
- spec/integration/merb/spec/spec_helper.rb
|
|
152
|
+
- spec/integration/merb/spec/webrat_spec.rb
|
|
153
|
+
- spec/integration/merb/tasks/merb.thor/app_script.rb
|
|
154
|
+
- spec/integration/merb/tasks/merb.thor/common.rb
|
|
155
|
+
- spec/integration/merb/tasks/merb.thor/gem_ext.rb
|
|
156
|
+
- spec/integration/merb/tasks/merb.thor/main.thor
|
|
157
|
+
- spec/integration/merb/tasks/merb.thor/ops.rb
|
|
158
|
+
- spec/integration/merb/tasks/merb.thor/utils.rb
|
|
159
|
+
- spec/integration/rack/Rakefile
|
|
160
|
+
- spec/integration/rack/app.rb
|
|
161
|
+
- spec/integration/rack/test/helper.rb
|
|
162
|
+
- spec/integration/rack/test/webrat_rack_test.rb
|
|
163
|
+
- spec/integration/rails/.gitignore
|
|
164
|
+
- spec/integration/rails/Rakefile
|
|
165
|
+
- spec/integration/rails/app/controllers/application.rb
|
|
166
|
+
- spec/integration/rails/app/controllers/buttons_controller.rb
|
|
167
|
+
- spec/integration/rails/app/controllers/fields_controller.rb
|
|
168
|
+
- spec/integration/rails/app/controllers/links_controller.rb
|
|
169
|
+
- spec/integration/rails/app/controllers/webrat_controller.rb
|
|
170
|
+
- spec/integration/rails/app/helpers/buttons_helper.rb
|
|
171
|
+
- spec/integration/rails/app/helpers/fields_helper.rb
|
|
172
|
+
- spec/integration/rails/app/helpers/links_helper.rb
|
|
173
|
+
- spec/integration/rails/app/views/buttons/show.html.erb
|
|
174
|
+
- spec/integration/rails/app/views/fields/show.html.erb
|
|
175
|
+
- spec/integration/rails/app/views/links/show.html.erb
|
|
176
|
+
- spec/integration/rails/app/views/webrat/before_redirect_form.html.erb
|
|
177
|
+
- spec/integration/rails/app/views/webrat/buttons.html.erb
|
|
178
|
+
- spec/integration/rails/app/views/webrat/form.html.erb
|
|
179
|
+
- spec/integration/rails/config/boot.rb
|
|
180
|
+
- spec/integration/rails/config/environment.rb
|
|
181
|
+
- spec/integration/rails/config/environments/development.rb
|
|
182
|
+
- spec/integration/rails/config/environments/selenium.rb
|
|
183
|
+
- spec/integration/rails/config/environments/test.rb
|
|
184
|
+
- spec/integration/rails/config/initializers/inflections.rb
|
|
185
|
+
- spec/integration/rails/config/initializers/mime_types.rb
|
|
186
|
+
- spec/integration/rails/config/initializers/new_rails_defaults.rb
|
|
187
|
+
- spec/integration/rails/config/locales/en.yml
|
|
188
|
+
- spec/integration/rails/config/routes.rb
|
|
189
|
+
- spec/integration/rails/public/404.html
|
|
190
|
+
- spec/integration/rails/public/422.html
|
|
191
|
+
- spec/integration/rails/public/500.html
|
|
192
|
+
- spec/integration/rails/script/about
|
|
193
|
+
- spec/integration/rails/script/console
|
|
194
|
+
- spec/integration/rails/script/dbconsole
|
|
195
|
+
- spec/integration/rails/script/destroy
|
|
196
|
+
- spec/integration/rails/script/generate
|
|
197
|
+
- spec/integration/rails/script/performance/benchmarker
|
|
198
|
+
- spec/integration/rails/script/performance/profiler
|
|
199
|
+
- spec/integration/rails/script/performance/request
|
|
200
|
+
- spec/integration/rails/script/plugin
|
|
201
|
+
- spec/integration/rails/script/process/inspector
|
|
202
|
+
- spec/integration/rails/script/process/reaper
|
|
203
|
+
- spec/integration/rails/script/process/spawner
|
|
204
|
+
- spec/integration/rails/script/runner
|
|
205
|
+
- spec/integration/rails/script/server
|
|
206
|
+
- spec/integration/rails/test/integration/button_click_test.rb
|
|
207
|
+
- spec/integration/rails/test/integration/fill_in_test.rb
|
|
208
|
+
- spec/integration/rails/test/integration/link_click_test.rb
|
|
209
|
+
- spec/integration/rails/test/integration/webrat_test.rb
|
|
210
|
+
- spec/integration/rails/test/test_helper.rb
|
|
211
|
+
- spec/integration/sinatra/Rakefile
|
|
212
|
+
- spec/integration/sinatra/classic_app.rb
|
|
213
|
+
- spec/integration/sinatra/modular_app.rb
|
|
214
|
+
- spec/integration/sinatra/test/classic_app_test.rb
|
|
215
|
+
- spec/integration/sinatra/test/modular_app_test.rb
|
|
216
|
+
- spec/integration/sinatra/test/test_helper.rb
|
|
217
|
+
- spec/private/core/configuration_spec.rb
|
|
218
|
+
- spec/private/core/field_spec.rb
|
|
219
|
+
- spec/private/core/link_spec.rb
|
|
220
|
+
- spec/private/core/logging_spec.rb
|
|
221
|
+
- spec/private/core/session_spec.rb
|
|
222
|
+
- spec/private/mechanize/mechanize_adapter_spec.rb
|
|
223
|
+
- spec/private/nokogiri_spec.rb
|
|
224
|
+
- spec/private/rails/attaches_file_spec.rb
|
|
225
|
+
- spec/private/rails/rails_adapter_spec.rb
|
|
226
|
+
- spec/private/selenium/application_servers/rails_spec.rb
|
|
227
|
+
- spec/public/basic_auth_spec.rb
|
|
228
|
+
- spec/public/check_spec.rb
|
|
229
|
+
- spec/public/choose_spec.rb
|
|
230
|
+
- spec/public/click_area_spec.rb
|
|
231
|
+
- spec/public/click_button_spec.rb
|
|
232
|
+
- spec/public/click_link_spec.rb
|
|
233
|
+
- spec/public/fill_in_spec.rb
|
|
234
|
+
- spec/public/locators/field_by_xpath_spec.rb
|
|
235
|
+
- spec/public/locators/field_labeled_spec.rb
|
|
236
|
+
- spec/public/locators/field_with_id_spec.rb
|
|
237
|
+
- spec/public/matchers/contain_spec.rb
|
|
238
|
+
- spec/public/matchers/have_selector_spec.rb
|
|
239
|
+
- spec/public/matchers/have_tag_spec.rb
|
|
240
|
+
- spec/public/matchers/have_xpath_spec.rb
|
|
241
|
+
- spec/public/reload_spec.rb
|
|
242
|
+
- spec/public/save_and_open_spec.rb
|
|
243
|
+
- spec/public/select_date_spec.rb
|
|
244
|
+
- spec/public/select_datetime_spec.rb
|
|
245
|
+
- spec/public/select_spec.rb
|
|
246
|
+
- spec/public/select_time_spec.rb
|
|
247
|
+
- spec/public/selenium/application_server_factory_spec.rb
|
|
248
|
+
- spec/public/selenium/application_servers/external_spec.rb
|
|
249
|
+
- spec/public/selenium/selenium_session_spec.rb
|
|
250
|
+
- spec/public/set_hidden_field_spec.rb
|
|
251
|
+
- spec/public/submit_form_spec.rb
|
|
252
|
+
- spec/public/visit_spec.rb
|
|
253
|
+
- spec/public/within_spec.rb
|
|
254
|
+
- spec/rcov.opts
|
|
255
|
+
- spec/spec.opts
|
|
256
|
+
- spec/spec_helper.rb
|
|
111
257
|
- vendor/selenium-server.jar
|
|
258
|
+
- webrat.gemspec
|
|
112
259
|
has_rdoc: true
|
|
113
260
|
homepage: http://github.com/brynary/webrat
|
|
114
261
|
post_install_message:
|
|
@@ -134,9 +281,12 @@ rubyforge_project: webrat
|
|
|
134
281
|
rubygems_version: 1.2.0
|
|
135
282
|
signing_key:
|
|
136
283
|
specification_version: 2
|
|
137
|
-
summary:
|
|
284
|
+
summary: Ruby Acceptance Testing for Web applications
|
|
138
285
|
test_files:
|
|
139
|
-
- spec/fakes/
|
|
286
|
+
- spec/fakes/test_adapter.rb
|
|
287
|
+
- spec/integration/mechanize/sample_app.rb
|
|
288
|
+
- spec/integration/mechanize/spec/mechanize_spec.rb
|
|
289
|
+
- spec/integration/mechanize/spec/spec_helper.rb
|
|
140
290
|
- spec/integration/merb/app/controllers/application.rb
|
|
141
291
|
- spec/integration/merb/app/controllers/exceptions.rb
|
|
142
292
|
- spec/integration/merb/app/controllers/testing.rb
|
|
@@ -153,8 +303,8 @@ test_files:
|
|
|
153
303
|
- spec/integration/merb/tasks/merb.thor/gem_ext.rb
|
|
154
304
|
- spec/integration/merb/tasks/merb.thor/ops.rb
|
|
155
305
|
- spec/integration/merb/tasks/merb.thor/utils.rb
|
|
156
|
-
- spec/integration/rack/
|
|
157
|
-
- spec/integration/rack/test/
|
|
306
|
+
- spec/integration/rack/app.rb
|
|
307
|
+
- spec/integration/rack/test/helper.rb
|
|
158
308
|
- spec/integration/rack/test/webrat_rack_test.rb
|
|
159
309
|
- spec/integration/rails/app/controllers/application.rb
|
|
160
310
|
- spec/integration/rails/app/controllers/buttons_controller.rb
|
|
@@ -188,11 +338,11 @@ test_files:
|
|
|
188
338
|
- spec/private/core/link_spec.rb
|
|
189
339
|
- spec/private/core/logging_spec.rb
|
|
190
340
|
- spec/private/core/session_spec.rb
|
|
191
|
-
- spec/private/mechanize/
|
|
192
|
-
- spec/private/merb/merb_session_spec.rb
|
|
341
|
+
- spec/private/mechanize/mechanize_adapter_spec.rb
|
|
193
342
|
- spec/private/nokogiri_spec.rb
|
|
194
343
|
- spec/private/rails/attaches_file_spec.rb
|
|
195
|
-
- spec/private/rails/
|
|
344
|
+
- spec/private/rails/rails_adapter_spec.rb
|
|
345
|
+
- spec/private/selenium/application_servers/rails_spec.rb
|
|
196
346
|
- spec/public/basic_auth_spec.rb
|
|
197
347
|
- spec/public/check_spec.rb
|
|
198
348
|
- spec/public/choose_spec.rb
|
|
@@ -213,6 +363,9 @@ test_files:
|
|
|
213
363
|
- spec/public/select_datetime_spec.rb
|
|
214
364
|
- spec/public/select_spec.rb
|
|
215
365
|
- spec/public/select_time_spec.rb
|
|
366
|
+
- spec/public/selenium/application_server_factory_spec.rb
|
|
367
|
+
- spec/public/selenium/application_servers/external_spec.rb
|
|
368
|
+
- spec/public/selenium/selenium_session_spec.rb
|
|
216
369
|
- spec/public/set_hidden_field_spec.rb
|
|
217
370
|
- spec/public/submit_form_spec.rb
|
|
218
371
|
- spec/public/visit_spec.rb
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
module Webrat
|
|
2
|
-
|
|
3
|
-
def self.hpricot_document(stringlike)
|
|
4
|
-
return stringlike.dom if stringlike.respond_to?(:dom)
|
|
5
|
-
|
|
6
|
-
if Hpricot::Doc === stringlike
|
|
7
|
-
stringlike
|
|
8
|
-
elsif Hpricot::Elements === stringlike
|
|
9
|
-
stringlike
|
|
10
|
-
elsif StringIO === stringlike
|
|
11
|
-
Hpricot(stringlike.string)
|
|
12
|
-
elsif stringlike.respond_to?(:body)
|
|
13
|
-
Hpricot(stringlike.body.to_s)
|
|
14
|
-
else
|
|
15
|
-
Hpricot(stringlike.to_s)
|
|
16
|
-
end
|
|
17
|
-
end
|
|
18
|
-
|
|
19
|
-
end
|
|
@@ -1,76 +0,0 @@
|
|
|
1
|
-
require "webrat/core_extensions/meta_class"
|
|
2
|
-
|
|
3
|
-
module Webrat
|
|
4
|
-
|
|
5
|
-
def self.nokogiri_document(stringlike) #:nodoc:
|
|
6
|
-
return stringlike.dom if stringlike.respond_to?(:dom)
|
|
7
|
-
|
|
8
|
-
if Nokogiri::HTML::Document === stringlike
|
|
9
|
-
stringlike
|
|
10
|
-
elsif Nokogiri::XML::NodeSet === stringlike
|
|
11
|
-
stringlike
|
|
12
|
-
elsif StringIO === stringlike
|
|
13
|
-
Nokogiri::HTML(stringlike.string)
|
|
14
|
-
elsif stringlike.respond_to?(:body)
|
|
15
|
-
Nokogiri::HTML(stringlike.body.to_s)
|
|
16
|
-
else
|
|
17
|
-
Nokogiri::HTML(stringlike.to_s)
|
|
18
|
-
end
|
|
19
|
-
end
|
|
20
|
-
|
|
21
|
-
def self.html_nokogiri_document(stringlike) #:nodoc:
|
|
22
|
-
return stringlike.dom if stringlike.respond_to?(:dom)
|
|
23
|
-
|
|
24
|
-
if Nokogiri::HTML::Document === stringlike
|
|
25
|
-
stringlike
|
|
26
|
-
elsif Nokogiri::XML::NodeSet === stringlike
|
|
27
|
-
stringlike
|
|
28
|
-
elsif StringIO === stringlike
|
|
29
|
-
Nokogiri::HTML(stringlike.string)
|
|
30
|
-
elsif stringlike.respond_to?(:body)
|
|
31
|
-
Nokogiri::HTML(stringlike.body.to_s)
|
|
32
|
-
else
|
|
33
|
-
Nokogiri::HTML(stringlike.to_s)
|
|
34
|
-
end
|
|
35
|
-
end
|
|
36
|
-
|
|
37
|
-
def self.xml_nokogiri_document(stringlike) #:nodoc:
|
|
38
|
-
return stringlike.dom if stringlike.respond_to?(:dom)
|
|
39
|
-
|
|
40
|
-
if Nokogiri::HTML::Document === stringlike
|
|
41
|
-
stringlike
|
|
42
|
-
elsif Nokogiri::XML::NodeSet === stringlike
|
|
43
|
-
stringlike
|
|
44
|
-
elsif StringIO === stringlike
|
|
45
|
-
Nokogiri::XML(stringlike.string)
|
|
46
|
-
elsif stringlike.respond_to?(:body)
|
|
47
|
-
Nokogiri::XML(stringlike.body.to_s)
|
|
48
|
-
else
|
|
49
|
-
Nokogiri::XML(stringlike.to_s)
|
|
50
|
-
end
|
|
51
|
-
end
|
|
52
|
-
|
|
53
|
-
def self.define_dom_method(object, dom) #:nodoc:
|
|
54
|
-
object.meta_class.send(:define_method, :dom) do
|
|
55
|
-
dom
|
|
56
|
-
end
|
|
57
|
-
end
|
|
58
|
-
|
|
59
|
-
end
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
module Nokogiri #:nodoc:
|
|
63
|
-
module CSS #:nodoc:
|
|
64
|
-
class XPathVisitor #:nodoc:
|
|
65
|
-
|
|
66
|
-
def visit_pseudo_class_text(node) #:nodoc:
|
|
67
|
-
"@type='text'"
|
|
68
|
-
end
|
|
69
|
-
|
|
70
|
-
def visit_pseudo_class_password(node) #:nodoc:
|
|
71
|
-
"@type='password'"
|
|
72
|
-
end
|
|
73
|
-
|
|
74
|
-
end
|
|
75
|
-
end
|
|
76
|
-
end
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
module Webrat
|
|
2
|
-
|
|
3
|
-
def self.rexml_document(stringlike)
|
|
4
|
-
stringlike = stringlike.body.to_s if stringlike.respond_to?(:body)
|
|
5
|
-
|
|
6
|
-
case stringlike
|
|
7
|
-
when REXML::Document
|
|
8
|
-
stringlike.root
|
|
9
|
-
when REXML::Node, Array
|
|
10
|
-
stringlike
|
|
11
|
-
else
|
|
12
|
-
begin
|
|
13
|
-
REXML::Document.new(stringlike.to_s).root
|
|
14
|
-
rescue REXML::ParseException => e
|
|
15
|
-
if e.message.include?("second root element")
|
|
16
|
-
REXML::Document.new("<fake-root-element>#{stringlike}</fake-root-element>").root
|
|
17
|
-
else
|
|
18
|
-
raise e
|
|
19
|
-
end
|
|
20
|
-
end
|
|
21
|
-
end
|
|
22
|
-
end
|
|
23
|
-
|
|
24
|
-
end
|
data/lib/webrat/merb_session.rb
DELETED
|
@@ -1,65 +0,0 @@
|
|
|
1
|
-
require "webrat"
|
|
2
|
-
|
|
3
|
-
require "cgi"
|
|
4
|
-
gem "extlib"
|
|
5
|
-
require "extlib"
|
|
6
|
-
require "merb-core"
|
|
7
|
-
|
|
8
|
-
# HashWithIndifferentAccess = Mash
|
|
9
|
-
|
|
10
|
-
module Webrat
|
|
11
|
-
class MerbSession < Session #:nodoc:
|
|
12
|
-
include Merb::Test::MakeRequest
|
|
13
|
-
|
|
14
|
-
attr_accessor :response
|
|
15
|
-
|
|
16
|
-
def get(url, data, headers = nil)
|
|
17
|
-
do_request(url, data, headers, "GET")
|
|
18
|
-
end
|
|
19
|
-
|
|
20
|
-
def post(url, data, headers = nil)
|
|
21
|
-
do_request(url, data, headers, "POST")
|
|
22
|
-
end
|
|
23
|
-
|
|
24
|
-
def put(url, data, headers = nil)
|
|
25
|
-
do_request(url, data, headers, "PUT")
|
|
26
|
-
end
|
|
27
|
-
|
|
28
|
-
def delete(url, data, headers = nil)
|
|
29
|
-
do_request(url, data, headers, "DELETE")
|
|
30
|
-
end
|
|
31
|
-
|
|
32
|
-
def response_body
|
|
33
|
-
@response.body.to_s
|
|
34
|
-
end
|
|
35
|
-
|
|
36
|
-
def response_code
|
|
37
|
-
@response.status
|
|
38
|
-
end
|
|
39
|
-
|
|
40
|
-
def do_request(url, data, headers, method)
|
|
41
|
-
@response = request(url,
|
|
42
|
-
:params => (data && data.any?) ? data : nil,
|
|
43
|
-
:headers => headers,
|
|
44
|
-
:method => method)
|
|
45
|
-
end
|
|
46
|
-
|
|
47
|
-
end
|
|
48
|
-
end
|
|
49
|
-
|
|
50
|
-
module Merb #:nodoc:
|
|
51
|
-
module Test #:nodoc:
|
|
52
|
-
module RequestHelper #:nodoc:
|
|
53
|
-
def request(uri, env = {})
|
|
54
|
-
@_webrat_session ||= Webrat::MerbSession.new
|
|
55
|
-
@_webrat_session.response = @_webrat_session.request(uri, env)
|
|
56
|
-
end
|
|
57
|
-
end
|
|
58
|
-
end
|
|
59
|
-
end
|
|
60
|
-
|
|
61
|
-
class Merb::Test::RspecStory #:nodoc:
|
|
62
|
-
def browser
|
|
63
|
-
@browser ||= Webrat::MerbSession.new
|
|
64
|
-
end
|
|
65
|
-
end
|