Sha256: 71a25c15ec5e0fa01f4ffb26560e6ebb1e46e0113fedb99ea91eddf5da0d07dc

Contents?: true

Size: 832 Bytes

Versions: 42

Compression:

Stored size: 832 Bytes

Contents

module TestCentricity
  class Range < TextField
    def initialize(name, parent, locator, context)
      super
      @type = :range
    end

    # Set the value property of a range type input object.
    #
    # @param value [Integer]
    # @example
    #   volume_level.value = 11
    #
    def value=(value)
      obj, = find_element
      object_not_found_exception(obj, nil)
      page.execute_script('arguments[0].value = arguments[1]', obj, value)
      obj.send_keys(:right)
    end

    def get_value(visible = true)
      obj, type = find_element(visible)
      object_not_found_exception(obj, type)
      result = obj.value
      unless result.blank?
        if result.is_int?
          result.to_i
        elsif result.is_float?
          result.to_f
        else
          result
        end
      end
    end
  end
end

Version data entries

42 entries across 42 versions & 1 rubygems

Version Path
testcentricity_web-3.2.25 lib/testcentricity_web/web_elements/range.rb
testcentricity_web-3.2.24 lib/testcentricity_web/web_elements/range.rb
testcentricity_web-3.2.23 lib/testcentricity_web/web_elements/range.rb
testcentricity_web-3.2.22 lib/testcentricity_web/web_elements/range.rb
testcentricity_web-3.2.21 lib/testcentricity_web/web_elements/range.rb
testcentricity_web-3.2.20 lib/testcentricity_web/web_elements/range.rb
testcentricity_web-3.2.19 lib/testcentricity_web/web_elements/range.rb
testcentricity_web-3.2.18 lib/testcentricity_web/web_elements/range.rb
testcentricity_web-3.2.17 lib/testcentricity_web/web_elements/range.rb
testcentricity_web-3.2.16 lib/testcentricity_web/web_elements/range.rb
testcentricity_web-3.2.15 lib/testcentricity_web/web_elements/range.rb
testcentricity_web-3.2.14 lib/testcentricity_web/web_elements/range.rb
testcentricity_web-3.2.13 lib/testcentricity_web/web_elements/range.rb
testcentricity_web-3.2.12 lib/testcentricity_web/web_elements/range.rb
testcentricity_web-3.2.11 lib/testcentricity_web/web_elements/range.rb
testcentricity_web-3.2.10 lib/testcentricity_web/web_elements/range.rb
testcentricity_web-3.2.9 lib/testcentricity_web/web_elements/range.rb
testcentricity_web-3.2.8 lib/testcentricity_web/web_elements/range.rb
testcentricity_web-3.2.7 lib/testcentricity_web/web_elements/range.rb
testcentricity_web-3.2.6 lib/testcentricity_web/web_elements/range.rb