spec/implementation.rb in watir-webdriver-0.5.5 vs spec/implementation.rb in watir-webdriver-0.5.6

- old
+ new

@@ -57,11 +57,11 @@ :webdriver, # guard only applies to webdriver browser, # guard only applies to this browser [:webdriver, browser] # guard only applies to this browser on webdriver ] - if native_events? || native_events_by_default? + if native_events? # guard only applies to this browser on webdriver with native events enabled matching_guards << [:webdriver, browser, :native_events] else # guard only applies to this browser on webdriver with native events disabled matching_guards << [:webdriver, browser, :synthesized_events] @@ -110,10 +110,16 @@ def browser @browser ||= (ENV['WATIR_WEBDRIVER_BROWSER'] || :firefox).to_sym end def native_events? - ENV['NATIVE_EVENTS'] == "true" + if ENV['NATIVE_EVENTS'] == "true" + true + elsif ENV['NATIVE_EVENTS'] == "false" && !ie? + false + else + native_events_by_default? + end end def native_events_by_default? Selenium::WebDriver::Platform.windows? && [:firefox, :ie].include?(browser) end