lib/page.rb in gridium-1.1.23 vs lib/page.rb in gridium-1.1.24

- old
+ new

@@ -64,10 +64,15 @@ timeout = opts[:timeout] || 5 wait = Selenium::WebDriver::Wait.new(:timeout => timeout) begin elem = Element.new("#{button_text} button", :xpath, "//button[contains(., \"#{button_text}\")]", timeout: timeout) - wait.until {elem.enabled?} + + if opts[:disabled] + wait.until {elem.disabled?} + else + wait.until {elem.enabled?} + end rescue Exception => exception Log.debug("[GRIDIUM::Page] has_button? is false because this exception was rescued: #{exception}") return false end end