Sha256: b52c244303b4e9b6961d27c26b9739740c379bc48dbf88e6157f5ce69c50e2e1

Contents?: true

Size: 836 Bytes

Versions: 3

Compression:

Stored size: 836 Bytes

Contents

#
# This fakes all page elements when used with the null driver.
# It's a dirty way to avoid modeling all of what a driver talks to.
#
class NullDriverPageElement
  attr_accessor :string
  attr_reader :selector_type, :selector

  attr_accessor :interface
  attr_accessor :destinations

  def initialize(selector_type, selector)
    # :css, selector
    @selector_type = selector_type
    @selector = selector
  end

  def send_keys(string)
    @string = string
  end

  def attribute(attr)
    case attr.to_sym
    when :value
      @string
    else
      raise ArgumentError, "Attribute unknown: #{attr}"
    end
  end

  # Return simple strings for checks against the NullDriver instead of
  # having to use some heavyweight UI.
  def clear
    'clear'
  end

  def click
    'click'
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
rutl-0.1.3 lib/rutl/driver/null_driver_page_element.rb
rutl-0.1.2 lib/rutl/driver/null_driver_page_element.rb
rutl-0.1.1 lib/rutl/driver/null_driver_page_element.rb