Class: NullDriverPageElement
- Inherits:
-
Object
- Object
- NullDriverPageElement
- Defined in:
- lib/rutl/driver/null_driver_page_element.rb
Overview
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.
Instance Attribute Summary collapse
-
#destinations ⇒ Object
Returns the value of attribute destinations.
-
#interface ⇒ Object
Returns the value of attribute interface.
-
#selector ⇒ Object
readonly
Returns the value of attribute selector.
-
#selector_type ⇒ Object
readonly
Returns the value of attribute selector_type.
-
#string ⇒ Object
Returns the value of attribute string.
Instance Method Summary collapse
- #attribute(attr) ⇒ Object
-
#clear ⇒ Object
Return simple strings for checks against the NullDriver instead of having to use some heavyweight UI.
- #click ⇒ Object
-
#initialize(selector_type, selector) ⇒ NullDriverPageElement
constructor
A new instance of NullDriverPageElement.
- #send_keys(string) ⇒ Object
Constructor Details
#initialize(selector_type, selector) ⇒ NullDriverPageElement
Returns a new instance of NullDriverPageElement.
12 13 14 15 16 |
# File 'lib/rutl/driver/null_driver_page_element.rb', line 12 def initialize(selector_type, selector) # :css, selector @selector_type = selector_type @selector = selector end |
Instance Attribute Details
#destinations ⇒ Object
Returns the value of attribute destinations.
10 11 12 |
# File 'lib/rutl/driver/null_driver_page_element.rb', line 10 def destinations @destinations end |
#interface ⇒ Object
Returns the value of attribute interface.
9 10 11 |
# File 'lib/rutl/driver/null_driver_page_element.rb', line 9 def interface @interface end |
#selector ⇒ Object (readonly)
Returns the value of attribute selector.
7 8 9 |
# File 'lib/rutl/driver/null_driver_page_element.rb', line 7 def selector @selector end |
#selector_type ⇒ Object (readonly)
Returns the value of attribute selector_type.
7 8 9 |
# File 'lib/rutl/driver/null_driver_page_element.rb', line 7 def selector_type @selector_type end |
#string ⇒ Object
Returns the value of attribute string.
6 7 8 |
# File 'lib/rutl/driver/null_driver_page_element.rb', line 6 def string @string end |
Instance Method Details
#attribute(attr) ⇒ Object
22 23 24 25 26 27 28 29 |
# File 'lib/rutl/driver/null_driver_page_element.rb', line 22 def attribute(attr) case attr.to_sym when :value @string else raise ArgumentError, "Attribute unknown: #{attr}" end end |
#clear ⇒ Object
Return simple strings for checks against the NullDriver instead of having to use some heavyweight UI.
33 34 35 |
# File 'lib/rutl/driver/null_driver_page_element.rb', line 33 def clear 'clear' end |
#click ⇒ Object
37 38 39 |
# File 'lib/rutl/driver/null_driver_page_element.rb', line 37 def click 'click' end |
#send_keys(string) ⇒ Object
18 19 20 |
# File 'lib/rutl/driver/null_driver_page_element.rb', line 18 def send_keys(string) @string = string end |