Sha256: 2f036be2e32c437f48d7ddba7dce9fb788f87a94f31824d70a01577f5eb8078c

Contents?: true

Size: 765 Bytes

Versions: 22

Compression:

Stored size: 765 Bytes

Contents

module TestCentricity
  class TextField < UIElement
    def initialize(parent, locator, context)
      @parent  = parent
      @locator = locator
      @context = context
      @type    = :textfield
      @alt_locator = nil
    end
  end

  # Is text field set to read-only?
  #
  # @return [Boolean]
  # @example
  #   comments_field.read_only?
  #
  def read_only?
    obj, _ = find_element
    object_not_found_exception(obj, nil)
    !!obj.native.attribute('readonly')
  end

  # Return maxlength character count of a text field.
  #
  # @return [Integer]
  # @example
  #   max_num_chars = comments_field.get_max_length
  #
  def get_max_length
    obj, _ = find_element
    object_not_found_exception(obj, nil)
    obj.native.attribute('maxlength')
  end
end

Version data entries

22 entries across 22 versions & 1 rubygems

Version Path
testcentricity_web-0.6.6.1 lib/testcentricity_web/elements/textfield.rb
testcentricity_web-0.6.6 lib/testcentricity_web/elements/textfield.rb