Sha256: 9a039f3dd238327c79d4a56cac1d6306093d55b8e33f6e626515b073ffaeff11

Contents?: true

Size: 1.47 KB

Versions: 10

Compression:

Stored size: 1.47 KB

Contents

module OperaWatir
  class QuickDropdown < QuickEditField #QuickWidget

    # @private
    # Checks the type of the widget is correct
    def correct_type?
      @element.getType == WIDGET_ENUM_MAP[:dropdown]
    end

    ######################################################################
    # Checks if the item selected in the dropdown matches the text loaded
    # from Opera using the string_id
    #
    # @param [String] string_id String ID to use to load the string from the current
    #                 language file (e.g. "D_NEW_PREFERENCES_GENERAL")
    #
    # @return [Boolean] true if the dropdown has the item with the
    #                   string_id selected, otherwise false
    #
    # @raise [Exceptions::UnknownObjectException] if the widget could not be found
    #           using the specified method
    #
    def selected?(string_id)
      element.isSelected(string_id)
    end

    #########################################################################
    #
    # @example
    #    browser.quick_dropdown(:name, "Close_tab_dropdown").dropped_down?
    #
    # @return true if dropdown is dropped_down/open, else false
    #
    def dropped_down?
      element.getValue() > 0
    end


    ############################################################################
    # Click dropdown to open it
    #
    # @example
    #    browser.quick_dropdown(:name, "Close_tab_dropdown").open_with_click
    #
    def open_with_click
      click
      sleep(0.1)
    end

  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
operawatir-0.7.pre4-jruby lib/operawatir/quickwidgets/quick_dropdown.rb
operawatir-0.7.pre3-jruby lib/operawatir/quickwidgets/quick_dropdown.rb
operawatir-0.7.pre2-jruby lib/operawatir/quickwidgets/quick_dropdown.rb
operawatir-0.7.pre1-jruby lib/operawatir/quickwidgets/quick_dropdown.rb
operawatir-0.6.pre1-jruby lib/operawatir/quickwidgets/quick_dropdown.rb
operawatir-0.5.1-jruby lib/operawatir/quickwidgets/quick_dropdown.rb
operawatir-0.5-jruby lib/operawatir/quickwidgets/quick_dropdown.rb
operawatir-0.5.pre3-jruby lib/operawatir/quickwidgets/quick_dropdown.rb
operawatir-0.5.pre2-jruby lib/operawatir/quickwidgets/quick_dropdown.rb
operawatir-0.5.pre1-jruby lib/operawatir/quickwidgets/quick_dropdown.rb