Class: RedGlassListener

Inherits:
Selenium::WebDriver::Support::AbstractEventListener
  • Object
show all
Defined in:
lib/red-glass/red_glass_listener.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#red_glassObject

Returns the value of attribute red_glass.



4
5
6
# File 'lib/red-glass/red_glass_listener.rb', line 4

def red_glass
  @red_glass
end

Instance Method Details

#after_navigate_back(driver) ⇒ Object



14
15
16
17
18
19
20
# File 'lib/red-glass/red_glass_listener.rb', line 14

def after_navigate_back(driver)
  if recording?
    @red_glass.event_sequence.clear
    @red_glass. = {}
    @red_glass.reload
  end
end

#after_navigate_forward(driver) ⇒ Object



22
23
24
25
26
27
28
# File 'lib/red-glass/red_glass_listener.rb', line 22

def after_navigate_forward(driver)
  if recording?
    @red_glass.event_sequence.clear
    @red_glass. = {}
    @red_glass.reload
  end
end

#after_navigate_to(url, driver) ⇒ Object



30
31
32
33
34
35
36
# File 'lib/red-glass/red_glass_listener.rb', line 30

def after_navigate_to(url, driver)
  if recording?
    @red_glass.event_sequence.clear
    @red_glass. = {}
    @red_glass.reload
  end
end

#before_change_value_of(element, driver) ⇒ Object



6
7
8
# File 'lib/red-glass/red_glass_listener.rb', line 6

def before_change_value_of(element, driver)
  @red_glass.event_sequence << { :change_value => element.tag_name } if recording?
end

#before_click(element, driver) ⇒ Object



10
11
12
# File 'lib/red-glass/red_glass_listener.rb', line 10

def before_click(element, driver)
  @red_glass.event_sequence << { :click => element.tag_name } if recording?
end