capybara-mechanize 0.2.2 → 0.2.3

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.
@@ -11,10 +11,6 @@ class Capybara::Driver::Mechanize < Capybara::Driver::RackTest
11
11
  @agent = ::Mechanize.new
12
12
  @agent.redirect_ok = false
13
13
  end
14
-
15
- def visit(url)
16
- get url
17
- end
18
14
 
19
15
  def cleanup!
20
16
  @agent.cookie_jar.clear!
@@ -34,7 +30,7 @@ class Capybara::Driver::Mechanize < Capybara::Driver::RackTest
34
30
  unless response.redirect?
35
31
  raise "Last response was not a redirect. Cannot follow_redirect!"
36
32
  end
37
-
33
+
38
34
  location = if last_request_remote?
39
35
  remote_response.page.response['Location']
40
36
  else
@@ -45,11 +41,19 @@ class Capybara::Driver::Mechanize < Capybara::Driver::RackTest
45
41
  end
46
42
 
47
43
  def get(url, params = {}, headers = {})
48
- process_remote_request(:get, url) || super
44
+ if remote?(url)
45
+ process_remote_request(:get, url)
46
+ else
47
+ super
48
+ end
49
49
  end
50
50
 
51
51
  def post(url, params = {}, headers = {})
52
- process_remote_request(:post, url, params, headers) || super
52
+ if remote?(url)
53
+ process_remote_request(:post, url, params, headers)
54
+ else
55
+ super
56
+ end
53
57
  end
54
58
 
55
59
  def remote?(url)
@@ -63,10 +67,10 @@ class Capybara::Driver::Mechanize < Capybara::Driver::RackTest
63
67
  end
64
68
  end
65
69
 
66
- private
67
-
68
70
  attr_reader :agent
69
71
 
72
+ private
73
+
70
74
  def last_request_remote?
71
75
  !!@last_request_remote
72
76
  end
@@ -77,8 +81,6 @@ class Capybara::Driver::Mechanize < Capybara::Driver::RackTest
77
81
  reset_cache
78
82
  @agent.send *( [method, url] + options)
79
83
  @last_request_remote = true
80
- follow_redirects!
81
- true
82
84
  else
83
85
  @last_request_remote = false
84
86
  end
@@ -1,96 +1,19 @@
1
- require 'rubygems'
2
- require 'sinatra'
3
- # require 'rack'
4
- # require 'yaml'
1
+ require 'capybara/spec/test_app'
5
2
 
6
- class TestApp < Sinatra::Base
7
- set :root, File.dirname(__FILE__)
8
- set :static, true
9
-
10
- get '/' do
11
- 'Hello world!'
12
- end
13
-
14
- get '/foo' do
15
- 'Another World'
16
- end
17
-
18
- get '/redirect' do
19
- redirect '/redirect_again'
20
- end
21
-
22
- get '/redirect_again' do
23
- redirect '/landed'
24
- end
25
-
26
- get '/redirect/:times/times' do
27
- times = params[:times].to_i
28
- if times.zero?
29
- "redirection complete"
30
- else
31
- redirect "/redirect/#{times - 1}/times"
32
- end
33
- end
34
-
35
- get '/landed' do
36
- "You landed"
37
- end
38
-
39
- get '/with-quotes' do
40
- %q{"No," he said, "you can't do that."}
41
- end
42
-
43
- get '/form/get' do
44
- '<pre id="results">' + params[:form].to_yaml + '</pre>'
45
- end
46
-
47
- get '/favicon.ico' do
48
- nil
49
- end
50
-
51
- post '/redirect' do
52
- redirect '/redirect_again'
53
- end
54
-
55
- delete "/delete" do
56
- "The requested object was deleted"
57
- end
58
-
59
- get '/redirect_back' do
60
- redirect back
61
- end
62
-
63
- get '/set_cookie' do
64
- cookie_value = 'test_cookie'
65
- response.set_cookie('capybara', cookie_value)
66
- "Cookie set to #{cookie_value}"
67
- end
68
-
69
- get '/get_cookie' do
70
- request.cookies['capybara']
71
- end
72
-
73
- get '/:view' do |view|
74
- erb view.to_sym
3
+ class ExtendedTestApp < TestApp#< Sinatra::Base
4
+ set :environment, :production # so we don't get debug info that makes our test pass!
5
+
6
+ get %r{/redirect_to/(.*)} do
7
+ redirect params[:captures]
75
8
  end
76
-
77
- post '/form' do
78
- '<pre id="results">' + params[:form].to_yaml + '</pre>'
9
+
10
+ get '/host' do
11
+ "current host is #{request.host}"
79
12
  end
13
+ end
80
14
 
81
- post '/upload' do
82
- begin
83
- buffer = []
84
- buffer << "Content-type: #{params[:form][:document][:type]}"
85
- buffer << "File content: #{params[:form][:document][:tempfile].read}"
86
- buffer.join(' | ')
87
- rescue
88
- 'No file uploaded'
89
- end
90
- end
15
+ if __FILE__ == $0
16
+ Rack::Handler::Mongrel.run ExtendedTestApp, :Port => 8070
91
17
  end
92
18
 
93
- # if __FILE__ == $0
94
- # Rack::Handler::Mongrel.run TestApp, :Port => 8070
95
- # end
96
19
 
@@ -2,7 +2,7 @@ require 'spec_helper'
2
2
 
3
3
  describe "Capybara::Driver::Mechanize, in local model" do
4
4
  before do
5
- @driver = Capybara::Driver::Mechanize.new(TestApp)
5
+ @driver = Capybara::Driver::Mechanize.new(ExtendedTestApp)
6
6
  end
7
7
 
8
8
  it "should throw an error when no rack app is given" do
@@ -15,9 +15,7 @@ describe "Capybara::Driver::Mechanize, in local model" do
15
15
  it_should_behave_like "driver with header support"
16
16
  it_should_behave_like "driver with status code support"
17
17
  it_should_behave_like "driver with cookies support"
18
-
19
- # Pending:
20
- # it_should_behave_like "driver with infinite redirect detection"
18
+ it_should_behave_like "driver with infinite redirect detection"
21
19
 
22
20
  it "should default to local mode" do
23
21
  @driver.remote?('http://www.local.com').should be false
@@ -50,10 +48,31 @@ describe "Capybara::Driver::Mechanize, in local model" do
50
48
  it "should treat other urls as remote" do
51
49
  @driver.remote?('http://www.remote.com').should be true
52
50
  end
51
+
52
+ it "should receive the right host" do
53
+ @driver.visit('http://www.local.com/host')
54
+ @driver.body.should include('local.com')
55
+ end
56
+
57
+ it "should follow redirects from local to remote" do
58
+ @driver.visit("http://www.local.com/redirect_to/#{REMOTE_TEST_URL}/host")
59
+ @driver.body.should include(REMOTE_TEST_HOST)
60
+ end
53
61
 
54
62
  after :each do
55
63
  Capybara.default_host = nil
56
64
  end
57
65
  end
58
66
 
67
+ it "should include the right host when remote" do
68
+ @driver.visit("#{REMOTE_TEST_URL}/host")
69
+ @driver.body.should include(REMOTE_TEST_HOST)
70
+ end
71
+
72
+
73
+ it "should follow redirects from remote to local" do
74
+ @driver.visit("#{REMOTE_TEST_URL}/redirect_to/http://www.local.com/host")
75
+ @driver.body.should include('local.com')
76
+ end
77
+
59
78
  end
@@ -2,7 +2,7 @@ require 'spec_helper'
2
2
 
3
3
  describe Capybara::Driver::Mechanize do
4
4
  before(:each) do
5
- Capybara.app_host = "http://capybara-testapp.heroku.com"
5
+ Capybara.app_host = REMOTE_TEST_URL
6
6
  end
7
7
 
8
8
  after(:each) do
@@ -12,14 +12,13 @@ describe Capybara::Driver::Mechanize do
12
12
  before do
13
13
  @driver = Capybara::Driver::Mechanize.new(TestApp)
14
14
  end
15
-
15
+
16
16
  context "in remote mode" do
17
17
  it_should_behave_like "driver"
18
18
  it_should_behave_like "driver with header support"
19
19
  it_should_behave_like "driver with status code support"
20
20
  it_should_behave_like "driver with cookies support"
21
-
22
- # Pending:
23
- # it_should_behave_like "driver with infinite redirect detection"
21
+ it_should_behave_like "driver with infinite redirect detection"
24
22
  end
23
+
25
24
  end
@@ -3,7 +3,7 @@ require 'spec_helper'
3
3
  describe Capybara::Session do
4
4
  context 'with remote mechanize driver' do
5
5
  before(:each) do
6
- Capybara.app_host = "http://capybara-testapp.heroku.com"
6
+ Capybara.app_host = REMOTE_TEST_URL
7
7
  end
8
8
 
9
9
  after(:each) do
data/spec/spec_helper.rb CHANGED
@@ -4,6 +4,8 @@ require 'capybara/mechanize'
4
4
  require 'sinatra'
5
5
  require 'spec'
6
6
 
7
+ require 'capybara/spec/extended_test_app'
8
+
7
9
  # TODO move this stuff into capybara
8
10
  require 'capybara/spec/driver'
9
11
  require 'capybara/spec/session'
@@ -16,4 +18,6 @@ Spec::Runner.configure do |config|
16
18
  config.after do
17
19
  Capybara.default_selector = :xpath
18
20
  end
19
- end
21
+ end
22
+ REMOTE_TEST_HOST = "capybara-testapp.heroku.com"
23
+ REMOTE_TEST_URL = "http://#{REMOTE_TEST_HOST}:8070"
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: capybara-mechanize
3
3
  version: !ruby/object:Gem::Version
4
- hash: 19
4
+ hash: 17
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
8
  - 2
9
- - 2
10
- version: 0.2.2
9
+ - 3
10
+ version: 0.2.3
11
11
  platform: ruby
12
12
  authors:
13
13
  - Jeroen van Dijk
@@ -50,26 +50,10 @@ dependencies:
50
50
  version: 0.3.9
51
51
  type: :runtime
52
52
  version_requirements: *id002
53
- - !ruby/object:Gem::Dependency
54
- name: rack
55
- prerelease: false
56
- requirement: &id003 !ruby/object:Gem::Requirement
57
- none: false
58
- requirements:
59
- - - "="
60
- - !ruby/object:Gem::Version
61
- hash: 31
62
- segments:
63
- - 1
64
- - 2
65
- - 0
66
- version: 1.2.0
67
- type: :runtime
68
- version_requirements: *id003
69
53
  - !ruby/object:Gem::Dependency
70
54
  name: rspec
71
55
  prerelease: false
72
- requirement: &id004 !ruby/object:Gem::Requirement
56
+ requirement: &id003 !ruby/object:Gem::Requirement
73
57
  none: false
74
58
  requirements:
75
59
  - - "="
@@ -81,7 +65,7 @@ dependencies:
81
65
  - 0
82
66
  version: 1.3.0
83
67
  type: :development
84
- version_requirements: *id004
68
+ version_requirements: *id003
85
69
  description: RackTest driver for Capybara, but with remote request support thanks to mechanize
86
70
  email: jeroen@jeevidee.nl
87
71
  executables: []
@@ -95,18 +79,6 @@ files:
95
79
  - lib/capybara/mechanize/cucumber.rb
96
80
  - lib/capybara/mechanize.rb
97
81
  - lib/capybara/spec/extended_test_app.rb
98
- - lib/capybara/spec/views/buttons.erb
99
- - lib/capybara/spec/views/fieldsets.erb
100
- - lib/capybara/spec/views/form.erb
101
- - lib/capybara/spec/views/frame_one.erb
102
- - lib/capybara/spec/views/frame_two.erb
103
- - lib/capybara/spec/views/postback.erb
104
- - lib/capybara/spec/views/tables.erb
105
- - lib/capybara/spec/views/with_html.erb
106
- - lib/capybara/spec/views/with_js.erb
107
- - lib/capybara/spec/views/with_scope.erb
108
- - lib/capybara/spec/views/with_simple_html.erb
109
- - lib/capybara/spec/views/within_frames.erb
110
82
  - spec/driver/mechanize_driver_spec.rb
111
83
  - spec/driver/remote_mechanize_driver_spec.rb
112
84
  - spec/session/mechanize_spec.rb
@@ -1,4 +0,0 @@
1
- <h1>Buttons</h1>
2
- <button>Click me!</button>
3
- <button id="click_me_123">Click me by id!</button>
4
- <button value="click_me">Click me by value!</button>
@@ -1,29 +0,0 @@
1
- <form action="/form" method="post">
2
- <fieldset id="agent_fieldset">
3
- <legend>Agent</legend>
4
-
5
- <p>
6
- <label for="form_agent_name">Name</label>
7
- <input type="text" name="form[agent_name]" value="James" id="form_agent_name"/>
8
- </p>
9
-
10
- <p>
11
- <input type="submit" value="Create"/>
12
- </p>
13
- </fieldset>
14
- </form>
15
-
16
- <form action="/form" method="post">
17
- <fieldset id="villain_fieldset">
18
- <legend>Villain</legend>
19
-
20
- <p>
21
- <label for="form_villain_name">Name</label>
22
- <input type="text" name="form[villain_name]" value="Ernst" id="form_villain_name"/>
23
- </p>
24
-
25
- <p>
26
- <input type="submit" value="Create"/>
27
- </p>
28
- </fieldset>
29
- </form>
@@ -1,245 +0,0 @@
1
- <h1>Form</h1>
2
-
3
- <form action="/form" method="post">
4
-
5
- <p>
6
- <label for="form_title">Title</label>
7
- <select name="form[title]" id="form_title">
8
- <option>Mrs</option>
9
- <option>Mr</option>
10
- <option>Miss</option>
11
- </select>
12
- </p>
13
-
14
-
15
- <p>
16
- <label for="form_other_title">Other title</label>
17
- <select name="form[other_title]" id="form_other_title">
18
- <option>Mrs</option>
19
- <option>Mr</option>
20
- <option>Miss</option>
21
- </select>
22
- </p>
23
-
24
- <p>
25
- <label for="form_first_name">
26
- First Name
27
- <input type="text" name="form[first_name]" value="John" id="form_first_name"/>
28
- </label>
29
- </p>
30
-
31
- <p>
32
- <label for="form_last_name">Last Name</label>
33
- <input type="text" name="form[last_name]" value="Smith" id="form_last_name"/>
34
- </p>
35
-
36
- <p>
37
- <label for="form_name_explanation">Explanation of Name</label>
38
- <textarea name="form[name_explanation]" id="form_name_explanation"></textarea>
39
- </p>
40
-
41
- <p>
42
- <label for="form_name">Name</label>
43
- <input type="text" name="form[name]" value="John Smith" id="form_name"/>
44
- </p>
45
-
46
- <p>
47
- <label for="form_schmooo">Schmooo</label>
48
- <input type="schmooo" name="form[schmooo]" value="This is Schmooo!" id="form_schmooo"/>
49
- </p>
50
-
51
- <p>
52
- <label>Street<br/>
53
- <input type="text" name="form[street]" value="Sesame street 66"/>
54
- </label>
55
- </p>
56
-
57
- <p>
58
- <label for="form_phone">Phone</label>
59
- <input name="form[phone]" value="+1 555 7021" id="form_phone"/>
60
- </p>
61
-
62
- <p>
63
- <label for="form_password">Password</label>
64
- <input type="password" name="form[password]" value="seeekrit" id="form_password"/>
65
- </p>
66
-
67
- <p>
68
- <label for="form_terms_of_use">Terms of Use</label>
69
- <input type="hidden" name="form[terms_of_use]" value="0" id="form_terms_of_use_default">
70
- <input type="checkbox" name="form[terms_of_use]" value="1" id="form_terms_of_use">
71
- </p>
72
-
73
- <p>
74
- <label for="form_image">Image</label>
75
- <input type="file" name="form[image]" id="form_image"/>
76
- </p>
77
-
78
- <p>
79
- <input type="hidden" name="form[token]" value="12345" id="form_token"/>
80
- </p>
81
-
82
- <p>
83
- <label for="form_locale">Locale</label>
84
- <select name="form[locale]" id="form_locale">
85
- <option value="sv">Swedish</option>
86
- <option selected="selected" value="en">English</option>
87
- <option value="fi">Finish</option>
88
- <option value="no">Norwegian</option>
89
- <option value="jo">John's made-up language</option>
90
- <option value="jbo"> Lojban </option>
91
- </select>
92
- </p>
93
-
94
- <p>
95
- <label for="form_region">Region</label>
96
- <select name="form[region]" id="form_region">
97
- <option>Sweden</option>
98
- <option selected="selected">Norway</option>
99
- <option>Finland</option>
100
- </select>
101
- </p>
102
-
103
- <p>
104
- <label for="form_city">City</label>
105
- <select name="form[city]" id="form_city">
106
- <option>London</option>
107
- <option>Stockholm</option>
108
- <option>Paris</option>
109
- </select>
110
- </p>
111
-
112
- <p>
113
- <label for="form_tendency">Tendency</label>
114
- <select name="form[tendency]" id="form_tendency"></select>
115
- </p>
116
-
117
- <p>
118
- <label for="form_description">Description</label></br>
119
- <textarea name="form[description]" id="form_description">Descriptive text goes here</textarea>
120
- <p>
121
-
122
- <p>
123
- <input type="radio" name="form[gender]" value="male" id="gender_male"/>
124
- <label for="gender_male">Male</label>
125
- <input type="radio" name="form[gender]" value="female" id="gender_female" checked="checked"/>
126
- <label for="gender_female">Female</label>
127
- <input type="radio" name="form[gender]" value="both" id="gender_both"/>
128
- <label for="gender_both">Both</label>
129
- </p>
130
-
131
- <p>
132
- <input type="checkbox" value="dog" name="form[pets][]" id="form_pets_dog" checked="checked"/>
133
- <label for="form_pets_dog">Dog</label>
134
- <input type="checkbox" value="cat" name="form[pets][]" id="form_pets_cat"/>
135
- <label for="form_pets_cat">Cat</label>
136
- <input type="checkbox" value="hamster" name="form[pets][]" id="form_pets_hamster" checked="checked"/>
137
- <label for="form_pets_hamster">Hamster</label>
138
- </p>
139
-
140
- <p>
141
- <label for="form_languages">Languages</label>
142
- <select name="form[languages][]" id="form_languages" multiple="multiple">
143
- <option>Ruby</option>
144
- <option>SQL</option>
145
- <option>HTML</option>
146
- <option>Javascript</option>
147
- </select>
148
- </p>
149
-
150
- <p>
151
- <label for="form_underwear">Underwear</label>
152
- <select name="form[underwear][]" id="form_underwear" multiple="multiple">
153
- <option selected="selected">Boxer Briefs</option>
154
- <option>Boxers</option>
155
- <option selected="selected">Briefs</option>
156
- <option selected="selected">Commando</option>
157
- <option selected="selected">Frenchman's Pantalons</option>
158
- </select>
159
- </p>
160
-
161
- <div style="display:none;">
162
- <label for="form_first_name_hidden">
163
- Super Secret
164
- <input type="text" name="form[super_secret]" value="test123" id="form_super_secret"/>
165
- </label>
166
- </div>
167
-
168
- <p>
169
- <input type="button" name="form[fresh]" id="fresh_btn" value="i am fresh"/>
170
- <input type="submit" name="form[awesome]" id="awe123" value="awesome"/>
171
- <input type="submit" name="form[crappy]" id="crap321" value="crappy"/>
172
- <input type="image" name="form[okay]" id="okay556" value="okay" alt="oh hai thar"/>
173
- <button type="submit" id="click_me_123" value="click_me">Click me!</button>
174
- <button type="submit" name="form[no_value]">No Value!</button>
175
- </p>
176
- </form>
177
-
178
- <form action="/form/get?foo=bar" method="get">
179
- <p>
180
- <label for="form_middle_name">Middle Name</label>
181
- <input type="text" name="form[middle_name]" value="Darren" id="form_middle_name"/>
182
- </p>
183
-
184
- <p>
185
- <input type="submit" name="form[mediocre]" id="mediocre" value="med"/>
186
- <p>
187
- </form>
188
-
189
- <form action="/upload" method="post" enctype="multipart/form-data">
190
- <p>
191
- <label for="form_file_name">File Name</label>
192
- <input type="file" name="form[file_name]" id="form_file_name"/>
193
- </p>
194
-
195
- <p>
196
- <label for="form_document">Document</label>
197
- <input type="file" name="form[document]" id="form_document"/>
198
- </p>
199
-
200
- <p>
201
- <input type="submit" value="Upload"/>
202
- <p>
203
- </form>
204
-
205
- <form action="/redirect" method="post">
206
- <p>
207
- <input type="submit" value="Go FAR"/>
208
- </p>
209
- </form>
210
-
211
- <form action="/form" method="post">
212
- <p>
213
- <label for="html5_email">Html5 Email</label>
214
- <input type="email" name="form[html5_email]" value="person@email.com" id="html5_email"/>
215
- </p>
216
- <p>
217
- <label for="html5_url">Html5 Url</label>
218
- <input type="url" name="form[html5_url]" value="http://www.example.com" id="html5_url"/>
219
- </p>
220
- <p>
221
- <label for="html5_search">Html5 Search</label>
222
- <input type="search" name="form[html5_search]" value="what are you looking for" id="html5_search"/>
223
- </p>
224
- <p>
225
- <label for="html5_tel">Html5 Tel</label>
226
- <input type="tel" name="form[html5_tel]" value="911" id="html5_tel"/>
227
- </p>
228
- <p>
229
- <label for="html5_color">Html5 Color</label>
230
- <input type="color" name="form[html5_color]" value="#FFF" id="html5_color"/>
231
- </p>
232
-
233
- <p>
234
- <input type="submit" name="form[html5_submit]" value="html5_submit"/>
235
- </p>
236
- </form>
237
-
238
- <form action="/form" method="post">
239
- <p>
240
- <button type="submit" name="form[button]" value="button_first">Just an input that came first</button>
241
- <button type="submit" name="form[button]" value="button_second">Just an input</button>
242
- <input type="submit" name="form[button]" value="Just a button that came first"/>
243
- <input type="submit" name="form[button]" value="Just a button"/>
244
- </p>
245
- </form>
@@ -1,8 +0,0 @@
1
- <html>
2
- <head>
3
- <title>This is the title of frame one</title>
4
- </head>
5
- <body>
6
- <div id="divInFrameOne">This is the text of divInFrameOne</div>
7
- </body>
8
- </html>
@@ -1,8 +0,0 @@
1
- <html>
2
- <head>
3
- <title>This is the title of frame two</title>
4
- </head>
5
- <body>
6
- <div id="divInFrameTwo">This is the text of divInFrameTwo</div>
7
- </body>
8
- </html>
@@ -1,13 +0,0 @@
1
- <h1>Postback</h1>
2
-
3
- <form method="get">
4
- <p>
5
- <input type="submit" value="With no action">
6
- </p>
7
- </form>
8
-
9
- <form action="" method="get">
10
- <p>
11
- <input type="submit" value="With blank action">
12
- </p>
13
- </form>
@@ -1,122 +0,0 @@
1
- <form action="/form" method="post">
2
- <table id="agent_table">
3
- <caption>Agent</caption>
4
-
5
- <tr>
6
- <td>
7
- <label for="form_agent_name">Name</label>
8
- </td>
9
- <td>
10
- <input type="text" name="form[agent_name]" value="James" id="form_agent_name"/>
11
- </td>
12
- </tr>
13
-
14
- <tr>
15
- <td colspan="2">
16
- <input type="submit" value="Create"/>
17
- </td>
18
- </tr>
19
- </table>
20
- </form>
21
-
22
- <form action="/form" method="post">
23
- <table id="girl_table">
24
- <caption>Girl</caption>
25
-
26
- <tr>
27
- <td>
28
- <label for="form_girl_name">Name</label>
29
- </td>
30
- <td>
31
- <input type="text" name="form[girl_name]" value="Vesper" id="form_girl_name"/>
32
- </td>
33
- </tr>
34
-
35
- <tr>
36
- <td colspan="2">
37
- <input type="submit" value="Create"/>
38
- </td>
39
- </tr>
40
- </table>
41
- </form>
42
-
43
- <form action="/form" method="post">
44
- <table id="villain_table">
45
- <caption>Villain</caption>
46
-
47
- <tr>
48
- <td>
49
- <label for="form_villain_name">Name</label>
50
- </td>
51
- <td>
52
- <input type="text" name="form[villain_name]" value="Ernst" id="form_villain_name"/>
53
- </td>
54
- </tr>
55
-
56
- <tr>
57
- <td colspan="2">
58
- <input type="submit" value="Create"/>
59
- </td>
60
- </tr>
61
- </table>
62
- </form>
63
-
64
- <table>
65
- <caption>Ransom</caption>
66
-
67
- <thead>
68
- <tr>
69
- <th>Year</th>
70
- <th>Governmental</th>
71
- <th>Private</th>
72
- </tr>
73
- </thead>
74
-
75
- <tbody>
76
- <tr>
77
- <th scope="row">2007</th>
78
- <td>$300</td>
79
- <td>$100</td>
80
- </tr>
81
- <tr>
82
- <th scope="row">2008</th>
83
- <td>$123</td>
84
- <td>$897</td>
85
- </tr>
86
- <tr>
87
- <th scope="row">2009</th>
88
- <td>$543</td>
89
- <td>$99</td>
90
- </tr>
91
- </tbody>
92
- </table>
93
-
94
- <table>
95
- <caption>Deaths</caption>
96
-
97
- <thead>
98
- <tr>
99
- <th>Year</th>
100
- <th>Sharks with lasers</th>
101
- <th>Flaming volcano</th>
102
- </tr>
103
- </thead>
104
-
105
- <tbody>
106
- <tr>
107
- <th scope="row">2007</th>
108
- <td>66</td>
109
- <td>7</td>
110
- </tr>
111
- <tr>
112
- <th scope="row">2008</th>
113
- <td>123</td>
114
- <td>12</td>
115
- </tr>
116
- <tr>
117
- <th scope="row">2009</th>
118
- <td>913</td>
119
- <td>13</td>
120
- </tr>
121
- </tbody>
122
- </table>
@@ -1,43 +0,0 @@
1
- <h1>This is a test</h1>
2
-
3
- <p id="first">
4
- Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod
5
- tempor incididunt ut <a href="/with_simple_html" title="awesome title" class="simple">labore</a>
6
- et dolore magna aliqua. Ut enim ad minim veniam,
7
- quis nostrud exercitation <a href="/foo" id="foo">ullamco</a> laboris nisi
8
- ut aliquip ex ea commodo consequat.
9
- <a href="/with_simple_html"><img src="http://www.foobar.sun/dummy_image.jpg" width="20" height="20" alt="awesome image" /></a>
10
- </p>
11
-
12
- <p id="second">
13
- Duis aute irure dolor in reprehenderit in voluptate velit esse cillum
14
- dolore eu fugiat <a href="/redirect" id="red">Redirect</a> pariatur. Excepteur sint occaecat cupidatat non proident,
15
- sunt in culpa qui officia
16
- text with
17
- whitespace
18
- id est laborum.
19
- </p>
20
-
21
- <p>
22
- <input type="text" id="test_field" value="monkey"/>
23
- <textarea>banana</textarea>
24
- <a href="/redirect_back">BackToMyself</a>
25
- <a title="twas a fine link" href="/redirect">A link came first</a>
26
- <a title="a fine link" href="/with_simple_html">A link</a>
27
- <a title="a fine link with data method" data-method="delete" href="/delete">A link with data-method</a>
28
- <a>No Href</a>
29
- <a href="">Blank Href</a>
30
- <a href="#">Blank Anchor</a>
31
- <a href="#anchor">Anchor</a>
32
- <a href="/with_simple_html#anchor">Anchor on different page</a>
33
- <a href="/with_html#anchor">Anchor on same page</a>
34
- <input type="text" value="" id="test_field">
35
- <input type="text" checked="checked" id="checked_field">
36
- <a href="/redirect"><img src="http://www.foobar.sun/dummy_image.jpg" width="20" height="20" alt="very fine image" /></a>
37
- <a href="/with_simple_html"><img src="http://www.foobar.sun/dummy_image.jpg" width="20" height="20" alt="fine image" /></a>
38
- </p>
39
-
40
- <div id="hidden" style="display: none;">
41
- <div id="hidden_via_ancestor">Inside element with hidden ancestor</div>
42
- <a href="/with_simple_html" title="awesome title" class="simple">hidden link</a>
43
- </div>
@@ -1,39 +0,0 @@
1
- <html xmlns="http://www.w3.org/1999/xhtml" lang="en">
2
- <head>
3
- <meta http-equiv="Content-type" content="text/html; charset=utf-8"/>
4
- <title>with_js</title>
5
- <script src="/jquery.js" type="text/javascript" charset="utf-8"></script>
6
- <script src="/jquery-ui.js" type="text/javascript" charset="utf-8"></script>
7
- <script src="/test.js" type="text/javascript" charset="utf-8"></script>
8
- </head>
9
-
10
- <body id="with_js">
11
- <h1>FooBar</h1>
12
-
13
- <p id="change">This is text</p>
14
- <div id="drag">
15
- <p>This is a draggable element.</p>
16
- </div>
17
- <div id="drop">
18
- <p>It should be dropped here.</p>
19
- </div>
20
-
21
- <p><a href="#" id="clickable">Click me</a></p>
22
-
23
- <p>
24
- <select id="waiter">
25
- <option>Foo</option>
26
- <option>My Waiting Option</option>
27
- </select>
28
- </p>
29
-
30
- <p>
31
- <input type="text" name="with_focus_event" value="" id="with_focus_event"/>
32
- </p>
33
-
34
- <p>
35
- <input type="checkbox" id="checkbox_with_event"/>
36
- </p>
37
- </body>
38
- </html>
39
-
@@ -1,36 +0,0 @@
1
- <h1>This page is used for testing various scopes</h1>
2
-
3
- <p id="for_foo">
4
- Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor
5
- incididunt ut labore et dolore magna aliqua. Ut enim ad minim venia.
6
- <a href="/redirect">Go</a>
7
- </p>
8
-
9
- <div id="for_bar">
10
- <ul>
11
- <li>With Simple HTML: <a href="/with_simple_html">Go</a>
12
- <form action="/redirect" method="post" accept-charset="utf-8">
13
- <p>
14
- <label for="simple_first_name">First Name</label>
15
- <input type="text" name="first_name" value="John" id="simple_first_name"/>
16
- </p>
17
- <p><input type="submit" value="Go"/></p>
18
- </form>
19
- </li>
20
- <li>Bar: <a href="/foo">Go</a>
21
- <form action="/form" method="post" accept-charset="utf-8">
22
- <p>
23
- <label for="bar_first_name">First Name</label>
24
- <input type="text" name="form[first_name]" value="Peter" id="bar_first_name"/>
25
- </p>
26
- <p><input type="submit" value="Go"/></p>
27
- </form>
28
- </li>
29
- </ul>
30
- </div>
31
-
32
- <div id="another_foo">
33
- <ul>
34
- <li>With Simple HTML: <a href="/">Go</a>
35
- </ul>
36
- </div>
@@ -1 +0,0 @@
1
- Bar
@@ -1,10 +0,0 @@
1
- <html>
2
- <head>
3
- <title>With Frames</title>
4
- </head>
5
- <body>
6
- <div id="divInMainWindow">This is the text for divInMainWindow</div>
7
- <iframe src="/frame_one" id="frameOne"></iframe>
8
- <iframe src="/frame_two" id="frameTwo"></iframe>
9
- </body>
10
- </html>