Class: ActionCounter
- Inherits:
-
Object
- Object
- ActionCounter
- Defined in:
- lib/selenium_interaction_statistics/action_counter.rb
Instance Attribute Summary collapse
-
#clicks ⇒ Object
Returns the value of attribute clicks.
-
#found_elements ⇒ Object
Returns the value of attribute found_elements.
-
#sent_keys ⇒ Object
Returns the value of attribute sent_keys.
Instance Method Summary collapse
- #add_click ⇒ Object
- #add_found_element ⇒ Object
- #add_send_keys ⇒ Object
-
#initialize ⇒ ActionCounter
constructor
A new instance of ActionCounter.
- #results ⇒ Object
Constructor Details
#initialize ⇒ ActionCounter
Returns a new instance of ActionCounter.
2 3 4 5 6 |
# File 'lib/selenium_interaction_statistics/action_counter.rb', line 2 def initialize @clicks=0 @sent_keys=0 @found_elements=0 end |
Instance Attribute Details
#clicks ⇒ Object
Returns the value of attribute clicks.
8 9 10 |
# File 'lib/selenium_interaction_statistics/action_counter.rb', line 8 def clicks @clicks end |
#found_elements ⇒ Object
Returns the value of attribute found_elements.
8 9 10 |
# File 'lib/selenium_interaction_statistics/action_counter.rb', line 8 def found_elements @found_elements end |
#sent_keys ⇒ Object
Returns the value of attribute sent_keys.
8 9 10 |
# File 'lib/selenium_interaction_statistics/action_counter.rb', line 8 def sent_keys @sent_keys end |
Instance Method Details
#add_click ⇒ Object
10 11 12 |
# File 'lib/selenium_interaction_statistics/action_counter.rb', line 10 def add_click @clicks+=1 end |
#add_found_element ⇒ Object
18 19 20 |
# File 'lib/selenium_interaction_statistics/action_counter.rb', line 18 def add_found_element @found_elements+=1 end |
#add_send_keys ⇒ Object
14 15 16 |
# File 'lib/selenium_interaction_statistics/action_counter.rb', line 14 def add_send_keys @sent_keys+=1 end |
#results ⇒ Object
22 23 24 |
# File 'lib/selenium_interaction_statistics/action_counter.rb', line 22 def results "\nperformed actions:\n\tfound_elements\t #{found_elements}\n\tclicks\t #{clicks}\n\tsend_keys #{sent_keys}" end |