capybara 3.39.2 → 3.40.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/History.md +22 -0
- data/README.md +173 -29
- data/lib/capybara/helpers.rb +1 -1
- data/lib/capybara/minitest/spec.rb +16 -4
- data/lib/capybara/minitest.rb +14 -1
- data/lib/capybara/node/matchers.rb +25 -0
- data/lib/capybara/node/whitespace_normalizer.rb +5 -5
- data/lib/capybara/queries/selector_query.rb +2 -1
- data/lib/capybara/rack_test/browser.rb +3 -2
- data/lib/capybara/rack_test/node.rb +5 -12
- data/lib/capybara/registration_container.rb +2 -2
- data/lib/capybara/registrations/drivers.rb +1 -1
- data/lib/capybara/registrations/servers.rb +8 -7
- data/lib/capybara/result.rb +2 -2
- data/lib/capybara/rspec/matchers/have_selector.rb +4 -12
- data/lib/capybara/rspec/matchers.rb +7 -2
- data/lib/capybara/selector/css.rb +5 -5
- data/lib/capybara/selector/definition/table.rb +1 -1
- data/lib/capybara/selector/definition/table_row.rb +2 -2
- data/lib/capybara/selector.rb +251 -0
- data/lib/capybara/selenium/driver.rb +11 -51
- data/lib/capybara/selenium/driver_specializations/firefox_driver.rb +1 -6
- data/lib/capybara/selenium/node.rb +4 -31
- data/lib/capybara/selenium/nodes/chrome_node.rb +3 -19
- data/lib/capybara/selenium/nodes/edge_node.rb +0 -16
- data/lib/capybara/server/animation_disabler.rb +1 -1
- data/lib/capybara/server.rb +1 -1
- data/lib/capybara/session.rb +3 -2
- data/lib/capybara/spec/session/all_spec.rb +1 -1
- data/lib/capybara/spec/session/click_link_spec.rb +1 -1
- data/lib/capybara/spec/session/find_spec.rb +8 -0
- data/lib/capybara/spec/session/has_element_spec.rb +47 -0
- data/lib/capybara/spec/session/has_table_spec.rb +13 -2
- data/lib/capybara/spec/session/node_spec.rb +6 -0
- data/lib/capybara/spec/session/node_wrapper_spec.rb +1 -1
- data/lib/capybara/spec/session/uncheck_spec.rb +1 -1
- data/lib/capybara/spec/spec_helper.rb +2 -2
- data/lib/capybara/spec/test_app.rb +1 -1
- data/lib/capybara/spec/views/form.erb +5 -0
- data/lib/capybara/spec/views/with_html.erb +2 -0
- data/lib/capybara/version.rb +1 -1
- data/lib/capybara.rb +7 -6
- data/spec/minitest_spec.rb +8 -1
- data/spec/result_spec.rb +9 -0
- data/spec/rspec/shared_spec_matchers.rb +26 -2
- data/spec/rspec_spec.rb +1 -1
- data/spec/sauce_spec_chrome.rb +1 -1
- data/spec/selector_spec.rb +1 -1
- data/spec/selenium_spec_chrome.rb +7 -5
- data/spec/selenium_spec_chrome_remote.rb +0 -5
- data/spec/selenium_spec_edge.rb +11 -4
- data/spec/selenium_spec_firefox.rb +4 -3
- data/spec/selenium_spec_firefox_remote.rb +2 -3
- data/spec/server_spec.rb +12 -0
- data/spec/shared_selenium_session.rb +0 -2
- data/spec/spec_helper.rb +2 -2
- metadata +25 -32
- data/lib/capybara/selenium/logger_suppressor.rb +0 -44
- data/lib/capybara/selenium/patches/action_pauser.rb +0 -26
data/spec/server_spec.rb
CHANGED
@@ -118,6 +118,18 @@ RSpec.describe Capybara::Server do
|
|
118
118
|
Capybara.server = :default
|
119
119
|
end
|
120
120
|
|
121
|
+
it 'should not emit any warnings when booting puma' do
|
122
|
+
Capybara.server = :puma
|
123
|
+
app_proc = proc { |_env| [200, {}, ['Hello Puma!']] }
|
124
|
+
require 'puma'
|
125
|
+
|
126
|
+
expect do
|
127
|
+
described_class.new(app_proc).boot
|
128
|
+
end.not_to output.to_stderr
|
129
|
+
ensure
|
130
|
+
Capybara.server = :default
|
131
|
+
end
|
132
|
+
|
121
133
|
it 'should support SSL' do
|
122
134
|
key = File.join(Dir.pwd, 'spec', 'fixtures', 'key.pem')
|
123
135
|
cert = File.join(Dir.pwd, 'spec', 'fixtures', 'certificate.pem')
|
@@ -281,8 +281,6 @@ RSpec.shared_examples 'Capybara::Session' do |session, mode|
|
|
281
281
|
end
|
282
282
|
|
283
283
|
it 'returns a shadow root' do
|
284
|
-
skip 'Not supported with this Selenium version' if selenium_lt?('4.1', session)
|
285
|
-
pending "Geckodriver doesn't fully support shadow root yet" if firefox?(session)
|
286
284
|
session.visit('/with_shadow')
|
287
285
|
shadow = session.find(:css, '#shadow_host')
|
288
286
|
element = session.evaluate_script('arguments[0].shadowRoot', shadow)
|
data/spec/spec_helper.rb
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
3
|
require 'rspec/expectations'
|
4
|
-
require 'webdrivers' if ENV.fetch('
|
4
|
+
require 'webdrivers' if ENV.fetch('WEBDRIVERS', nil)
|
5
5
|
require 'selenium_statistics'
|
6
6
|
if ENV['TRAVIS']
|
7
7
|
require 'coveralls'
|
@@ -114,7 +114,7 @@ module Capybara
|
|
114
114
|
mod = mod::Service if ::Selenium::WebDriver::Service.respond_to? :driver_path
|
115
115
|
path = mod.driver_path
|
116
116
|
path = path.call if path.respond_to? :call
|
117
|
-
$stdout.puts `#{path.gsub(' ', '\ ')} --version`
|
117
|
+
$stdout.puts `#{path.gsub(' ', '\ ')} --version` if path
|
118
118
|
end
|
119
119
|
end
|
120
120
|
end
|
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.
|
4
|
+
version: 3.40.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Thomas Walpole
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date:
|
12
|
+
date: 2024-01-27 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: addressable
|
@@ -59,14 +59,14 @@ dependencies:
|
|
59
59
|
requirements:
|
60
60
|
- - "~>"
|
61
61
|
- !ruby/object:Gem::Version
|
62
|
-
version: '1.
|
62
|
+
version: '1.11'
|
63
63
|
type: :runtime
|
64
64
|
prerelease: false
|
65
65
|
version_requirements: !ruby/object:Gem::Requirement
|
66
66
|
requirements:
|
67
67
|
- - "~>"
|
68
68
|
- !ruby/object:Gem::Version
|
69
|
-
version: '1.
|
69
|
+
version: '1.11'
|
70
70
|
- !ruby/object:Gem::Dependency
|
71
71
|
name: rack
|
72
72
|
requirement: !ruby/object:Gem::Requirement
|
@@ -241,6 +241,20 @@ dependencies:
|
|
241
241
|
- - ">="
|
242
242
|
- !ruby/object:Gem::Version
|
243
243
|
version: '0'
|
244
|
+
- !ruby/object:Gem::Dependency
|
245
|
+
name: rackup
|
246
|
+
requirement: !ruby/object:Gem::Requirement
|
247
|
+
requirements:
|
248
|
+
- - ">="
|
249
|
+
- !ruby/object:Gem::Version
|
250
|
+
version: '0'
|
251
|
+
type: :development
|
252
|
+
prerelease: false
|
253
|
+
version_requirements: !ruby/object:Gem::Requirement
|
254
|
+
requirements:
|
255
|
+
- - ">="
|
256
|
+
- !ruby/object:Gem::Version
|
257
|
+
version: '0'
|
244
258
|
- !ruby/object:Gem::Dependency
|
245
259
|
name: rake
|
246
260
|
requirement: !ruby/object:Gem::Requirement
|
@@ -385,22 +399,16 @@ dependencies:
|
|
385
399
|
name: selenium-webdriver
|
386
400
|
requirement: !ruby/object:Gem::Requirement
|
387
401
|
requirements:
|
388
|
-
- - "
|
389
|
-
- !ruby/object:Gem::Version
|
390
|
-
version: 3.142.7
|
391
|
-
- - "<"
|
402
|
+
- - "~>"
|
392
403
|
- !ruby/object:Gem::Version
|
393
|
-
version: '
|
404
|
+
version: '4.8'
|
394
405
|
type: :development
|
395
406
|
prerelease: false
|
396
407
|
version_requirements: !ruby/object:Gem::Requirement
|
397
408
|
requirements:
|
398
|
-
- - "
|
399
|
-
- !ruby/object:Gem::Version
|
400
|
-
version: 3.142.7
|
401
|
-
- - "<"
|
409
|
+
- - "~>"
|
402
410
|
- !ruby/object:Gem::Version
|
403
|
-
version: '
|
411
|
+
version: '4.8'
|
404
412
|
- !ruby/object:Gem::Dependency
|
405
413
|
name: sinatra
|
406
414
|
requirement: !ruby/object:Gem::Requirement
|
@@ -429,20 +437,6 @@ dependencies:
|
|
429
437
|
- - ">="
|
430
438
|
- !ruby/object:Gem::Version
|
431
439
|
version: '0'
|
432
|
-
- !ruby/object:Gem::Dependency
|
433
|
-
name: webdrivers
|
434
|
-
requirement: !ruby/object:Gem::Requirement
|
435
|
-
requirements:
|
436
|
-
- - ">="
|
437
|
-
- !ruby/object:Gem::Version
|
438
|
-
version: 3.6.0
|
439
|
-
type: :development
|
440
|
-
prerelease: false
|
441
|
-
version_requirements: !ruby/object:Gem::Requirement
|
442
|
-
requirements:
|
443
|
-
- - ">="
|
444
|
-
- !ruby/object:Gem::Version
|
445
|
-
version: 3.6.0
|
446
440
|
- !ruby/object:Gem::Dependency
|
447
441
|
name: yard
|
448
442
|
requirement: !ruby/object:Gem::Requirement
|
@@ -577,14 +571,12 @@ files:
|
|
577
571
|
- lib/capybara/selenium/extensions/html5_drag.rb
|
578
572
|
- lib/capybara/selenium/extensions/modifier_keys_stack.rb
|
579
573
|
- lib/capybara/selenium/extensions/scroll.rb
|
580
|
-
- lib/capybara/selenium/logger_suppressor.rb
|
581
574
|
- lib/capybara/selenium/node.rb
|
582
575
|
- lib/capybara/selenium/nodes/chrome_node.rb
|
583
576
|
- lib/capybara/selenium/nodes/edge_node.rb
|
584
577
|
- lib/capybara/selenium/nodes/firefox_node.rb
|
585
578
|
- lib/capybara/selenium/nodes/ie_node.rb
|
586
579
|
- lib/capybara/selenium/nodes/safari_node.rb
|
587
|
-
- lib/capybara/selenium/patches/action_pauser.rb
|
588
580
|
- lib/capybara/selenium/patches/atoms.rb
|
589
581
|
- lib/capybara/selenium/patches/is_displayed.rb
|
590
582
|
- lib/capybara/selenium/patches/logs.rb
|
@@ -654,6 +646,7 @@ files:
|
|
654
646
|
- lib/capybara/spec/session/has_button_spec.rb
|
655
647
|
- lib/capybara/spec/session/has_css_spec.rb
|
656
648
|
- lib/capybara/spec/session/has_current_path_spec.rb
|
649
|
+
- lib/capybara/spec/session/has_element_spec.rb
|
657
650
|
- lib/capybara/spec/session/has_field_spec.rb
|
658
651
|
- lib/capybara/spec/session/has_link_spec.rb
|
659
652
|
- lib/capybara/spec/session/has_none_selectors_spec.rb
|
@@ -799,14 +792,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
799
792
|
requirements:
|
800
793
|
- - ">="
|
801
794
|
- !ruby/object:Gem::Version
|
802
|
-
version:
|
795
|
+
version: 3.0.0
|
803
796
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
804
797
|
requirements:
|
805
798
|
- - ">="
|
806
799
|
- !ruby/object:Gem::Version
|
807
800
|
version: '0'
|
808
801
|
requirements: []
|
809
|
-
rubygems_version: 3.
|
802
|
+
rubygems_version: 3.4.19
|
810
803
|
signing_key:
|
811
804
|
specification_version: 4
|
812
805
|
summary: Capybara aims to simplify the process of integration testing Rack applications,
|
@@ -1,44 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
module Capybara
|
4
|
-
module Selenium
|
5
|
-
module DeprecationSuppressor
|
6
|
-
def initialize(...)
|
7
|
-
@suppress_for_capybara = false
|
8
|
-
super
|
9
|
-
end
|
10
|
-
|
11
|
-
def deprecate(*args, **opts, &block)
|
12
|
-
return if @suppress_for_capybara
|
13
|
-
|
14
|
-
if opts.empty?
|
15
|
-
super(*args, &block) # support Selenium 3
|
16
|
-
else
|
17
|
-
super
|
18
|
-
end
|
19
|
-
end
|
20
|
-
|
21
|
-
def warn(*args, **opts)
|
22
|
-
super unless @suppress_for_capybara
|
23
|
-
end
|
24
|
-
|
25
|
-
def suppress_deprecations
|
26
|
-
prev_suppress_for_capybara, @suppress_for_capybara = @suppress_for_capybara, true
|
27
|
-
yield
|
28
|
-
ensure
|
29
|
-
@suppress_for_capybara = prev_suppress_for_capybara
|
30
|
-
end
|
31
|
-
end
|
32
|
-
|
33
|
-
module ErrorSuppressor
|
34
|
-
def for_code(...)
|
35
|
-
::Selenium::WebDriver.logger.suppress_deprecations do
|
36
|
-
super
|
37
|
-
end
|
38
|
-
end
|
39
|
-
end
|
40
|
-
end
|
41
|
-
end
|
42
|
-
|
43
|
-
Selenium::WebDriver::Logger.prepend Capybara::Selenium::DeprecationSuppressor
|
44
|
-
Selenium::WebDriver::Error.singleton_class.prepend Capybara::Selenium::ErrorSuppressor
|
@@ -1,26 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
module ActionPauser
|
4
|
-
def initialize(mouse, keyboard)
|
5
|
-
super
|
6
|
-
@devices[:pauser] = Pauser.new
|
7
|
-
end
|
8
|
-
|
9
|
-
def pause(duration)
|
10
|
-
@actions << [:pauser, :pause, [duration]]
|
11
|
-
self
|
12
|
-
end
|
13
|
-
|
14
|
-
class Pauser
|
15
|
-
def pause(duration)
|
16
|
-
sleep duration
|
17
|
-
end
|
18
|
-
end
|
19
|
-
|
20
|
-
private_constant :Pauser
|
21
|
-
end
|
22
|
-
|
23
|
-
if defined?(Selenium::WebDriver::VERSION) && (Gem::Version.new(Selenium::WebDriver::VERSION) < Gem::Version.new('4')) &&
|
24
|
-
defined?(Selenium::WebDriver::ActionBuilder)
|
25
|
-
Selenium::WebDriver::ActionBuilder.prepend(ActionPauser)
|
26
|
-
end
|