capybara 3.35.0 → 3.40.0
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.
- checksums.yaml +4 -4
- data/History.md +168 -5
- data/README.md +199 -39
- data/lib/capybara/config.rb +16 -4
- data/lib/capybara/driver/base.rb +4 -0
- data/lib/capybara/driver/node.rb +5 -1
- data/lib/capybara/dsl.rb +4 -10
- data/lib/capybara/helpers.rb +9 -14
- data/lib/capybara/minitest/spec.rb +18 -6
- data/lib/capybara/minitest.rb +14 -1
- data/lib/capybara/node/actions.rb +14 -9
- data/lib/capybara/node/base.rb +2 -1
- data/lib/capybara/node/document.rb +2 -2
- data/lib/capybara/node/element.rb +13 -2
- data/lib/capybara/node/finders.rb +11 -2
- data/lib/capybara/node/matchers.rb +25 -0
- data/lib/capybara/node/simple.rb +5 -1
- data/lib/capybara/node/whitespace_normalizer.rb +81 -0
- data/lib/capybara/queries/active_element_query.rb +18 -0
- data/lib/capybara/queries/ancestor_query.rb +2 -1
- data/lib/capybara/queries/base_query.rb +2 -2
- data/lib/capybara/queries/current_path_query.rb +1 -1
- data/lib/capybara/queries/selector_query.rb +40 -11
- data/lib/capybara/queries/sibling_query.rb +2 -1
- data/lib/capybara/queries/text_query.rb +1 -1
- data/lib/capybara/rack_test/browser.rb +64 -8
- data/lib/capybara/rack_test/driver.rb +4 -4
- data/lib/capybara/rack_test/form.rb +29 -7
- data/lib/capybara/rack_test/node.rb +32 -33
- data/lib/capybara/registration_container.rb +2 -5
- data/lib/capybara/registrations/drivers.rb +7 -7
- data/lib/capybara/registrations/servers.rb +37 -16
- data/lib/capybara/result.rb +2 -2
- data/lib/capybara/rspec/matcher_proxies.rb +6 -6
- data/lib/capybara/rspec/matchers/base.rb +8 -6
- data/lib/capybara/rspec/matchers/compound.rb +1 -1
- data/lib/capybara/rspec/matchers/have_selector.rb +9 -17
- data/lib/capybara/rspec/matchers.rb +21 -16
- data/lib/capybara/selector/builders/css_builder.rb +1 -1
- data/lib/capybara/selector/builders/xpath_builder.rb +1 -1
- data/lib/capybara/selector/css.rb +6 -6
- data/lib/capybara/selector/definition/button.rb +10 -5
- data/lib/capybara/selector/definition/checkbox.rb +1 -1
- data/lib/capybara/selector/definition/file_field.rb +1 -1
- data/lib/capybara/selector/definition/fillable_field.rb +1 -1
- data/lib/capybara/selector/definition/link.rb +2 -1
- data/lib/capybara/selector/definition/radio_button.rb +1 -1
- data/lib/capybara/selector/definition/table.rb +1 -1
- data/lib/capybara/selector/definition/table_row.rb +2 -2
- data/lib/capybara/selector/definition.rb +4 -2
- data/lib/capybara/selector/filter_set.rb +4 -7
- data/lib/capybara/selector/regexp_disassembler.rb +2 -5
- data/lib/capybara/selector/selector.rb +5 -1
- data/lib/capybara/selector.rb +252 -0
- data/lib/capybara/selenium/driver.rb +31 -54
- data/lib/capybara/selenium/driver_specializations/chrome_driver.rb +1 -1
- data/lib/capybara/selenium/driver_specializations/edge_driver.rb +9 -5
- data/lib/capybara/selenium/driver_specializations/firefox_driver.rb +2 -7
- data/lib/capybara/selenium/extensions/html5_drag.rb +5 -4
- data/lib/capybara/selenium/node.rb +60 -38
- data/lib/capybara/selenium/nodes/chrome_node.rb +4 -16
- data/lib/capybara/selenium/nodes/edge_node.rb +19 -13
- data/lib/capybara/selenium/nodes/firefox_node.rb +3 -3
- data/lib/capybara/selenium/nodes/safari_node.rb +4 -4
- data/lib/capybara/selenium/patches/atoms.rb +1 -1
- data/lib/capybara/selenium/patches/pause_duration_fix.rb +1 -1
- data/lib/capybara/server/animation_disabler.rb +40 -23
- data/lib/capybara/server/middleware.rb +1 -1
- data/lib/capybara/server.rb +1 -1
- data/lib/capybara/session/config.rb +4 -2
- data/lib/capybara/session.rb +34 -34
- data/lib/capybara/spec/public/test.js +4 -0
- data/lib/capybara/spec/session/active_element_spec.rb +31 -0
- data/lib/capybara/spec/session/all_spec.rb +11 -15
- data/lib/capybara/spec/session/assert_text_spec.rb +17 -17
- data/lib/capybara/spec/session/attach_file_spec.rb +6 -0
- data/lib/capybara/spec/session/check_spec.rb +10 -0
- data/lib/capybara/spec/session/choose_spec.rb +6 -0
- data/lib/capybara/spec/session/click_link_or_button_spec.rb +9 -0
- data/lib/capybara/spec/session/click_link_spec.rb +12 -1
- data/lib/capybara/spec/session/current_scope_spec.rb +1 -1
- data/lib/capybara/spec/session/fill_in_spec.rb +6 -0
- data/lib/capybara/spec/session/find_link_spec.rb +10 -0
- data/lib/capybara/spec/session/find_spec.rb +15 -1
- data/lib/capybara/spec/session/first_spec.rb +1 -1
- data/lib/capybara/spec/session/frame/within_frame_spec.rb +2 -0
- data/lib/capybara/spec/session/has_all_selectors_spec.rb +5 -5
- data/lib/capybara/spec/session/has_ancestor_spec.rb +2 -2
- data/lib/capybara/spec/session/has_any_selectors_spec.rb +6 -2
- data/lib/capybara/spec/session/has_button_spec.rb +30 -0
- data/lib/capybara/spec/session/has_current_path_spec.rb +3 -3
- data/lib/capybara/spec/session/has_element_spec.rb +47 -0
- data/lib/capybara/spec/session/has_field_spec.rb +25 -1
- data/lib/capybara/spec/session/has_link_spec.rb +40 -0
- data/lib/capybara/spec/session/has_none_selectors_spec.rb +7 -7
- data/lib/capybara/spec/session/has_select_spec.rb +10 -4
- data/lib/capybara/spec/session/has_selector_spec.rb +15 -0
- data/lib/capybara/spec/session/has_table_spec.rb +13 -2
- data/lib/capybara/spec/session/has_text_spec.rb +6 -14
- data/lib/capybara/spec/session/matches_style_spec.rb +2 -0
- data/lib/capybara/spec/session/node_spec.rb +88 -1
- data/lib/capybara/spec/session/node_wrapper_spec.rb +1 -1
- data/lib/capybara/spec/session/reset_session_spec.rb +13 -0
- data/lib/capybara/spec/session/scroll_spec.rb +7 -5
- data/lib/capybara/spec/session/uncheck_spec.rb +1 -1
- data/lib/capybara/spec/session/visit_spec.rb +20 -0
- data/lib/capybara/spec/session/window/window_spec.rb +1 -1
- data/lib/capybara/spec/session/window/windows_spec.rb +1 -1
- data/lib/capybara/spec/session/within_spec.rb +13 -0
- data/lib/capybara/spec/spec_helper.rb +12 -5
- data/lib/capybara/spec/test_app.rb +91 -14
- data/lib/capybara/spec/views/animated.erb +1 -1
- data/lib/capybara/spec/views/form.erb +34 -4
- data/lib/capybara/spec/views/frame_child.erb +1 -1
- data/lib/capybara/spec/views/frame_one.erb +1 -1
- data/lib/capybara/spec/views/frame_parent.erb +1 -1
- data/lib/capybara/spec/views/frame_two.erb +1 -1
- data/lib/capybara/spec/views/initial_alert.erb +2 -1
- data/lib/capybara/spec/views/layout.erb +10 -0
- data/lib/capybara/spec/views/obscured.erb +1 -1
- data/lib/capybara/spec/views/offset.erb +2 -1
- data/lib/capybara/spec/views/path.erb +2 -2
- data/lib/capybara/spec/views/popup_one.erb +1 -1
- data/lib/capybara/spec/views/popup_two.erb +1 -1
- data/lib/capybara/spec/views/react.erb +2 -2
- data/lib/capybara/spec/views/scroll.erb +2 -1
- data/lib/capybara/spec/views/spatial.erb +1 -1
- data/lib/capybara/spec/views/with_animation.erb +2 -3
- data/lib/capybara/spec/views/with_base_tag.erb +2 -2
- data/lib/capybara/spec/views/with_dragula.erb +2 -2
- data/lib/capybara/spec/views/with_fixed_header_footer.erb +2 -1
- data/lib/capybara/spec/views/with_hover.erb +2 -2
- data/lib/capybara/spec/views/with_html.erb +5 -3
- data/lib/capybara/spec/views/with_jquery_animation.erb +1 -1
- data/lib/capybara/spec/views/with_js.erb +2 -3
- data/lib/capybara/spec/views/with_jstree.erb +1 -1
- data/lib/capybara/spec/views/with_namespace.erb +1 -0
- data/lib/capybara/spec/views/with_scope.erb +2 -2
- data/lib/capybara/spec/views/with_shadow.erb +31 -0
- data/lib/capybara/spec/views/with_slow_unload.erb +2 -1
- data/lib/capybara/spec/views/with_sortable_js.erb +2 -2
- data/lib/capybara/spec/views/with_unload_alert.erb +1 -0
- data/lib/capybara/spec/views/with_windows.erb +1 -1
- data/lib/capybara/spec/views/within_frames.erb +1 -1
- data/lib/capybara/version.rb +1 -1
- data/lib/capybara/window.rb +1 -1
- data/lib/capybara.rb +30 -30
- data/spec/basic_node_spec.rb +16 -3
- data/spec/capybara_spec.rb +12 -0
- data/spec/counter_spec.rb +35 -0
- data/spec/css_builder_spec.rb +1 -1
- data/spec/css_splitter_spec.rb +1 -1
- data/spec/dsl_spec.rb +5 -3
- data/spec/fixtures/selenium_driver_rspec_failure.rb +2 -2
- data/spec/fixtures/selenium_driver_rspec_success.rb +2 -2
- data/spec/minitest_spec.rb +12 -1
- data/spec/minitest_spec_spec.rb +4 -0
- data/spec/per_session_config_spec.rb +1 -1
- data/spec/rack_test_spec.rb +30 -12
- data/spec/result_spec.rb +41 -35
- data/spec/rspec/features_spec.rb +3 -3
- data/spec/rspec/scenarios_spec.rb +2 -2
- data/spec/rspec/shared_spec_matchers.rb +27 -3
- data/spec/rspec_matchers_spec.rb +25 -0
- data/spec/rspec_spec.rb +3 -3
- data/spec/sauce_spec_chrome.rb +5 -5
- data/spec/selector_spec.rb +4 -4
- data/spec/selenium_spec_chrome.rb +20 -18
- data/spec/selenium_spec_chrome_remote.rb +15 -19
- data/spec/selenium_spec_edge.rb +19 -6
- data/spec/selenium_spec_firefox.rb +26 -8
- data/spec/selenium_spec_firefox_remote.rb +18 -4
- data/spec/selenium_spec_ie.rb +7 -8
- data/spec/selenium_spec_safari.rb +34 -20
- data/spec/server_spec.rb +19 -7
- data/spec/shared_selenium_node.rb +0 -4
- data/spec/shared_selenium_session.rb +22 -14
- data/spec/spec_helper.rb +36 -3
- data/spec/whitespace_normalizer_spec.rb +54 -0
- data/spec/xpath_builder_spec.rb +1 -1
- metadata +49 -30
- data/lib/capybara/selenium/logger_suppressor.rb +0 -34
- data/lib/capybara/selenium/patches/action_pauser.rb +0 -26
- data/lib/capybara/spec/views/with_title.erb +0 -5
@@ -201,4 +201,24 @@ Capybara::SpecHelper.spec '#visit' do
|
|
201
201
|
@session.visit('/get_cookie')
|
202
202
|
expect(@session).to have_content('root cookie')
|
203
203
|
end
|
204
|
+
|
205
|
+
context 'with base element' do
|
206
|
+
it 'should use base href with relative links' do
|
207
|
+
@session.visit('/base/with_base')
|
208
|
+
@session.click_link('Title page')
|
209
|
+
expect(@session).to have_current_path('/with_title')
|
210
|
+
end
|
211
|
+
|
212
|
+
it 'should use base href with bare queries' do
|
213
|
+
@session.visit('/base/with_base')
|
214
|
+
@session.click_link('Bare query')
|
215
|
+
expect(@session).to have_current_path('/?a=3')
|
216
|
+
end
|
217
|
+
|
218
|
+
it 'should not use the base href with a new visit call' do
|
219
|
+
@session.visit('/base/with_other_base')
|
220
|
+
@session.visit('with_html')
|
221
|
+
expect(@session).to have_current_path('/with_html')
|
222
|
+
end
|
223
|
+
end
|
204
224
|
end
|
@@ -59,7 +59,7 @@ Capybara::SpecHelper.spec Capybara::Window, requires: [:windows] do
|
|
59
59
|
it 'should return false if window is closed' do
|
60
60
|
@session.switch_to_window(other_window)
|
61
61
|
other_window.close
|
62
|
-
expect(other_window.current?).to
|
62
|
+
expect(other_window.current?).to be(false)
|
63
63
|
end
|
64
64
|
end
|
65
65
|
|
@@ -29,6 +29,6 @@ Capybara::SpecHelper.spec '#windows', requires: [:windows] do
|
|
29
29
|
titles = @session.windows.map do |window|
|
30
30
|
@session.within_window(window) { @session.title }
|
31
31
|
end
|
32
|
-
expect(titles).to match_array(['With Windows', 'Title of the first popup', 'Title of popup two'])
|
32
|
+
expect(titles).to match_array(['With Windows', 'Title of the first popup', 'Title of popup two']) # rubocop:disable RSpec/MatchArray
|
33
33
|
end
|
34
34
|
end
|
@@ -49,6 +49,19 @@ Capybara::SpecHelper.spec '#within' do
|
|
49
49
|
expect { @session.text }.to raise_error(StandardError)
|
50
50
|
end
|
51
51
|
end
|
52
|
+
|
53
|
+
it 'should pass scope element to the block' do
|
54
|
+
@session.within(:css, '#another_foo') do |scope|
|
55
|
+
expect(scope).to match_css('#another_foo')
|
56
|
+
end
|
57
|
+
end
|
58
|
+
|
59
|
+
it 'should scope click', requires: [:js] do
|
60
|
+
@session.within(:css, '#another_foo') do |scope|
|
61
|
+
@session.click
|
62
|
+
expect(scope).to have_text('I was clicked')
|
63
|
+
end
|
64
|
+
end
|
52
65
|
end
|
53
66
|
|
54
67
|
context 'with XPath selector' do
|
@@ -24,6 +24,7 @@ module Capybara
|
|
24
24
|
Capybara.app_host = nil
|
25
25
|
Capybara.default_selector = :xpath
|
26
26
|
Capybara.default_max_wait_time = 1
|
27
|
+
Capybara.default_retry_interval = 0.01
|
27
28
|
Capybara.ignore_hidden_elements = true
|
28
29
|
Capybara.exact = false
|
29
30
|
Capybara.raise_server_errors = true
|
@@ -36,8 +37,8 @@ module Capybara
|
|
36
37
|
Capybara.test_id = nil
|
37
38
|
Capybara.predicates_wait = true
|
38
39
|
Capybara.default_normalize_ws = false
|
39
|
-
Capybara.
|
40
|
-
Capybara.w3c_click_offset =
|
40
|
+
Capybara.use_html5_parsing = !ENV['HTML5_PARSING'].nil?
|
41
|
+
Capybara.w3c_click_offset = true
|
41
42
|
reset_threadsafe
|
42
43
|
end
|
43
44
|
|
@@ -71,7 +72,7 @@ module Capybara
|
|
71
72
|
session.reset_session!
|
72
73
|
end
|
73
74
|
|
74
|
-
before :each, psc
|
75
|
+
before :each, :psc do
|
75
76
|
SpecHelper.reset_threadsafe(bool: true, session: session)
|
76
77
|
end
|
77
78
|
|
@@ -117,8 +118,14 @@ module Capybara
|
|
117
118
|
|
118
119
|
def extract_results(session)
|
119
120
|
expect(session).to have_xpath("//pre[@id='results']")
|
120
|
-
|
121
|
-
|
121
|
+
perms = [(::Sinatra::IndifferentHash if defined? ::Sinatra::IndifferentHash)].compact
|
122
|
+
results = Capybara::HTML(session.body).xpath("//pre[@id='results']").first.inner_html.lstrip
|
123
|
+
YAML.safe_load results, permitted_classes: perms
|
124
|
+
end
|
125
|
+
|
126
|
+
def extract_content_type(session)
|
127
|
+
expect(session).to have_xpath("//pre[@id='content_type']")
|
128
|
+
Capybara::HTML(session.body).xpath("//pre[@id='content_type']").first.text
|
122
129
|
end
|
123
130
|
|
124
131
|
def be_an_invalid_element_error(session)
|
@@ -53,8 +53,8 @@ class TestApp < Sinatra::Base
|
|
53
53
|
|
54
54
|
get '/referer_base' do
|
55
55
|
'<a href="/get_referer">direct link</a>' \
|
56
|
-
|
57
|
-
|
56
|
+
'<a href="/redirect_to_get_referer">link via redirect</a>' \
|
57
|
+
'<form action="/get_referer" method="get"><input type="submit"></form>'
|
58
58
|
end
|
59
59
|
|
60
60
|
get '/redirect_to_get_referer' do
|
@@ -163,31 +163,112 @@ class TestApp < Sinatra::Base
|
|
163
163
|
|
164
164
|
get '/with_title' do
|
165
165
|
<<-HTML
|
166
|
-
|
167
|
-
<
|
168
|
-
<
|
169
|
-
|
166
|
+
<!DOCTYPE html>
|
167
|
+
<html lang="en">
|
168
|
+
<head>
|
169
|
+
<meta http-equiv="Content-type" content="text/html; charset=utf-8"/>
|
170
|
+
<title>#{params[:title] || 'Test Title'}</title>
|
171
|
+
</head>
|
172
|
+
|
173
|
+
<body>
|
174
|
+
<svg><title>abcdefg</title></svg>
|
175
|
+
</body>
|
176
|
+
</html>
|
177
|
+
HTML
|
178
|
+
end
|
179
|
+
|
180
|
+
get '/with_iframe' do
|
181
|
+
<<-HTML
|
182
|
+
<!DOCTYPE html>
|
183
|
+
<html lang="en">
|
184
|
+
<head>
|
185
|
+
<meta http-equiv="Content-type" content="text/html; charset=utf-8"/>
|
186
|
+
<title>Test with Iframe</title>
|
187
|
+
</head>
|
188
|
+
|
189
|
+
<body>
|
190
|
+
<iframe src="#{params[:url]}" id="#{params[:id]}"></iframe>
|
191
|
+
</body>
|
192
|
+
</html>
|
193
|
+
HTML
|
194
|
+
end
|
195
|
+
|
196
|
+
get '/base/with_base' do
|
197
|
+
<<-HTML
|
198
|
+
<!DOCTYPE html>
|
199
|
+
<html>
|
200
|
+
<head>
|
201
|
+
<base href="/">
|
202
|
+
<title>Origin</title>
|
203
|
+
</head>
|
204
|
+
<body>
|
205
|
+
<a href="with_title">Title page</a>
|
206
|
+
<a href="?a=3">Bare query</a>
|
207
|
+
</body>
|
208
|
+
</html>
|
209
|
+
HTML
|
210
|
+
end
|
211
|
+
|
212
|
+
get '/base/with_other_base' do
|
213
|
+
<<-HTML
|
214
|
+
<!DOCTYPE html>
|
215
|
+
<html>
|
216
|
+
<head>
|
217
|
+
<base href="/base/">
|
218
|
+
<title>Origin</title>
|
219
|
+
</head>
|
220
|
+
<body>
|
221
|
+
<a href="with_title">Title page</a>
|
222
|
+
<a href="?a=3">Bare query</a>
|
223
|
+
</body>
|
224
|
+
</html>
|
225
|
+
HTML
|
226
|
+
end
|
227
|
+
|
228
|
+
get '/csp' do
|
229
|
+
response.headers['Content-Security-Policy'] = "default-src 'none'; connect-src 'self'; base-uri 'none'; font-src 'self'; img-src 'self' data:; object-src 'none'; script-src 'self' 'nonce-jAviMuMisoTisVXjgLoWdA=='; style-src 'self' 'nonce-jAviMuMisoTisVXjgLoWdA=='; form-action 'self';"
|
230
|
+
<<-HTML
|
231
|
+
<!DOCTYPE html>
|
232
|
+
<html lang="en">
|
233
|
+
<head>
|
234
|
+
<meta http-equiv="Content-type" content="text/html; charset=utf-8"/>
|
235
|
+
<title>CSP</title>
|
236
|
+
</head>
|
237
|
+
|
238
|
+
<body>
|
239
|
+
<div>CSP</div>
|
240
|
+
</body>
|
241
|
+
</html>
|
170
242
|
HTML
|
171
243
|
end
|
172
244
|
|
173
245
|
get '/download.csv' do
|
174
246
|
content_type 'text/csv'
|
175
247
|
'This, is, comma, separated' \
|
176
|
-
|
248
|
+
'Thomas, Walpole, was , here'
|
249
|
+
end
|
250
|
+
|
251
|
+
get %r{/apple-touch-.*\.png/} do
|
252
|
+
halt(404)
|
177
253
|
end
|
178
254
|
|
179
255
|
get '/:view' do |view|
|
180
|
-
|
256
|
+
view_template = "#{__dir__}/views/#{view}.erb"
|
257
|
+
has_layout = File.exist?(view_template) && File.open(view_template) { |f| f.first.downcase.include?('doctype') }
|
258
|
+
erb view.to_sym, locals: { referrer: request.referrer }, layout: !has_layout
|
181
259
|
end
|
182
260
|
|
183
261
|
post '/form' do
|
184
262
|
self.class.form_post_count += 1
|
185
|
-
%(
|
263
|
+
%(
|
264
|
+
<pre id="content_type">#{request.content_type}</pre>
|
265
|
+
<pre id="results">#{params.fetch(:form, {}).merge('post_count' => self.class.form_post_count).to_yaml}</pre>
|
266
|
+
)
|
186
267
|
end
|
187
268
|
|
188
269
|
post '/upload_empty' do
|
189
270
|
if params[:form][:file].nil?
|
190
|
-
|
271
|
+
"Successfully ignored empty file field. Content type was #{request.content_type}"
|
191
272
|
else
|
192
273
|
'Something went wrong.'
|
193
274
|
end
|
@@ -214,10 +295,6 @@ class TestApp < Sinatra::Base
|
|
214
295
|
'No files uploaded'
|
215
296
|
end
|
216
297
|
|
217
|
-
get '/apple-touch-icon-precomposed.png' do
|
218
|
-
halt(404)
|
219
|
-
end
|
220
|
-
|
221
298
|
class << self
|
222
299
|
attr_accessor :form_post_count
|
223
300
|
end
|
@@ -1,11 +1,17 @@
|
|
1
|
-
|
2
1
|
<h1>Form</h1>
|
3
2
|
|
3
|
+
<button type="button" tabindex="1">A Button</button>
|
4
|
+
|
5
|
+
<label>
|
6
|
+
An Input
|
7
|
+
<input type="text" tabindex="2">
|
8
|
+
</label>
|
9
|
+
|
4
10
|
<form action="/form" method="post" novalidate>
|
5
11
|
|
6
12
|
<p>
|
7
13
|
<label for="form_title">Title</label>
|
8
|
-
<select name="form[title]" id="form_title" class="title">
|
14
|
+
<select name="form[title]" id="form_title" class="title" tabindex="3">
|
9
15
|
<option class="title">Mrs</option>
|
10
16
|
<option class="title">Mr</option>
|
11
17
|
<option>Miss</option>
|
@@ -170,7 +176,7 @@ New line after and before textarea tag
|
|
170
176
|
<label for="gender_male">Male</label>
|
171
177
|
<input type="radio" name="form[gender]" value="female" id="gender_female" checked="checked"/>
|
172
178
|
<label for="gender_female">Female</label>
|
173
|
-
<input type="radio" name="form[gender]" value="both" id="gender_both"/>
|
179
|
+
<input type="radio" name="form[gender]" value="both" id="gender_both" readonly="readonly"/>
|
174
180
|
<label for="gender_both">Both</label>
|
175
181
|
</p>
|
176
182
|
|
@@ -223,6 +229,8 @@ New line after and before textarea tag
|
|
223
229
|
</label>
|
224
230
|
<input type="checkbox" value="maserati" name="form[cars][]" id="form_cars_maserati" disabled="disabled"/>
|
225
231
|
<label for="form_cars_maserati">Maserati</label>
|
232
|
+
<input type="checkbox" value="lotus" name="form[cars][]" id="form_cars_lotus" style="display: none"/>
|
233
|
+
<label for="form_cars_lotus"><a href="#" onclick="return false;">Link here</a>Lotus</label>
|
226
234
|
</p>
|
227
235
|
|
228
236
|
<p>
|
@@ -449,7 +457,7 @@ New line after and before textarea tag
|
|
449
457
|
|
450
458
|
<p>
|
451
459
|
<input type="button" aria-label="Aria button" name="form[fresh]" id="fresh_btn" value="i am fresh"/>
|
452
|
-
<input type="submit" name="form[awesome]" id="awe123" title="What an Awesome Button" value="awesome"/>
|
460
|
+
<input type="submit" name="form[awesome]" id="awe123" data-test-id="test_id_button" title="What an Awesome Button" value="awesome"/>
|
453
461
|
<input type="submit" name="form[crappy]" id="crap321" value="crappy"/>
|
454
462
|
<input type="image" name="form[okay]" id="okay556" title="Okay 556 Image" value="okay" alt="oh hai thar"/>
|
455
463
|
<button type="submit" id="click_me_123" title="Click Title button" value="click_me">Click me!</button>
|
@@ -578,6 +586,19 @@ New line after and before textarea tag
|
|
578
586
|
<p>
|
579
587
|
</form>
|
580
588
|
|
589
|
+
<form action="/form" method="post" enctype="multipart/form-data">
|
590
|
+
<input type="hidden" name="form[document2]" value="hidden_field"/>
|
591
|
+
|
592
|
+
<p>
|
593
|
+
<label for="form_document">Document with hidden</label>
|
594
|
+
<input type="file" name="form[document2]" id="form_document2"/>
|
595
|
+
</p>
|
596
|
+
|
597
|
+
<p>
|
598
|
+
<input type="submit" value="Upload Empty With Hidden"/>
|
599
|
+
<p>
|
600
|
+
</form>
|
601
|
+
|
581
602
|
<form action="/upload_multiple" method="post" enctype="multipart/form-data">
|
582
603
|
<p>
|
583
604
|
<label for="form_multiple_file_name">File Name</label>
|
@@ -674,6 +695,15 @@ New line after and before textarea tag
|
|
674
695
|
</p>
|
675
696
|
</form>
|
676
697
|
|
698
|
+
<form id="single_input_form" action="/form" method="post">
|
699
|
+
<input type="text" name="form[single_input]" id="single_input"/>
|
700
|
+
</form>
|
701
|
+
|
702
|
+
<form id="two_input_form" action="/form" method="post">
|
703
|
+
<input type="text" name="form[two_input_1]" id="two_input_1"/>
|
704
|
+
<input type="text" name="form[two_input_2]" id="two_input_2"/>
|
705
|
+
</form>
|
706
|
+
|
677
707
|
<label>Confusion
|
678
708
|
<input type="checkbox" id="confusion_checkbox" class="confusion-checkbox confusion"/>
|
679
709
|
</label>
|
@@ -19,7 +19,7 @@
|
|
19
19
|
|
20
20
|
<p class="para" id="first" data-random="abc\def" style="line-height: 25px;">
|
21
21
|
Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod
|
22
|
-
tempor incididunt ut <a href="/with_simple_html" title="awesome title" class="simple">labore</a>
|
22
|
+
tempor incididunt ut <a href="/with_simple_html" title="awesome title" class="simple" tabindex="1" target="_self">labore</a>
|
23
23
|
et dolore magna aliqua. Ut enim ad minim veniam,
|
24
24
|
quis nostrud exercitation <a href="/foo" id="foo" data-test-id="test-foo">ullamco</a> laboris nisi
|
25
25
|
ut aliquip ex ea commodo consequat.
|
@@ -88,7 +88,7 @@ banana</textarea>
|
|
88
88
|
</div>
|
89
89
|
|
90
90
|
<div style="display: none;">
|
91
|
-
<a id="
|
91
|
+
<a id="first_invisible" class="hidden">first hidden link</a>
|
92
92
|
</div>
|
93
93
|
|
94
94
|
<div style="display: none;">
|
@@ -138,7 +138,7 @@ banana</textarea>
|
|
138
138
|
Ancestor
|
139
139
|
<div id="child">Child</div>
|
140
140
|
</div>
|
141
|
-
<div id="
|
141
|
+
<div id="ancestor1_sibling">
|
142
142
|
ASibling
|
143
143
|
</div>
|
144
144
|
</div>
|
@@ -200,6 +200,8 @@ banana</textarea>
|
|
200
200
|
</div>
|
201
201
|
</details>
|
202
202
|
|
203
|
+
<div style='height: 1000px'>spacer</div>
|
204
|
+
|
203
205
|
<template id="template">
|
204
206
|
<input />
|
205
207
|
</template>
|
@@ -1,5 +1,5 @@
|
|
1
|
-
|
2
|
-
<html
|
1
|
+
<!DOCTYPE html>
|
2
|
+
<html lang="en">
|
3
3
|
<head>
|
4
4
|
<meta http-equiv="Content-type" content="text/html; charset=utf-8"/>
|
5
5
|
<title>with_js</title>
|
@@ -160,4 +160,3 @@
|
|
160
160
|
</script>
|
161
161
|
</body>
|
162
162
|
</html>
|
163
|
-
|
@@ -0,0 +1,31 @@
|
|
1
|
+
<!DOCTYPE html>
|
2
|
+
<%# Borrowed from Titus Fortner %>
|
3
|
+
<html>
|
4
|
+
<head>
|
5
|
+
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
6
|
+
<title>Shadow DOM</title>
|
7
|
+
</head>
|
8
|
+
<body>
|
9
|
+
<div id="no_host"></div>
|
10
|
+
<div id="shadow_host"></div>
|
11
|
+
<a href="scroll.html">scroll.html</a>
|
12
|
+
<script>
|
13
|
+
let shadowRoot = document.getElementById('shadow_host').attachShadow({mode: 'open'});
|
14
|
+
shadowRoot.innerHTML = `
|
15
|
+
<span class="wrapper" id="shadow_content"><span class="info">some text</span></span>
|
16
|
+
<div id="nested_shadow_host"></div>
|
17
|
+
<a href="scroll.html">scroll.html</a>
|
18
|
+
<div id="controls_wrapper">
|
19
|
+
<input type="text" />
|
20
|
+
<input type="checkbox" id="shadow_checkbox" />
|
21
|
+
<input type="file" />
|
22
|
+
</div>
|
23
|
+
`;
|
24
|
+
|
25
|
+
let nestedShadowRoot = shadowRoot.getElementById('nested_shadow_host').attachShadow({mode: 'open'});
|
26
|
+
nestedShadowRoot.innerHTML = `
|
27
|
+
<div id="nested_shadow_content"><div>nested text</div></div>
|
28
|
+
`;
|
29
|
+
</script>
|
30
|
+
</body>
|
31
|
+
</html>
|