capybara 3.30.0 → 3.35.3

Sign up to get free protection for your applications and to get access to all the features.
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
data/spec/spec_helper.rb CHANGED
@@ -46,7 +46,7 @@ module Capybara
46
46
  end
47
47
 
48
48
  def edge?(session)
49
- browser_name(session).match?(/^edge/)
49
+ browser_name(session).to_s.start_with?('edge')
50
50
  end
51
51
 
52
52
  def legacy_edge?(session)
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: capybara
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.30.0
4
+ version: 3.35.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Thomas Walpole
@@ -10,7 +10,7 @@ autorequire:
10
10
  bindir: bin
11
11
  cert_chain:
12
12
  - gem-public_cert.pem
13
- date: 2019-12-25 00:00:00.000000000 Z
13
+ date: 2021-01-30 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: addressable
@@ -86,16 +86,22 @@ dependencies:
86
86
  name: regexp_parser
87
87
  requirement: !ruby/object:Gem::Requirement
88
88
  requirements:
89
- - - "~>"
89
+ - - ">="
90
90
  - !ruby/object:Gem::Version
91
91
  version: '1.5'
92
+ - - "<"
93
+ - !ruby/object:Gem::Version
94
+ version: '3.0'
92
95
  type: :runtime
93
96
  prerelease: false
94
97
  version_requirements: !ruby/object:Gem::Requirement
95
98
  requirements:
96
- - - "~>"
99
+ - - ">="
97
100
  - !ruby/object:Gem::Version
98
101
  version: '1.5'
102
+ - - "<"
103
+ - !ruby/object:Gem::Version
104
+ version: '3.0'
99
105
  - !ruby/object:Gem::Dependency
100
106
  name: xpath
101
107
  requirement: !ruby/object:Gem::Requirement
@@ -270,16 +276,16 @@ dependencies:
270
276
  requirements:
271
277
  - - "~>"
272
278
  - !ruby/object:Gem::Version
273
- version: '0.72'
279
+ version: '1.1'
274
280
  type: :development
275
281
  prerelease: false
276
282
  version_requirements: !ruby/object:Gem::Requirement
277
283
  requirements:
278
284
  - - "~>"
279
285
  - !ruby/object:Gem::Version
280
- version: '0.72'
286
+ version: '1.1'
281
287
  - !ruby/object:Gem::Dependency
282
- name: rubocop-performance
288
+ name: rubocop-minitest
283
289
  requirement: !ruby/object:Gem::Requirement
284
290
  requirements:
285
291
  - - ">="
@@ -293,7 +299,7 @@ dependencies:
293
299
  - !ruby/object:Gem::Version
294
300
  version: '0'
295
301
  - !ruby/object:Gem::Dependency
296
- name: rubocop-rspec
302
+ name: rubocop-performance
297
303
  requirement: !ruby/object:Gem::Requirement
298
304
  requirements:
299
305
  - - ">="
@@ -307,7 +313,7 @@ dependencies:
307
313
  - !ruby/object:Gem::Version
308
314
  version: '0'
309
315
  - !ruby/object:Gem::Dependency
310
- name: sauce_whisk
316
+ name: rubocop-rake
311
317
  requirement: !ruby/object:Gem::Requirement
312
318
  requirements:
313
319
  - - ">="
@@ -321,19 +327,33 @@ dependencies:
321
327
  - !ruby/object:Gem::Version
322
328
  version: '0'
323
329
  - !ruby/object:Gem::Dependency
324
- name: selenium-webdriver
330
+ name: rubocop-rspec
325
331
  requirement: !ruby/object:Gem::Requirement
326
332
  requirements:
327
333
  - - "~>"
328
334
  - !ruby/object:Gem::Version
329
- version: '3.5'
335
+ version: '2.0'
330
336
  type: :development
331
337
  prerelease: false
332
338
  version_requirements: !ruby/object:Gem::Requirement
333
339
  requirements:
334
340
  - - "~>"
335
341
  - !ruby/object:Gem::Version
336
- version: '3.5'
342
+ version: '2.0'
343
+ - !ruby/object:Gem::Dependency
344
+ name: sauce_whisk
345
+ requirement: !ruby/object:Gem::Requirement
346
+ requirements:
347
+ - - ">="
348
+ - !ruby/object:Gem::Version
349
+ version: '0'
350
+ type: :development
351
+ prerelease: false
352
+ version_requirements: !ruby/object:Gem::Requirement
353
+ requirements:
354
+ - - ">="
355
+ - !ruby/object:Gem::Version
356
+ version: '0'
337
357
  - !ruby/object:Gem::Dependency
338
358
  name: selenium_statistics
339
359
  requirement: !ruby/object:Gem::Requirement
@@ -348,6 +368,20 @@ dependencies:
348
368
  - - ">="
349
369
  - !ruby/object:Gem::Version
350
370
  version: '0'
371
+ - !ruby/object:Gem::Dependency
372
+ name: selenium-webdriver
373
+ requirement: !ruby/object:Gem::Requirement
374
+ requirements:
375
+ - - "~>"
376
+ - !ruby/object:Gem::Version
377
+ version: '3.5'
378
+ type: :development
379
+ prerelease: false
380
+ version_requirements: !ruby/object:Gem::Requirement
381
+ requirements:
382
+ - - "~>"
383
+ - !ruby/object:Gem::Version
384
+ version: '3.5'
351
385
  - !ruby/object:Gem::Dependency
352
386
  name: sinatra
353
387
  requirement: !ruby/object:Gem::Requirement
@@ -450,6 +484,7 @@ files:
450
484
  - lib/capybara/rack_test/form.rb
451
485
  - lib/capybara/rack_test/node.rb
452
486
  - lib/capybara/rails.rb
487
+ - lib/capybara/registration_container.rb
453
488
  - lib/capybara/registrations/drivers.rb
454
489
  - lib/capybara/registrations/patches/puma_ssl.rb
455
490
  - lib/capybara/registrations/servers.rb
@@ -528,6 +563,7 @@ files:
528
563
  - lib/capybara/selenium/nodes/firefox_node.rb
529
564
  - lib/capybara/selenium/nodes/ie_node.rb
530
565
  - lib/capybara/selenium/nodes/safari_node.rb
566
+ - lib/capybara/selenium/patches/action_pauser.rb
531
567
  - lib/capybara/selenium/patches/atoms.rb
532
568
  - lib/capybara/selenium/patches/is_displayed.rb
533
569
  - lib/capybara/selenium/patches/logs.rb
@@ -623,7 +659,6 @@ files:
623
659
  - lib/capybara/spec/session/select_spec.rb
624
660
  - lib/capybara/spec/session/selectors_spec.rb
625
661
  - lib/capybara/spec/session/sibling_spec.rb
626
- - lib/capybara/spec/session/source_spec.rb
627
662
  - lib/capybara/spec/session/text_spec.rb
628
663
  - lib/capybara/spec/session/title_spec.rb
629
664
  - lib/capybara/spec/session/uncheck_spec.rb
@@ -671,6 +706,7 @@ files:
671
706
  - lib/capybara/spec/views/with_html.erb
672
707
  - lib/capybara/spec/views/with_html5_svg.erb
673
708
  - lib/capybara/spec/views/with_html_entities.erb
709
+ - lib/capybara/spec/views/with_jquery_animation.erb
674
710
  - lib/capybara/spec/views/with_js.erb
675
711
  - lib/capybara/spec/views/with_jstree.erb
676
712
  - lib/capybara/spec/views/with_namespace.erb
@@ -737,7 +773,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
737
773
  requirements:
738
774
  - - ">="
739
775
  - !ruby/object:Gem::Version
740
- version: 2.4.0
776
+ version: 2.5.0
741
777
  required_rubygems_version: !ruby/object:Gem::Requirement
742
778
  requirements:
743
779
  - - ">="
File without changes