capybara 3.30.0 → 3.35.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.
Files changed (146) hide show
  1. checksums.yaml +4 -4
  2. data/History.md +153 -13
  3. data/README.md +9 -4
  4. data/lib/capybara.rb +18 -8
  5. data/lib/capybara/config.rb +4 -6
  6. data/lib/capybara/cucumber.rb +1 -1
  7. data/lib/capybara/driver/base.rb +4 -0
  8. data/lib/capybara/dsl.rb +10 -2
  9. data/lib/capybara/helpers.rb +25 -1
  10. data/lib/capybara/minitest.rb +232 -144
  11. data/lib/capybara/minitest/spec.rb +156 -97
  12. data/lib/capybara/node/actions.rb +16 -21
  13. data/lib/capybara/node/base.rb +6 -6
  14. data/lib/capybara/node/element.rb +14 -13
  15. data/lib/capybara/node/finders.rb +12 -7
  16. data/lib/capybara/node/matchers.rb +36 -27
  17. data/lib/capybara/node/simple.rb +6 -2
  18. data/lib/capybara/queries/ancestor_query.rb +1 -1
  19. data/lib/capybara/queries/base_query.rb +2 -1
  20. data/lib/capybara/queries/current_path_query.rb +14 -4
  21. data/lib/capybara/queries/selector_query.rb +40 -18
  22. data/lib/capybara/queries/sibling_query.rb +1 -1
  23. data/lib/capybara/queries/style_query.rb +1 -1
  24. data/lib/capybara/queries/text_query.rb +7 -1
  25. data/lib/capybara/rack_test/browser.rb +9 -3
  26. data/lib/capybara/rack_test/driver.rb +1 -0
  27. data/lib/capybara/rack_test/form.rb +1 -1
  28. data/lib/capybara/rack_test/node.rb +35 -10
  29. data/lib/capybara/registration_container.rb +44 -0
  30. data/lib/capybara/registrations/drivers.rb +18 -12
  31. data/lib/capybara/registrations/patches/puma_ssl.rb +3 -1
  32. data/lib/capybara/registrations/servers.rb +3 -2
  33. data/lib/capybara/result.rb +35 -15
  34. data/lib/capybara/rspec.rb +2 -0
  35. data/lib/capybara/rspec/matcher_proxies.rb +5 -5
  36. data/lib/capybara/rspec/matchers.rb +33 -32
  37. data/lib/capybara/rspec/matchers/base.rb +12 -6
  38. data/lib/capybara/rspec/matchers/count_sugar.rb +2 -1
  39. data/lib/capybara/rspec/matchers/have_ancestor.rb +4 -3
  40. data/lib/capybara/rspec/matchers/have_current_path.rb +2 -2
  41. data/lib/capybara/rspec/matchers/have_selector.rb +15 -7
  42. data/lib/capybara/rspec/matchers/have_sibling.rb +3 -3
  43. data/lib/capybara/rspec/matchers/have_text.rb +3 -3
  44. data/lib/capybara/rspec/matchers/have_title.rb +2 -2
  45. data/lib/capybara/rspec/matchers/match_selector.rb +3 -3
  46. data/lib/capybara/rspec/matchers/match_style.rb +7 -2
  47. data/lib/capybara/rspec/matchers/spatial_sugar.rb +2 -1
  48. data/lib/capybara/selector.rb +14 -3
  49. data/lib/capybara/selector/builders/css_builder.rb +1 -1
  50. data/lib/capybara/selector/builders/xpath_builder.rb +3 -1
  51. data/lib/capybara/selector/definition.rb +11 -9
  52. data/lib/capybara/selector/definition/button.rb +26 -14
  53. data/lib/capybara/selector/definition/css.rb +1 -1
  54. data/lib/capybara/selector/definition/datalist_input.rb +1 -1
  55. data/lib/capybara/selector/definition/element.rb +2 -1
  56. data/lib/capybara/selector/definition/fillable_field.rb +1 -1
  57. data/lib/capybara/selector/definition/label.rb +2 -2
  58. data/lib/capybara/selector/definition/link.rb +8 -0
  59. data/lib/capybara/selector/definition/select.rb +32 -13
  60. data/lib/capybara/selector/definition/table.rb +1 -1
  61. data/lib/capybara/selector/definition/table_row.rb +2 -2
  62. data/lib/capybara/selector/filter_set.rb +2 -2
  63. data/lib/capybara/selector/selector.rb +9 -1
  64. data/lib/capybara/selenium/atoms/getAttribute.min.js +1 -1
  65. data/lib/capybara/selenium/atoms/src/getAttribute.js +1 -1
  66. data/lib/capybara/selenium/atoms/src/isDisplayed.js +1 -1
  67. data/lib/capybara/selenium/driver.rb +52 -7
  68. data/lib/capybara/selenium/driver_specializations/chrome_driver.rb +10 -12
  69. data/lib/capybara/selenium/driver_specializations/edge_driver.rb +9 -11
  70. data/lib/capybara/selenium/driver_specializations/firefox_driver.rb +3 -3
  71. data/lib/capybara/selenium/extensions/find.rb +4 -4
  72. data/lib/capybara/selenium/extensions/html5_drag.rb +24 -8
  73. data/lib/capybara/selenium/extensions/scroll.rb +8 -10
  74. data/lib/capybara/selenium/logger_suppressor.rb +8 -2
  75. data/lib/capybara/selenium/node.rb +96 -16
  76. data/lib/capybara/selenium/nodes/chrome_node.rb +27 -16
  77. data/lib/capybara/selenium/nodes/edge_node.rb +1 -1
  78. data/lib/capybara/selenium/nodes/firefox_node.rb +9 -4
  79. data/lib/capybara/selenium/nodes/safari_node.rb +1 -1
  80. data/lib/capybara/selenium/patches/action_pauser.rb +26 -0
  81. data/lib/capybara/selenium/patches/atoms.rb +4 -4
  82. data/lib/capybara/selenium/patches/logs.rb +7 -9
  83. data/lib/capybara/server/animation_disabler.rb +8 -3
  84. data/lib/capybara/server/middleware.rb +4 -2
  85. data/lib/capybara/session.rb +53 -29
  86. data/lib/capybara/session/config.rb +3 -1
  87. data/lib/capybara/session/matchers.rb +11 -11
  88. data/lib/capybara/spec/public/test.js +64 -7
  89. data/lib/capybara/spec/session/accept_alert_spec.rb +1 -1
  90. data/lib/capybara/spec/session/all_spec.rb +45 -5
  91. data/lib/capybara/spec/session/assert_text_spec.rb +5 -5
  92. data/lib/capybara/spec/session/check_spec.rb +6 -0
  93. data/lib/capybara/spec/session/click_button_spec.rb +11 -0
  94. data/lib/capybara/spec/session/click_link_or_button_spec.rb +9 -0
  95. data/lib/capybara/spec/session/current_url_spec.rb +11 -1
  96. data/lib/capybara/spec/session/fill_in_spec.rb +29 -0
  97. data/lib/capybara/spec/session/find_spec.rb +11 -8
  98. data/lib/capybara/spec/session/has_button_spec.rb +51 -0
  99. data/lib/capybara/spec/session/has_css_spec.rb +14 -10
  100. data/lib/capybara/spec/session/has_current_path_spec.rb +15 -2
  101. data/lib/capybara/spec/session/has_field_spec.rb +16 -0
  102. data/lib/capybara/spec/session/has_select_spec.rb +32 -4
  103. data/lib/capybara/spec/session/has_selector_spec.rb +4 -4
  104. data/lib/capybara/spec/session/has_text_spec.rb +5 -12
  105. data/lib/capybara/spec/session/html_spec.rb +1 -1
  106. data/lib/capybara/spec/session/matches_style_spec.rb +2 -2
  107. data/lib/capybara/spec/session/node_spec.rb +169 -33
  108. data/lib/capybara/spec/session/refresh_spec.rb +2 -1
  109. data/lib/capybara/spec/session/save_page_spec.rb +4 -4
  110. data/lib/capybara/spec/session/window/switch_to_window_spec.rb +1 -1
  111. data/lib/capybara/spec/session/window/window_opened_by_spec.rb +1 -1
  112. data/lib/capybara/spec/session/window/window_spec.rb +8 -8
  113. data/lib/capybara/spec/session/window/windows_spec.rb +1 -1
  114. data/lib/capybara/spec/spec_helper.rb +13 -14
  115. data/lib/capybara/spec/test_app.rb +23 -21
  116. data/lib/capybara/spec/views/form.erb +36 -3
  117. data/lib/capybara/spec/views/with_animation.erb +8 -0
  118. data/lib/capybara/spec/views/with_dragula.erb +3 -1
  119. data/lib/capybara/spec/views/with_html.erb +2 -2
  120. data/lib/capybara/spec/views/with_jquery_animation.erb +24 -0
  121. data/lib/capybara/spec/views/with_js.erb +3 -0
  122. data/lib/capybara/spec/views/with_sortable_js.erb +1 -1
  123. data/lib/capybara/version.rb +1 -1
  124. data/lib/capybara/window.rb +3 -7
  125. data/spec/basic_node_spec.rb +9 -8
  126. data/spec/capybara_spec.rb +1 -1
  127. data/spec/dsl_spec.rb +14 -1
  128. data/spec/fixtures/selenium_driver_rspec_success.rb +1 -1
  129. data/spec/minitest_spec.rb +3 -2
  130. data/spec/rack_test_spec.rb +28 -6
  131. data/spec/regexp_dissassembler_spec.rb +0 -4
  132. data/spec/result_spec.rb +40 -29
  133. data/spec/rspec/features_spec.rb +3 -1
  134. data/spec/rspec/scenarios_spec.rb +4 -0
  135. data/spec/rspec/shared_spec_matchers.rb +63 -51
  136. data/spec/rspec_spec.rb +4 -0
  137. data/spec/selector_spec.rb +17 -2
  138. data/spec/selenium_spec_chrome.rb +45 -21
  139. data/spec/selenium_spec_chrome_remote.rb +7 -1
  140. data/spec/selenium_spec_firefox.rb +15 -13
  141. data/spec/server_spec.rb +60 -49
  142. data/spec/shared_selenium_node.rb +18 -0
  143. data/spec/shared_selenium_session.rb +98 -7
  144. data/spec/spec_helper.rb +1 -1
  145. metadata +50 -14
  146. data/lib/capybara/spec/session/source_spec.rb +0 -0
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- # Note: This file uses `sleep` to sync up parts of the tests. This is only implemented like this
3
+ # NOTE: This file uses `sleep` to sync up parts of the tests. This is only implemented like this
4
4
  # because of the methods being tested. In tests using Capybara this type of behavior should be implemented
5
5
  # using Capybara provided assertions with builtin waiting behavior.
6
6
 
@@ -25,6 +25,7 @@ Capybara::SpecHelper.spec '#refresh' do
25
25
  @session.visit('/form')
26
26
  @session.select('Sweden', from: 'form_region')
27
27
  @session.click_button('awesome')
28
+ sleep 2
28
29
  expect do
29
30
  @session.refresh
30
31
  sleep 2
@@ -31,7 +31,7 @@ Capybara::SpecHelper.spec '#save_page' do
31
31
  it 'can store files in a specified directory' do
32
32
  Capybara.save_path = alternative_path
33
33
  @session.save_page
34
- path = Dir.glob(alternative_path + '/capybara-*.html').first
34
+ path = Dir.glob("#{alternative_path}/capybara-*.html").first
35
35
  expect(File.read(path)).to include('Another World')
36
36
  end
37
37
 
@@ -43,14 +43,14 @@ Capybara::SpecHelper.spec '#save_page' do
43
43
  it 'can store files in a specified directory with a given filename' do
44
44
  Capybara.save_path = alternative_path
45
45
  @session.save_page('capybara-001133.html')
46
- path = alternative_path + '/capybara-001133.html'
46
+ path = "#{alternative_path}/capybara-001133.html"
47
47
  expect(File.read(path)).to include('Another World')
48
48
  end
49
49
 
50
50
  it 'can store files in a specified directory with a given relative filename' do
51
51
  Capybara.save_path = alternative_path
52
52
  @session.save_page('tmp/capybara-001144.html')
53
- path = alternative_path + '/tmp/capybara-001144.html'
53
+ path = "#{alternative_path}/tmp/capybara-001144.html"
54
54
  expect(File.read(path)).to include('Another World')
55
55
  end
56
56
 
@@ -63,7 +63,7 @@ Capybara::SpecHelper.spec '#save_page' do
63
63
  it 'returns an absolute path in given directory' do
64
64
  Capybara.save_path = alternative_path
65
65
  result = @session.save_page
66
- path = File.expand_path(Dir.glob(alternative_path + '/capybara-*.html').first, alternative_path)
66
+ path = File.expand_path(Dir.glob("#{alternative_path}/capybara-*.html").first, alternative_path)
67
67
  expect(result).to eq(path)
68
68
  end
69
69
 
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- # Note: This file uses `sleep` to sync up parts of the tests. This is only implemented like this
3
+ # NOTE: This file uses `sleep` to sync up parts of the tests. This is only implemented like this
4
4
  # because of the methods being tested. In tests using Capybara this type of behavior should be implemented
5
5
  # using Capybara provided assertions with builtin waiting behavior.
6
6
 
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- # Note: This file uses `sleep` to sync up parts of the tests. This is only implemented like this
3
+ # NOTE: This file uses `sleep` to sync up parts of the tests. This is only implemented like this
4
4
  # because of the methods being tested. In tests using Capybara this type of behavior should be implemented
5
5
  # using Capybara provided assertions with builtin waiting behavior.
6
6
 
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- # Note: This file uses `sleep` to sync up parts of the tests. This is only implemented like this
3
+ # NOTE: This file uses `sleep` to sync up parts of the tests. This is only implemented like this
4
4
  # because of the methods being tested. In tests using Capybara this type of behavior should be implemented
5
5
  # using Capybara provided assertions with builtin waiting behavior.
6
6
 
@@ -141,12 +141,12 @@ Capybara::SpecHelper.spec Capybara::Window, requires: [:windows] do
141
141
  end
142
142
 
143
143
  describe '#maximize' do
144
- before do
145
- @initial_size = @session.current_window.size
144
+ let! :initial_size do
145
+ @session.current_window.size
146
146
  end
147
147
 
148
148
  after do
149
- @session.current_window.resize_to(*@initial_size)
149
+ @session.current_window.resize_to(*initial_size)
150
150
  sleep 0.5
151
151
  end
152
152
 
@@ -176,7 +176,7 @@ Capybara::SpecHelper.spec Capybara::Window, requires: [:windows] do
176
176
 
177
177
  expect(@session.current_window).to eq(orig_window)
178
178
  # Maximizing the browser affects all tabs so this may not be valid in real browsers
179
- # expect(@session.current_window.size).to eq(@initial_size)
179
+ # expect(@session.current_window.size).to eq(initial_size)
180
180
 
181
181
  ow_width, ow_height = other_window.size
182
182
  expect(ow_width).to be > 400
@@ -185,12 +185,12 @@ Capybara::SpecHelper.spec Capybara::Window, requires: [:windows] do
185
185
  end
186
186
 
187
187
  describe '#fullscreen' do
188
- before do
189
- @initial_size = @session.current_window.size
188
+ let! :initial_size do
189
+ @session.current_window.size
190
190
  end
191
191
 
192
192
  after do
193
- @session.current_window.resize_to(*@initial_size)
193
+ @session.current_window.resize_to(*initial_size)
194
194
  sleep 1
195
195
  end
196
196
 
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- # Note: This file uses `sleep` to sync up parts of the tests. This is only implemented like this
3
+ # NOTE: This file uses `sleep` to sync up parts of the tests. This is only implemented like this
4
4
  # because of the methods being tested. In tests using Capybara this type of behavior should be implemented
5
5
  # using Capybara provided assertions with builtin waiting behavior.
6
6
 
@@ -30,6 +30,7 @@ module Capybara
30
30
  Capybara.visible_text_only = false
31
31
  Capybara.match = :smart
32
32
  Capybara.enable_aria_label = false
33
+ Capybara.enable_aria_role = false
33
34
  Capybara.default_set_options = {}
34
35
  Capybara.disable_animation = false
35
36
  Capybara.test_id = nil
@@ -57,10 +58,10 @@ module Capybara
57
58
 
58
59
  def run_specs(session, name, **options, &filter_block)
59
60
  specs = @specs
60
- RSpec.describe Capybara::Session, name, options do # rubocop:disable RSpec/EmptyExampleGroup
61
+ RSpec.describe Capybara::Session, name, options do
61
62
  include Capybara::SpecHelper
62
63
  include Capybara::RSpecMatchers
63
- # rubocop:disable RSpec/ScatteredSetup
64
+
64
65
  before do |example|
65
66
  @session = session
66
67
  instance_exec(example, &filter_block) if filter_block
@@ -71,28 +72,28 @@ module Capybara
71
72
  end
72
73
 
73
74
  before :each, psc: true do
74
- SpecHelper.reset_threadsafe(true, session)
75
+ SpecHelper.reset_threadsafe(bool: true, session: session)
75
76
  end
76
77
 
77
78
  after psc: true do
78
- SpecHelper.reset_threadsafe(false, session)
79
+ SpecHelper.reset_threadsafe(session: session)
79
80
  end
80
81
 
81
82
  before :each, :exact_false do
82
83
  Capybara.exact = false
83
84
  end
84
- # rubocop:enable RSpec/ScatteredSetup
85
85
 
86
86
  specs.each do |spec_name, spec_options, block|
87
- describe spec_name, *spec_options do # rubocop:disable RSpec/EmptyExampleGroup
87
+ describe spec_name, *spec_options do
88
88
  class_eval(&block)
89
89
  end
90
90
  end
91
91
  end
92
92
  end
93
93
 
94
- def reset_threadsafe(bool = false, session = nil)
95
- Capybara::Session.class_variable_set(:@@instance_created, false) # Work around limit on when threadsafe can be changed
94
+ def reset_threadsafe(bool: false, session: nil)
95
+ # Work around limit on when threadsafe can be changed
96
+ Capybara::Session.class_variable_set(:@@instance_created, false) # rubocop:disable Style/ClassVars
96
97
  Capybara.threadsafe = bool
97
98
  session = session.current_session if session.respond_to?(:current_session)
98
99
  session&.instance_variable_set(:@config, nil)
@@ -108,11 +109,9 @@ module Capybara
108
109
  stream.reopen(old_stream)
109
110
  end
110
111
 
111
- def quietly
112
- silence_stream(STDOUT) do
113
- silence_stream(STDERR) do
114
- yield
115
- end
112
+ def quietly(&block)
113
+ silence_stream($stdout) do
114
+ silence_stream($stderr, &block)
116
115
  end
117
116
  end
118
117
 
@@ -132,4 +131,4 @@ module Capybara
132
131
  end
133
132
  end
134
133
 
135
- Dir[File.dirname(__FILE__) + '/session/**/*.rb'].each { |file| require_relative file }
134
+ Dir["#{File.dirname(__FILE__)}/session/**/*.rb"].each { |file| require_relative file }
@@ -7,8 +7,10 @@ require 'yaml'
7
7
 
8
8
  class TestApp < Sinatra::Base
9
9
  class TestAppError < Exception; end # rubocop:disable Lint/InheritException
10
+
10
11
  class TestAppOtherError < Exception # rubocop:disable Lint/InheritException
11
12
  def initialize(string1, msg)
13
+ super()
12
14
  @something = string1
13
15
  @message = msg
14
16
  end
@@ -33,6 +35,10 @@ class TestApp < Sinatra::Base
33
35
  redirect '/redirect_again'
34
36
  end
35
37
 
38
+ get '/redirect_with_fragment' do
39
+ redirect '/landed#with_fragment'
40
+ end
41
+
36
42
  get '/redirect_again' do
37
43
  redirect '/landed'
38
44
  end
@@ -85,11 +91,11 @@ class TestApp < Sinatra::Base
85
91
  end
86
92
 
87
93
  get '/form/get' do
88
- '<pre id="results">' + params[:form].to_yaml + '</pre>'
94
+ %(<pre id="results">#{params[:form].to_yaml}</pre>)
89
95
  end
90
96
 
91
97
  post '/relative' do
92
- '<pre id="results">' + params[:form].to_yaml + '</pre>'
98
+ %(<pre id="results">#{params[:form].to_yaml}</pre>)
93
99
  end
94
100
 
95
101
  get '/favicon.ico' do
@@ -176,7 +182,7 @@ class TestApp < Sinatra::Base
176
182
 
177
183
  post '/form' do
178
184
  self.class.form_post_count += 1
179
- '<pre id="results">' + params[:form].merge('post_count' => self.class.form_post_count).to_yaml + '</pre>'
185
+ %(<pre id="results">#{params[:form].merge('post_count' => self.class.form_post_count).to_yaml}</pre>)
180
186
  end
181
187
 
182
188
  post '/upload_empty' do
@@ -188,28 +194,24 @@ class TestApp < Sinatra::Base
188
194
  end
189
195
 
190
196
  post '/upload' do
191
- begin
192
- buffer = []
193
- buffer << "Content-type: #{params.dig(:form, :document, :type)}"
194
- buffer << "File content: #{params.dig(:form, :document, :tempfile).read}"
195
- buffer.join(' | ')
196
- rescue StandardError
197
- 'No file uploaded'
198
- end
197
+ buffer = []
198
+ buffer << "Content-type: #{params.dig(:form, :document, :type)}"
199
+ buffer << "File content: #{params.dig(:form, :document, :tempfile).read}"
200
+ buffer.join(' | ')
201
+ rescue StandardError
202
+ 'No file uploaded'
199
203
  end
200
204
 
201
205
  post '/upload_multiple' do
202
- begin
203
- docs = params.dig(:form, :multiple_documents)
204
- buffer = [docs.size.to_s]
205
- docs.each do |doc|
206
- buffer << "Content-type: #{doc[:type]}"
207
- buffer << "File content: #{doc[:tempfile].read}"
208
- end
209
- buffer.join(' | ')
210
- rescue StandardError
211
- 'No files uploaded'
206
+ docs = params.dig(:form, :multiple_documents)
207
+ buffer = [docs.size.to_s]
208
+ docs.each do |doc|
209
+ buffer << "Content-type: #{doc[:type]}"
210
+ buffer << "File content: #{doc[:tempfile].read}"
212
211
  end
212
+ buffer.join(' | ')
213
+ rescue StandardError
214
+ 'No files uploaded'
213
215
  end
214
216
 
215
217
  get '/apple-touch-icon-precomposed.png' do
@@ -11,7 +11,7 @@
11
11
  <option>Miss</option>
12
12
  <option disabled="disabled">Other</option>
13
13
  </select>
14
- </p>
14
+ </p>
15
15
 
16
16
  <p>
17
17
  <label for="customer_name">Customer Name
@@ -62,6 +62,11 @@
62
62
  <input type="text" name="form[name]" value="John Smith" id="form_name"/>
63
63
  </p>
64
64
 
65
+ <p>
66
+ <label for="form_age">Age</label>
67
+ <input type="range" name="form[age]" value="18" min="13" max="100" step="0.5" id="form_age"/>
68
+ </p>
69
+
65
70
  <p>
66
71
  <label for="form_schmooo">Schmooo</label>
67
72
  <input type="schmooo" name="form[schmooo]" value="This is Schmooo!" id="form_schmooo"/>
@@ -135,7 +140,11 @@
135
140
 
136
141
  <p>
137
142
  <label for="form_zipcode">Zipcode</label>
138
- <input type="text" maxlength="5" name="form[zipcode]" id="form_zipcode" />
143
+ <input type="text" maxlength="5" name="form[zipcode]" id="form_zipcode" pattern="[0-9]{5,9}" />
144
+ </p>
145
+
146
+ <p>
147
+ <input maxlength="35" id="long_length" />
139
148
  </p>
140
149
 
141
150
  <p>
@@ -440,14 +449,25 @@ New line after and before textarea tag
440
449
 
441
450
  <p>
442
451
  <input type="button" aria-label="Aria button" name="form[fresh]" id="fresh_btn" value="i am fresh"/>
443
- <input type="submit" name="form[awesome]" id="awe123" title="What an Awesome Button" value="awesome"/>
452
+ <input type="submit" name="form[awesome]" id="awe123" data-test-id="test_id_button" title="What an Awesome Button" value="awesome"/>
444
453
  <input type="submit" name="form[crappy]" id="crap321" value="crappy"/>
445
454
  <input type="image" name="form[okay]" id="okay556" title="Okay 556 Image" value="okay" alt="oh hai thar"/>
446
455
  <button type="submit" id="click_me_123" title="Click Title button" value="click_me">Click me!</button>
447
456
  <button type="submit" name="form[no_value]">No Value!</button>
448
457
  <button id="no_type">No Type!</button>
449
458
  <button><img alt="A horse eating hay"/></button>
459
+ <button id="button_with_label"></button>
460
+ <label for="button_with_label">button with label element</label>
461
+ <label>
462
+ button within label element
463
+ <button></button>
464
+ </label>
465
+ <label>
466
+ role=button within label element
467
+ <span role="button">with other text</span>
468
+ </label>
450
469
  <input type="button" disabled="disabled" value="Disabled button"/>
470
+ <span role="button">ARIA button</span>
451
471
  </p>
452
472
 
453
473
  <p>
@@ -512,6 +532,7 @@ New line after and before textarea tag
512
532
 
513
533
  <p>
514
534
  <input type="submit" name="form[mediocre]" id="mediocre" value="med" aria-label="Mediocre Button"/>
535
+ <input type="submit" formaction="/form/get?bar=foo" id="mediocre2" value="med2"/>
515
536
  <p>
516
537
  </form>
517
538
 
@@ -673,3 +694,15 @@ New line after and before textarea tag
673
694
  <p>
674
695
  <input id="special" {custom}="abcdef" value="custom attribute"/>
675
696
  </p>
697
+
698
+
699
+ <label for="multi_label_checkbox">
700
+ Label to click
701
+ </label>
702
+ <div>Something random that justifies the usage of a separate label</div>
703
+ <label>
704
+ <div>
705
+ <input type="checkbox" id="multi_label_checkbox" style="display: none"/>
706
+ <div>Visual representation of the checkbox</div>
707
+ </div>
708
+ </label>
@@ -18,6 +18,14 @@
18
18
  });
19
19
  </script>
20
20
  <style>
21
+ html {
22
+ scroll-behavior: smooth;
23
+ }
24
+
25
+ body {
26
+ min-height: 2000px;
27
+ }
28
+
21
29
  .transition.away {
22
30
  width: 0%;
23
31
  }
@@ -15,7 +15,9 @@
15
15
  </div>
16
16
  <script src="https://cdnjs.cloudflare.com/ajax/libs/dragula/3.7.2/dragula.js" type="text/javascript"></script>
17
17
  <script>
18
- dragula([document.getElementById("sortable")]);
18
+ let container = document.getElementById("sortable");
19
+ dragula([container]);
20
+ container.className = "ready"
19
21
  </script>
20
22
  </body>
21
23
  </html>
@@ -36,8 +36,8 @@
36
36
  </p>
37
37
 
38
38
  <p>
39
- <input type="text" id="test_field" data-test-id="test_id" value="monkey"/>
40
- <input type="text" readonly="readonly" value="should not change" />
39
+ <input type="text" id="test_field" spellcheck="TRUE" data-test-id="test_id" value="monkey"/>
40
+ <input type="text" readonly="readonly" spellcheck="FALSE" value="should not change" />
41
41
  <textarea id="normal" data-other-test-id="test_id">
42
42
  banana</textarea>
43
43
  <textarea id="additional_newline">
@@ -0,0 +1,24 @@
1
+
2
+ <html>
3
+ <head>
4
+ <meta http-equiv="Content-type" content="text/html; charset=utf-8"/>
5
+ <title>with_jquery_animation</title>
6
+ <style>
7
+ body {
8
+ height: 2000px;
9
+ }
10
+ </style>
11
+ </head>
12
+
13
+ <body id="with_animation">
14
+ <a href="#" id='scroll'>scroll top 500</a>
15
+
16
+ <script src="/jquery.js" type="text/javascript" charset="utf-8"></script>
17
+ <script type='text/javascript'>
18
+ $('#scroll').click(function(e){
19
+ e.preventDefault();
20
+ $('html, body').animate({ scrollTop: 500 }, 'slow');
21
+ });
22
+ </script>
23
+ </body>
24
+ </html>
@@ -35,6 +35,8 @@
35
35
 
36
36
  <p><a href="#" id="clickable">Click me</a></p>
37
37
  <p><a href="#" id="slow-click">Slowly</a></p>
38
+ <p><span id="aria-button" role="button">ARIA button</span></p>
39
+ <p><span role="button">ARIA button2</span></p>
38
40
 
39
41
  <p>
40
42
  <select id="waiter">
@@ -151,6 +153,7 @@
151
153
  <p>This is an HTML5 draggable element.</p>
152
154
  </div>
153
155
 
156
+ <div id="shadow"></div>
154
157
  <script type="text/javascript">
155
158
  // a javascript comment
156
159
  var aVar = 123;