Class: RAutomation::Button
- Inherits:
-
Object
- Object
- RAutomation::Button
- Defined in:
- lib/rautomation/button.rb
Instance Method Summary collapse
-
#click {|button| ... }
Performs a click on the button.
-
#exists? ⇒ Boolean
(also: #exist?)
Checks if the button exists.
-
#method_missing(name, *args)
Allows to execute specific Adapter methods not part of the public API.
-
#value ⇒ String
Retrieves the value (text) of the button, usually the visible text.
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(name, *args)
Allows to execute specific Adapter methods not part of the public API.
43 44 45 |
# File 'lib/rautomation/button.rb', line 43 def method_missing(name, *args) @button.send(name, *args) end |
Instance Method Details
#click {|button| ... }
Performs a click on the button. By default click is considered successful if the button doesn’t exist after clicking (e.g. window has closed)
17 18 19 20 21 22 23 24 |
# File 'lib/rautomation/button.rb', line 17 def click wait_until_exists if block_given? @button.click {yield self} else @button.click end end |
#exists? ⇒ Boolean Also known as: exist?
Checks if the button exists.
36 37 38 |
# File 'lib/rautomation/button.rb', line 36 def exists? @button.exists? end |
#value ⇒ String
Retrieves the value (text) of the button, usually the visible text.
29 30 31 32 |
# File 'lib/rautomation/button.rb', line 29 def value wait_until_exists @button.value end |