Class: BaseElement
- Inherits:
-
Object
- Object
- BaseElement
- Defined in:
- lib/rutl/interface/elements/base_element.rb
Overview
Page elements. Base class.
Instance Attribute Summary collapse
-
#context ⇒ Object
Returns the value of attribute context.
Instance Method Summary collapse
-
#initialize(element_context) ⇒ BaseElement
constructor
A new instance of BaseElement.
- #this_css ⇒ Object
Constructor Details
#initialize(element_context) ⇒ BaseElement
Returns a new instance of BaseElement.
7 8 9 10 11 12 13 14 15 16 17 18 19 |
# File 'lib/rutl/interface/elements/base_element.rb', line 7 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 |
Instance Attribute Details
#context ⇒ Object
Returns the value of attribute context.
5 6 7 |
# File 'lib/rutl/interface/elements/base_element.rb', line 5 def context @context end |
Instance Method Details
#this_css ⇒ Object
21 22 23 |
# File 'lib/rutl/interface/elements/base_element.rb', line 21 def this_css @context.find_element(:css) end |