Sha256: 1a6812e21b7b01709851c79d3653ca05ba7daed559441d75b7db70945ffccaed

Contents?: true

Size: 749 Bytes

Versions: 4

Compression:

Stored size: 749 Bytes

Contents

#
# Page elements. Base class.
#
class BaseElement
  attr_accessor :context

  def initialize(element_context)
    raise element_context.to_s unless element_context.is_a? ElementContext
    @context = element_context
    # Not sure why, but I'm seeing Chrome fail becase the context interface
    # passed in isn't the same as the browser's interface.
    # This only happens with click test cases, before the click, and
    # only if that case isn't run first.
    # The context we're passed is also an instance from as ChromeInterface,
    # but a different instance.
    #
    # Here's the kludge workaround line:
    @context.interface = $browser.interface
  end

  def this_css
    @context.find_element(:css)
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
rutl-0.3.0 lib/rutl/interface/elements/base_element.rb
rutl-0.2.1 lib/rutl/interface/elements/base_element.rb
rutl-0.2.0 lib/rutl/interface/elements/base_element.rb
rutl-0.1.4 lib/rutl/interface/elements/base_element.rb