capybara 2.17.0 → 2.18.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 +12 -0
- data/lib/capybara/selenium/driver.rb +12 -38
- data/lib/capybara/selenium/node.rb +1 -1
- data/lib/capybara/spec/views/initial_alert.erb +10 -0
- data/lib/capybara/version.rb +1 -1
- data/spec/shared_selenium_session.rb +5 -8
- metadata +4 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: fb46b7bc5ae7408ca3870b781d015a84bd84abd0a9c7e3ea2bcdf3d8fff85ce8
|
4
|
+
data.tar.gz: 1865dc1efa384c3792161a134bc536c56dca3aa0670ca298ad9f3aa12b49830d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9bc2cb739af408323d977b7ca829aa0862ef68ab7d1778c5ae67fb127a47a09258c1f5b53f9d7955bcfcd2892c869a136d7a5346b9115a9e55713ea47c95ebb3
|
7
|
+
data.tar.gz: e8d234ded45305e026b615c60e4eb8597e31fd67b7daefff51d13ab3d79868745e21668a6b45452366ac5a552b38e8c01dc669e73dbe45a9b38ecf8363b54e83
|
data/History.md
CHANGED
@@ -1,3 +1,15 @@
|
|
1
|
+
#Version 2.18.0
|
2
|
+
Release date: 2018-02-12
|
3
|
+
|
4
|
+
### Fixed
|
5
|
+
|
6
|
+
* Firefox/geckodriver setting of contenteditable childs contents
|
7
|
+
* Ignore Selenium::WebDriver::Error::SessionNotCreatedError when quitting driver [Tim Connor]
|
8
|
+
|
9
|
+
### Removed
|
10
|
+
|
11
|
+
* Headless chrome modal JS injection that is no longer needed for Chrome 64+/chromedriver 2.35+
|
12
|
+
|
1
13
|
# Version 2.17.0
|
2
14
|
Release date: 2018-01-02
|
3
15
|
|
@@ -232,41 +232,27 @@ class Capybara::Selenium::Driver < Capybara::Driver::Base
|
|
232
232
|
end
|
233
233
|
|
234
234
|
def accept_modal(_type, options={})
|
235
|
-
if
|
236
|
-
|
237
|
-
insert_modal_handlers(true, options[:with])
|
238
|
-
yield
|
239
|
-
find_headless_modal(options)
|
240
|
-
else
|
241
|
-
yield if block_given?
|
242
|
-
modal = find_modal(options)
|
235
|
+
yield if block_given?
|
236
|
+
modal = find_modal(options)
|
243
237
|
|
244
|
-
|
238
|
+
modal.send_keys options[:with] if options[:with]
|
245
239
|
|
246
|
-
|
247
|
-
|
248
|
-
|
249
|
-
end
|
240
|
+
message = modal.text
|
241
|
+
modal.accept
|
242
|
+
message
|
250
243
|
end
|
251
244
|
|
252
245
|
def dismiss_modal(_type, options={})
|
253
|
-
if
|
254
|
-
|
255
|
-
|
256
|
-
|
257
|
-
|
258
|
-
else
|
259
|
-
yield if block_given?
|
260
|
-
modal = find_modal(options)
|
261
|
-
message = modal.text
|
262
|
-
modal.dismiss
|
263
|
-
message
|
264
|
-
end
|
246
|
+
yield if block_given?
|
247
|
+
modal = find_modal(options)
|
248
|
+
message = modal.text
|
249
|
+
modal.dismiss
|
250
|
+
message
|
265
251
|
end
|
266
252
|
|
267
253
|
def quit
|
268
254
|
@browser.quit if @browser
|
269
|
-
rescue Errno::ECONNREFUSED
|
255
|
+
rescue Selenium::WebDriver::Error::SessionNotCreatedError, Errno::ECONNREFUSED
|
270
256
|
# Browser must have already gone
|
271
257
|
rescue Selenium::WebDriver::Error::UnknownError => e
|
272
258
|
unless silenced_unknown_error_message?(e.message) # Most likely already gone
|
@@ -308,18 +294,6 @@ class Capybara::Selenium::Driver < Capybara::Driver::Base
|
|
308
294
|
browser_name == "chrome"
|
309
295
|
end
|
310
296
|
|
311
|
-
# @api private
|
312
|
-
def headless_chrome?
|
313
|
-
if chrome?
|
314
|
-
caps = @processed_options[:desired_capabilities]
|
315
|
-
chrome_options = caps[:chrome_options] || caps[:chromeOptions] || {}
|
316
|
-
args = chrome_options['args'] || chrome_options[:args] || []
|
317
|
-
return args.include?("--headless") || args.include?("headless")
|
318
|
-
end
|
319
|
-
return false
|
320
|
-
end
|
321
|
-
|
322
|
-
|
323
297
|
# @deprecated This method is being removed
|
324
298
|
def browser_initialized?
|
325
299
|
super && !@browser.nil?
|
@@ -78,7 +78,7 @@ class Capybara::Selenium::Node < Capybara::Driver::Node
|
|
78
78
|
JS
|
79
79
|
driver.execute_script script, self
|
80
80
|
|
81
|
-
if
|
81
|
+
if driver.chrome? || driver.firefox?
|
82
82
|
# chromedriver raises a can't focus element for child elements if we use native.send_keys
|
83
83
|
# we've already focused it so just use action api
|
84
84
|
driver.browser.action.send_keys(value.to_s).perform
|
data/lib/capybara/version.rb
CHANGED
@@ -58,16 +58,16 @@ RSpec.shared_examples "Capybara::Session" do |session, mode|
|
|
58
58
|
describe "#accept_alert" do
|
59
59
|
it "supports a blockless mode" do
|
60
60
|
@session.visit('/with_js')
|
61
|
-
skip "Headless Chrome doesn't support blockless modal methods" if @session.driver.send(:headless_chrome?)
|
62
61
|
@session.click_link('Open alert')
|
63
62
|
@session.accept_alert
|
64
63
|
expect{@session.driver.browser.switch_to.alert}.to raise_error(@session.driver.send(:modal_error))
|
65
64
|
end
|
66
65
|
|
67
|
-
it "
|
68
|
-
@session.
|
69
|
-
|
70
|
-
|
66
|
+
it "can be called before visiting" do
|
67
|
+
@session.accept_alert "Initial alert" do
|
68
|
+
@session.visit('/initial_alert')
|
69
|
+
end
|
70
|
+
expect(@session).to have_text('Initial alert page')
|
71
71
|
end
|
72
72
|
end
|
73
73
|
|
@@ -205,9 +205,6 @@ RSpec.shared_examples "Capybara::Session" do |session, mode|
|
|
205
205
|
|
206
206
|
describe "Element#click" do
|
207
207
|
it "should handle fixed headers/footers" do
|
208
|
-
if mode == :selenium_marionette && !(ENV['TRAVIS_ALLOW_FAILURE']=='true')
|
209
|
-
pending "geckodriver/firefox/marionette just fail to click without reporting an error - no way for us to detect/catch"
|
210
|
-
end
|
211
208
|
@session.visit('/with_fixed_header_footer')
|
212
209
|
# @session.click_link('Go to root')
|
213
210
|
@session.find(:link, 'Go to root').click
|
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: 2.
|
4
|
+
version: 2.18.0
|
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: 2018-
|
13
|
+
date: 2018-02-13 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: nokogiri
|
@@ -449,6 +449,7 @@ files:
|
|
449
449
|
- lib/capybara/spec/views/frame_two.erb
|
450
450
|
- lib/capybara/spec/views/header_links.erb
|
451
451
|
- lib/capybara/spec/views/host_links.erb
|
452
|
+
- lib/capybara/spec/views/initial_alert.erb
|
452
453
|
- lib/capybara/spec/views/path.erb
|
453
454
|
- lib/capybara/spec/views/popup_one.erb
|
454
455
|
- lib/capybara/spec/views/popup_two.erb
|
@@ -516,7 +517,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
516
517
|
version: '0'
|
517
518
|
requirements: []
|
518
519
|
rubyforge_project:
|
519
|
-
rubygems_version: 2.7.
|
520
|
+
rubygems_version: 2.7.4
|
520
521
|
signing_key:
|
521
522
|
specification_version: 4
|
522
523
|
summary: Capybara aims to simplify the process of integration testing Rack applications,
|