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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 13e267dd4eab833671b7653e9cec855306653102
4
- data.tar.gz: 80707daeb161eac1ac1cabff4edef7c06823b707
3
+ metadata.gz: 85d6a1e7f742859bc5336d455e804e941efbaffe
4
+ data.tar.gz: 9235385a6473080bb3ac0cae536857a054d323fc
5
5
  SHA512:
6
- metadata.gz: 03a372cfdbdd251f39577df0b83bd8286af62cc4d02bdedd49d91594fb3c2de88babacf628366f49c3a8d10470203bccfe371e461f3789f8c7dae0be94d6eda2
7
- data.tar.gz: 77db21ebef969917a1a8836d5d95e6a725f1fe6dc235fe0e795eeca25fd46b209f77487ddb5e38a523c80f7772ea6d17627ddabda78081e335e002847f8da53e
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: unreleased
9
+ Release date: 2016-04-07
3
10
 
4
11
  ### Fixed
5
12
  * Element#visible?/checked?/disabled?/selected? Now return boolean
@@ -327,7 +327,8 @@ module Capybara
327
327
  # as cookies.
328
328
  #
329
329
  def reset_sessions!
330
- session_pool.each { |mode, session| session.reset! }
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
- if !browser.switch_to.respond_to?(:parent_frame)
147
- # Selenium Webdriver < 2.43 doesnt support moving back to the parent
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
- if browser.switch_to.respond_to?(:parent_frame)
155
- browser.switch_to.parent_frame
156
- else
157
- # There doesnt appear to be any way in Selenium Webdriver < 2.43 to move back to a parent frame
158
- # other than going back to the root and then reiterating down
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>
@@ -3,7 +3,7 @@
3
3
  <head>
4
4
  <title>This is the parent frame title</title>
5
5
  </head>
6
- <body>
6
+ <body id="parentBody">
7
7
  <iframe src='/frame_child' id='childFrame'></iframe>
8
8
  </body>
9
9
  </html>
@@ -1,4 +1,4 @@
1
1
  # frozen_string_literal: true
2
2
  module Capybara
3
- VERSION = '2.7.0'
3
+ VERSION = '2.7.1'
4
4
  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: 2.7.0
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-04-07 00:00:00.000000000 Z
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.5.1
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,