capybara 2.7.0 → 2.7.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 -1
- data/lib/capybara.rb +2 -1
- data/lib/capybara/selenium/driver.rb +7 -14
- data/lib/capybara/spec/session/within_frame_spec.rb +11 -1
- data/lib/capybara/spec/views/frame_child.erb +8 -1
- data/lib/capybara/spec/views/frame_parent.erb +1 -1
- data/lib/capybara/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 85d6a1e7f742859bc5336d455e804e941efbaffe
|
4
|
+
data.tar.gz: 9235385a6473080bb3ac0cae536857a054d323fc
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 301575ccd96eb6a4239441886571377806d911f0de5868fc3891f052518199fef15424eba03429e8bf7e7ba5d1abba62e6953ba7a171a66ba2e3a325824806a8
|
7
|
+
data.tar.gz: 3339a52f863d7417eaedae85e8e556d5359f40a04f4c628dc883ddadd517a04d62c0f40b3a0d2d6cf2600842a6f3f1bb011d1df5fe88a977278273ae7055a417
|
data/History.md
CHANGED
@@ -1,5 +1,12 @@
|
|
1
|
+
#Version 2.7.1
|
2
|
+
Release date: 2016-05-01
|
3
|
+
|
4
|
+
### Fixed
|
5
|
+
* Issue where within_Frame would fail with Selenium if the frame is removed from within itself [Thomas Walpole]
|
6
|
+
* Reset sessions in reverse order so sessions with active servers are reset last - Issue #1692 [Jonas Nicklas, Thomas Walpole]
|
7
|
+
|
1
8
|
# Version 2.7.0
|
2
|
-
Release date:
|
9
|
+
Release date: 2016-04-07
|
3
10
|
|
4
11
|
### Fixed
|
5
12
|
* Element#visible?/checked?/disabled?/selected? Now return boolean
|
data/lib/capybara.rb
CHANGED
@@ -327,7 +327,8 @@ module Capybara
|
|
327
327
|
# as cookies.
|
328
328
|
#
|
329
329
|
def reset_sessions!
|
330
|
-
|
330
|
+
#reset in reverse so sessions that started servers are reset last
|
331
|
+
session_pool.reverse_each { |mode, session| session.reset! }
|
331
332
|
end
|
332
333
|
alias_method :reset!, :reset_sessions!
|
333
334
|
|
@@ -143,23 +143,16 @@ class Capybara::Selenium::Driver < Capybara::Driver::Base
|
|
143
143
|
#
|
144
144
|
def within_frame(frame_handle)
|
145
145
|
frame_handle = frame_handle.native if frame_handle.is_a?(Capybara::Node::Base)
|
146
|
-
|
147
|
-
|
148
|
-
@frame_handles[browser.window_handle] ||= []
|
149
|
-
@frame_handles[browser.window_handle] << frame_handle
|
150
|
-
end
|
146
|
+
@frame_handles[browser.window_handle] ||= []
|
147
|
+
@frame_handles[browser.window_handle] << frame_handle
|
151
148
|
browser.switch_to.frame(frame_handle)
|
152
149
|
yield
|
153
150
|
ensure
|
154
|
-
|
155
|
-
|
156
|
-
|
157
|
-
|
158
|
-
|
159
|
-
@frame_handles[browser.window_handle].pop
|
160
|
-
browser.switch_to.default_content
|
161
|
-
@frame_handles[browser.window_handle].each { |fh| browser.switch_to.frame(fh) }
|
162
|
-
end
|
151
|
+
# would love to use browser.switch_to.parent_frame here
|
152
|
+
# but it has an issue if the current frame is removed from within it
|
153
|
+
@frame_handles[browser.window_handle].pop
|
154
|
+
browser.switch_to.default_content
|
155
|
+
@frame_handles[browser.window_handle].each { |fh| browser.switch_to.frame(fh) }
|
163
156
|
end
|
164
157
|
|
165
158
|
def current_window_handle
|
@@ -40,7 +40,7 @@ Capybara::SpecHelper.spec '#within_frame', :requires => [:frames] do
|
|
40
40
|
@session.within_frame 'childFrame' do
|
41
41
|
@session.within_frame 'grandchildFrame1' do end
|
42
42
|
@session.within_frame 'grandchildFrame2' do end
|
43
|
-
end
|
43
|
+
end
|
44
44
|
end
|
45
45
|
end
|
46
46
|
it "should reset scope when changing frames" do
|
@@ -50,4 +50,14 @@ Capybara::SpecHelper.spec '#within_frame', :requires => [:frames] do
|
|
50
50
|
end
|
51
51
|
end
|
52
52
|
end
|
53
|
+
|
54
|
+
it "works if the frame is closed", :requires => [:frames, :js] do
|
55
|
+
@session.within_frame 'parentFrame' do
|
56
|
+
@session.within_frame 'childFrame' do
|
57
|
+
@session.click_link 'Close Window'
|
58
|
+
end
|
59
|
+
expect(@session).to have_selector(:css, 'body#parentBody')
|
60
|
+
expect(@session).not_to have_selector(:css, '#childFrame')
|
61
|
+
end
|
62
|
+
end
|
53
63
|
end
|
@@ -2,8 +2,15 @@
|
|
2
2
|
<html>
|
3
3
|
<head>
|
4
4
|
<title>This is the child frame title</title>
|
5
|
+
<script>
|
6
|
+
function closeWin() {
|
7
|
+
var iframe = window.parent.document.getElementById('childFrame')
|
8
|
+
iframe.parentNode.removeChild(iframe)
|
9
|
+
}
|
10
|
+
</script>
|
5
11
|
</head>
|
6
|
-
<body>
|
12
|
+
<body id="childBody">
|
13
|
+
<a href="javascript:void(0)" onClick="closeWin()">Close Window</a>
|
7
14
|
<iframe src="/frame_one" id="grandchildFrame1"></iframe>
|
8
15
|
<iframe src="/frame_two" id="grandchildFrame2"></iframe>
|
9
16
|
</body>
|
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: 2.7.
|
4
|
+
version: 2.7.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: 2016-
|
13
|
+
date: 2016-05-01 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: nokogiri
|
@@ -419,7 +419,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
419
419
|
version: '0'
|
420
420
|
requirements: []
|
421
421
|
rubyforge_project:
|
422
|
-
rubygems_version: 2.
|
422
|
+
rubygems_version: 2.6.3
|
423
423
|
signing_key:
|
424
424
|
specification_version: 4
|
425
425
|
summary: Capybara aims to simplify the process of integration testing Rack applications,
|