capybara 3.20.0 → 3.20.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/History.md +8 -0
- data/lib/capybara.rb +8 -0
- data/lib/capybara/node/simple.rb +1 -0
- data/lib/capybara/spec/session/node_spec.rb +1 -0
- data/lib/capybara/spec/session/scroll_spec.rb +1 -1
- data/lib/capybara/spec/views/with_html.erb +4 -0
- data/lib/capybara/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6a7113f8a1fdef865586a49c01ae406da91d172955acf96b4038f81d39afdd4d
|
4
|
+
data.tar.gz: 9d01e25c2d34e5e2870da21ed33e3b136630c3b035fec3c95aeaccf02548e0cc
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ca15a47f8e6e98479d369c90518815fdecc62c2b0e576794fa88ec62a3fb5a39047733a482ec85af6ea85c359932b2c91d9dd77c84945b25021e21338787338e
|
7
|
+
data.tar.gz: ade8a1e834b23281cbcab18fdf226dcd5f7617d1fc9325c52d766f031497f0a1ef1129ff3582c5b87ce8df46a9449fbc6bd156a5e7fb5d941d5322751e4cd9de
|
data/History.md
CHANGED
@@ -1,5 +1,13 @@
|
|
1
|
+
# Version 3.20.1
|
2
|
+
Release date: 2019-05-17
|
3
|
+
|
4
|
+
### Fixed
|
5
|
+
|
6
|
+
* RackTest driver considers <template> elements to be non-visible and ignores the contents
|
7
|
+
|
1
8
|
# Version 3.20.0
|
2
9
|
Release date: 2019-05-14
|
10
|
+
|
3
11
|
### Added
|
4
12
|
|
5
13
|
* `Node#obscured?` to check viewport presence and element overlap
|
data/lib/capybara.rb
CHANGED
@@ -371,6 +371,10 @@ module Capybara
|
|
371
371
|
def HTML(html) # rubocop:disable Naming/MethodName
|
372
372
|
if Nokogiri.respond_to?(:HTML5) && Capybara.allow_gumbo # Nokogumbo installed and allowed for use
|
373
373
|
Nokogiri::HTML5(html).tap do |document|
|
374
|
+
document.xpath('//template').each do |template|
|
375
|
+
# template elements content is not part of the document
|
376
|
+
template.inner_html = ''
|
377
|
+
end
|
374
378
|
document.xpath('//textarea').each do |textarea|
|
375
379
|
# The Nokogumbo HTML5 parser already returns spec compliant contents
|
376
380
|
textarea['_capybara_raw_value'] = textarea.content
|
@@ -378,6 +382,10 @@ module Capybara
|
|
378
382
|
end
|
379
383
|
else
|
380
384
|
Nokogiri::HTML(html).tap do |document|
|
385
|
+
document.xpath('//template').each do |template|
|
386
|
+
# template elements content is not part of the document
|
387
|
+
template.inner_html = ''
|
388
|
+
end
|
381
389
|
document.xpath('//textarea').each do |textarea|
|
382
390
|
textarea['_capybara_raw_value'] = textarea.content.sub(/\A\n/, '')
|
383
391
|
end
|
data/lib/capybara/node/simple.rb
CHANGED
@@ -242,6 +242,7 @@ Capybara::SpecHelper.spec 'node' do
|
|
242
242
|
expect(@session.find('//div[@id="hidden_attr"]')).not_to be_visible
|
243
243
|
expect(@session.find('//a[@id="hidden_attr_via_ancestor"]')).not_to be_visible
|
244
244
|
expect(@session.find('//input[@id="hidden_input"]')).not_to be_visible
|
245
|
+
expect(@session.find('//template')).not_to be_visible
|
245
246
|
end
|
246
247
|
|
247
248
|
it 'should be boolean' do
|
@@ -24,7 +24,7 @@ Capybara::SpecHelper.spec '#scroll_to', requires: [:scroll] do
|
|
24
24
|
@session.scroll_to(el, align: :center)
|
25
25
|
el_center = el.evaluate_script('(function(rect){return (rect.top + rect.bottom)/2})(this.getBoundingClientRect())')
|
26
26
|
viewport_bottom = el.evaluate_script('document.body.clientHeight')
|
27
|
-
expect(el_center).to be_within(
|
27
|
+
expect(el_center).to be_within(2).of(viewport_bottom / 2)
|
28
28
|
end
|
29
29
|
|
30
30
|
it 'can scroll the window to the vertical top' do
|
@@ -178,5 +178,9 @@ banana</textarea>
|
|
178
178
|
                   
|
179
179
|
</div>
|
180
180
|
|
181
|
+
<template id="template">
|
182
|
+
<input />
|
183
|
+
</template>
|
184
|
+
|
181
185
|
<a href="/download.csv" download>Download Me</a>
|
182
186
|
<a href="/download.csv" download="other.csv">Download Other</a>
|
data/lib/capybara/version.rb
CHANGED
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.20.
|
4
|
+
version: 3.20.1
|
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-05-
|
13
|
+
date: 2019-05-17 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: addressable
|