Skip to content

Commit dc4f5f6

Browse files
committed
Ruby: make sure the alert text is included in UnhandledAlertErrors
1 parent 55e1308 commit dc4f5f6

File tree

4 files changed

+4
-2
lines changed

4 files changed

+4
-2
lines changed

rake-tasks/crazy_fun/mappings/ruby.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ def handle(fun, dir, args)
105105
ruby :include => args[:include],
106106
:require => args[:require],
107107
:command => args[:command],
108-
:args => %w[--format CI::Reporter::RSpec --format s --color] + (!!ENV['example'] ? ['--example', ENV['example']] : []),
108+
:args => %w[--format CI::Reporter::RSpec --format doc --color] + (!!ENV['example'] ? ['--example', ENV['example']] : []),
109109
:debug => !!ENV['log'],
110110
:files => args[:srcs]
111111
end

rb/CHANGES

+1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
2.43.0 (???)
22
============
33

4+
* Make sure UnhandledAlertErrors includes the alert text if provided by the driver.
45
* Firefox
56
- Make sure browser process is properly killed if silent startup hangs (#7392)
67

rb/lib/selenium/webdriver/remote/response.rb

+1
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ def error_message
3131
case val
3232
when Hash
3333
msg = val['message'] or return "unknown error"
34+
msg << ": #{val['alert']['text'].inspect}" if val['alert'].kind_of?(Hash) && val['alert']['text']
3435
msg << " (#{ val['class'] })" if val['class']
3536
when String
3637
msg = val

rb/spec/integration/selenium/webdriver/target_locator_spec.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,7 @@
175175
driver.find_element(:id => "alert").click
176176
wait_for_alert
177177

178-
lambda { driver.title }.should raise_error(Selenium::WebDriver::Error::UnhandledAlertError)
178+
lambda { driver.title }.should raise_error(Selenium::WebDriver::Error::UnhandledAlertError, /: "cheese"/)
179179

180180
driver.title.should == "Testing Alerts" # :chrome does not auto-dismiss the alert
181181
end

0 commit comments

Comments
 (0)