def when_enabled(timeout = nil)
      msg = '#when_enabled'
      repl_msg = 'wait_until(&:enabled?)'
      Watir.logger.deprecate msg, repl_msg, ids: [:when_enabled]

      timeout ||= Watir.default_timeout
      message = "waiting for #{selector_string} to become enabled"

      if block_given?
        Wait.until(timeout, message) { enabled? }
        yield self
      else
        WhenEnabledDecorator.new(self, timeout, message)
      end
    end
def when_enabled(timeout = nil)
      msg = '#when_enabled'
      repl_msg = 'wait_until(&:enabled?)'
      Watir.logger.deprecate msg, repl_msg, ids: [:when_enabled]

      timeout ||= Watir.default_timeout
      message = "waiting for #{selector_string} to become enabled"

      if block_given?
        Wait.until(timeout, message) { enabled? }
        yield self
      else
        WhenEnabledDecorator.new(self, timeout, message)
      end
    end
Waits until the element is enabled.

 @example
   browser.button(name: "new_user_button_2").when_enabled.click

 @param [Integer] timeout seconds to wait before timing out

 @see Watir::Wait
 @see Watir::Element#enabled?