Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Comparing changes

Choose two branches to see what's changed or to start a new pull request. If you need to, you can also compare across forks.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also compare across forks.
base fork: thoughtbot/capybara-webkit
...
head fork: freegenie/capybara-webkit
Checking mergeability… Don't worry, you can still create the pull request.
  • 2 commits
  • 3 files changed
  • 0 commit comments
  • 1 contributor
Showing with 35 additions and 0 deletions.
  1. +4 −0 Gemfile.lock
  2. +28 −0 spec/driver_spec.rb
  3. +3 −0  spec/spec_helper.rb
View
4 Gemfile.lock
@@ -25,6 +25,7 @@ GEM
ffi (1.9.3-java)
ffi (1.9.3-x86-mingw32)
json (1.8.1)
+ json (1.8.1-java)
launchy (2.4.2)
addressable (~> 2.3)
launchy (2.4.2-java)
@@ -37,6 +38,9 @@ GEM
multi_json (1.8.4)
nokogiri (1.6.2.1)
mini_portile (= 0.6.0)
+ nokogiri (1.6.2.1-java)
+ nokogiri (1.6.2.1-x86-mingw32)
+ mini_portile (= 0.6.0)
rack (1.5.2)
rack-protection (1.3.2)
rack
View
28 spec/driver_spec.rb
@@ -656,6 +656,22 @@ def visit(url, driver=driver)
</html>
HTML
end
+
+ get '/double' do
+ <<-HTML
+ <html>
+ <head>
+ </head>
+ <body>
+ <script type="text/javascript">
+ alert('First alert');
+ </script>
+ <input type="button" onclick="alert('Second alert')" name="test"/>
+ </body>
+ </html>
+ HTML
+ end
+
end
end
@@ -681,6 +697,18 @@ def visit(url, driver=driver)
}.to raise_error Capybara::ModalNotFound, "Unable to find modal dialog with No?"
end
+ it 'finds two alert windows in a row', focus: true do
+ driver.accept_modal(:alert, text: 'First alert') do
+ visit('/double')
+ end
+
+ expect {
+ driver.accept_modal(:alert, text: 'Boom') do
+ driver.find_xpath("//input").first.click
+ end
+ }.to raise_error Capybara::ModalNotFound, "Unable to find modal dialog with Boom"
+ end
+
it 'waits to accept an async alert modal' do
visit("/async")
alert_message = driver.accept_modal(:alert) do
View
3  spec/spec_helper.rb
@@ -26,6 +26,9 @@
RSpec.configure do |c|
Capybara::SpecHelper.configure(c)
+ c.filter_run :focus => true
+ c.run_all_when_everything_filtered = true
+
c.filter_run_excluding :skip_on_windows => !(RbConfig::CONFIG['host_os'] =~ /mingw32/).nil?
c.filter_run_excluding :skip_on_jruby => !defined?(::JRUBY_VERSION).nil?
c.filter_run_excluding :selenium_compatibility => (Capybara::VERSION =~ /^2\.4\./).nil?

No commit comments for this range

Something went wrong with that request. Please try again.