Class: ActionCounter

Inherits:
Object
  • Object
show all
Defined in:
lib/selenium_interaction_statistics/action_counter.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeActionCounter

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

#clicksObject

Returns the value of attribute clicks.



8
9
10
# File 'lib/selenium_interaction_statistics/action_counter.rb', line 8

def clicks
  @clicks
end

#found_elementsObject

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_keysObject

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_clickObject



10
11
12
# File 'lib/selenium_interaction_statistics/action_counter.rb', line 10

def add_click
  @clicks+=1
end

#add_found_elementObject



18
19
20
# File 'lib/selenium_interaction_statistics/action_counter.rb', line 18

def add_found_element
  @found_elements+=1
end

#add_send_keysObject



14
15
16
# File 'lib/selenium_interaction_statistics/action_counter.rb', line 14

def add_send_keys
  @sent_keys+=1
end

#resultsObject



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