Class: BaseElement
- Inherits:
-
Object
- Object
- BaseElement
- Defined in:
- lib/rutl/interface/elements/base_element.rb
Overview
Page elements. Base class.
Instance Attribute Summary collapse
-
#destinations ⇒ Object
Returns the value of attribute destinations.
-
#interface ⇒ Object
Returns the value of attribute interface.
-
#selectors ⇒ Object
Returns the value of attribute selectors.
Instance Method Summary collapse
- #driver ⇒ Object
- #find_css(selectors) ⇒ Object
-
#initialize(selectors = {}, destinations = []) ⇒ BaseElement
constructor
A new instance of BaseElement.
- #this_css ⇒ Object
Constructor Details
#initialize(selectors = {}, destinations = []) ⇒ BaseElement
Returns a new instance of BaseElement.
12 13 14 15 |
# File 'lib/rutl/interface/elements/base_element.rb', line 12 def initialize(selectors = {}, destinations = []) @selectors = selectors @destinations = destinations end |
Instance Attribute Details
#destinations ⇒ Object
Returns the value of attribute destinations.
10 11 12 |
# File 'lib/rutl/interface/elements/base_element.rb', line 10 def destinations @destinations end |
#interface ⇒ Object
Returns the value of attribute interface.
5 6 7 |
# File 'lib/rutl/interface/elements/base_element.rb', line 5 def interface @interface end |
#selectors ⇒ Object
Returns the value of attribute selectors.
9 10 11 |
# File 'lib/rutl/interface/elements/base_element.rb', line 9 def selectors @selectors end |
Instance Method Details
#driver ⇒ Object
6 7 8 |
# File 'lib/rutl/interface/elements/base_element.rb', line 6 def driver @interface.driver end |
#find_css(selectors) ⇒ Object
17 18 19 20 21 22 23 |
# File 'lib/rutl/interface/elements/base_element.rb', line 17 def find_css(selectors) result = driver.find_element(:css, selectors[:css]) return result unless NullDriver == result.class result.destinations = @destinations result.interface = @interface result end |
#this_css ⇒ Object
25 26 27 |
# File 'lib/rutl/interface/elements/base_element.rb', line 25 def this_css find_css(@selectors) end |